Remove bad usage of Lazy<> from RobustMappedStringSerializer.

This commit is contained in:
Pieter-Jan Briers
2020-08-16 02:40:22 +02:00
parent 562901e8e7
commit e828a9d8c8
2 changed files with 9 additions and 3 deletions

View File

@@ -52,9 +52,9 @@ namespace Robust.Shared.Serialization
private INetManager? _net;
private readonly Lazy<ISawmill> _lazyLogSzr = new Lazy<ISawmill>(() => Logger.GetSawmill("szr"));
private ISawmill LogSzr => _lazyLogSzr.Value;
// I don't want to create 50 line changes in this commit so...
// ReSharper disable once InconsistentNaming
private ISawmill LogSzr = default!;
private readonly HashSet<INetChannel> _incompleteHandshakes = new HashSet<INetChannel>();
@@ -1306,6 +1306,10 @@ namespace Robust.Shared.Serialization
/// </summary>
public event Action? ClientHandshakeComplete;
public void InitLogging()
{
LogSzr = Logger.GetSawmill("szr");
}
}
}

View File

@@ -75,6 +75,8 @@ namespace Robust.Shared.Serialization
}
#endif
_mappedStringSerializer.InitLogging();
var settings = new Settings
{
CustomTypeSerializers = new ITypeSerializer[] {_mappedStringSerializer}