Changes for prototype load parallelization (#13066)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Pieter-Jan Briers
2022-12-20 23:25:34 +01:00
committed by GitHub
parent 584921b423
commit a323671984
50 changed files with 169 additions and 249 deletions

View File

@@ -18,7 +18,8 @@ namespace Content.Server.Atmos.Commands
foreach (var gasPrototype in atmosSystem.Gases)
{
shell.WriteLine($"{gasPrototype.Name} ID: {gasPrototype.ID}");
var gasName = Loc.GetString(gasPrototype.Name);
shell.WriteLine($"{gasName} ID: {gasPrototype.ID}");
}
}
}

View File

@@ -254,7 +254,10 @@ namespace Content.Server.Atmos.EntitySystems
continue;
if (mixture != null)
gases.Add(new GasEntry(gas.Name, mixture.Moles[i], gas.Color));
{
var gasName = Loc.GetString(gas.Name);
gases.Add(new GasEntry(gasName, mixture.Moles[i], gas.Color));
}
}
return gases.ToArray();

View File

@@ -1,4 +1,5 @@
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown;
using Robust.Shared.Serialization.Markdown.Mapping;
using Robust.Shared.Serialization.Markdown.Validation;
@@ -16,10 +17,10 @@ public sealed class TileAtmosCollectionSerializer : ITypeSerializer<Dictionary<V
public Dictionary<Vector2i, TileAtmosphere> Read(ISerializationManager serializationManager, MappingDataNode node,
IDependencyCollection dependencies,
bool skipHook, ISerializationContext? context = null,
SerializationHookContext hookCtx, ISerializationContext? context = null,
ISerializationManager.InstantiationDelegate<Dictionary<Vector2i, TileAtmosphere>>? instanceProvider = null)
{
var data = serializationManager.Read<TileAtmosData>(node, context, skipHook);
var data = serializationManager.Read<TileAtmosData>(node, hookCtx, context);
var tiles = new Dictionary<Vector2i, TileAtmosphere>();
if (data.TilesUniqueMixes != null)
{
@@ -82,7 +83,7 @@ public sealed class TileAtmosCollectionSerializer : ITypeSerializer<Dictionary<V
[DataField("tiles")] public Dictionary<Vector2i, int>? TilesUniqueMixes;
}
public void CopyTo(ISerializationManager serializationManager, Dictionary<Vector2i, TileAtmosphere> source, ref Dictionary<Vector2i, TileAtmosphere> target, bool skipHook,
public void CopyTo(ISerializationManager serializationManager, Dictionary<Vector2i, TileAtmosphere> source, ref Dictionary<Vector2i, TileAtmosphere> target, SerializationHookContext hookCtx,
ISerializationContext? context = null)
{
target.Clear();