Added a level equality check to client error handling to make it easier to diagnose bugs like #848 in the future.

This commit is contained in:
Joonas Rikkonen
2018-10-18 00:18:57 +03:00
parent 9f7fbb0cbe
commit ef9afedf42
3 changed files with 26 additions and 6 deletions
@@ -1647,11 +1647,12 @@ namespace Barotrauma.Networking
return false;
}
public void ReportError(ClientNetError error,UInt16 expectedID=0,UInt16 eventID=0,UInt16 entityID=0)
public void ReportError(ClientNetError error, UInt16 expectedID = 0, UInt16 eventID = 0, UInt16 entityID = 0)
{
NetOutgoingMessage outMsg = client.CreateMessage();
outMsg.Write((byte)ClientPacketHeader.ERROR);
outMsg.Write((byte)error);
outMsg.Write(Level.Loaded == null ? 0 : Level.Loaded.EqualityCheckVal);
switch (error)
{
case ClientNetError.MISSING_EVENT: