mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Add warning when not consuming all bytes of a logic component
This commit is contained in:
1 parent
5a8927e4c9
commit
4e5edcee49
2 files changed
+13
-2
No files matched your search
@@ -78,7 +78,19 @@ internal abstract class InnerGameManager : InnerNetObject, IInnerGameManager
|
||||
continue;
|
||||
}
|
||||
|
||||
this._logicComponents[tag].Deserialize(innerReader, initialState);
|
||||
var component = this._logicComponents[tag];
|
||||
|
||||
component.Deserialize(innerReader, initialState);
|
||||
|
||||
if (innerReader.Position < innerReader.Length)
|
||||
{
|
||||
_logger.LogWarning(
|
||||
"Server did not consume all bytes from {0} component {1} ({2} < {3}).",
|
||||
nameof(InnerGameManager),
|
||||
component.GetType().FullName,
|
||||
reader.Position,
|
||||
reader.Length);
|
||||
}
|
||||
}
|
||||
|
||||
return ValueTask.CompletedTask;
|
||||
|
||||
@@ -17,6 +17,5 @@ internal abstract class GameLogicComponent
|
||||
|
||||
public virtual void Deserialize(IMessageReader reader, bool initialState)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user