Skip to content

Commit

Permalink
Ignore server secrets prototypes on client build
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed Feb 16, 2024
1 parent c9e5afd commit 1048124
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public override void Init()
_prototypeManager.RegisterIgnore("alertLevels");
_prototypeManager.RegisterIgnore("nukeopsRole");
_prototypeManager.RegisterIgnore("stationGoal"); // Corvax-StationGoal
_prototypeManager.RegisterIgnore("loadout"); // Corvax-Loadout

_componentFactory.GenerateNetIds();
_adminManager.Initialize();
Expand Down
21 changes: 20 additions & 1 deletion Content.Packaging/ClientPackaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,27 @@ await RobustSharedPackaging.WriteContentAssemblies(
assemblies, // Corvax-Secrets
cancel: cancel);

await RobustClientPackaging.WriteClientResources(contentDir, pass, cancel);
await WriteClientResources(contentDir, pass, cancel); // Corvax-Secrets: Support content resource ignore to ignore server-only prototypes

inputPass.InjectFinished();
}

// Corvax-Secrets-Start
public static IReadOnlySet<string> ContentClientIgnoredResources { get; } = new HashSet<string>
{
"CorvaxSecretsServer"
};

private static async Task WriteClientResources(
string contentDir,
AssetPass pass,
CancellationToken cancel = default)
{
var ignoreSet = RobustClientPackaging.ClientIgnoredResources
.Union(RobustSharedPackaging.SharedIgnoredResources)
.Union(ContentClientIgnoredResources).ToHashSet();

await RobustSharedPackaging.DoResourceCopy(Path.Combine(contentDir, "Resources"), pass, ignoreSet, cancel: cancel);
}
// Corvax-Secrets-End
}

0 comments on commit 1048124

Please sign in to comment.