Add system for loading extra serializer strings.

"fixture-0" comes up a LOT so we load this manually now.
This commit is contained in:
Pieter-Jan Briers
2021-05-31 10:44:47 +02:00
parent a3ba969589
commit 2a022f39bd
3 changed files with 17 additions and 0 deletions

View File

@@ -371,6 +371,19 @@ namespace Robust.Server
var reg = factory.GetRegistration(regType);
_stringSerializer.AddString(reg.Name);
}
using var extraMappedStrings = typeof(BaseServer).Assembly
.GetManifestResourceStream("Robust.Server.ExtraMappedSerializerStrings.txt");
if (extraMappedStrings != null)
{
using var sr = new StreamReader(extraMappedStrings);
string? line;
while ((line = sr.ReadLine()) != null)
{
_stringSerializer.AddString(line);
}
}
}
private bool SetupLoki()

View File

@@ -0,0 +1 @@
fixture-0

View File

@@ -29,6 +29,9 @@
<Content Include="server_config.toml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="ExtraMappedSerializerStrings.txt">
<LogicalName>Robust.Server.ExtraMappedSerializerStrings.txt</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\MSBuild\Robust.Engine.targets" />
</Project>