Unstable v0.1300.0.0 (February 19th 2021)

This commit is contained in:
Joonas Rikkonen
2021-02-25 13:44:23 +02:00
parent b772654326
commit 24cbef485a
441 changed files with 21343 additions and 8562 deletions

View File

@@ -193,7 +193,7 @@ namespace Barotrauma.Networking
continue;
}
byte msgLength = msg.ReadByte();
int msgLength = (int)msg.ReadVariableUInt32();
IServerSerializable entity = Entity.FindEntityByID(entityID) as IServerSerializable;
entities.Add(entity);
@@ -226,7 +226,7 @@ namespace Barotrauma.Networking
}
else
{
long msgPosition = msg.BitPosition;
int msgPosition = msg.BitPosition;
if (GameSettings.VerboseLogging)
{
DebugConsole.NewMessage("received msg " + thisEventID + " (" + entity.ToString() + ")",
@@ -242,9 +242,9 @@ namespace Barotrauma.Networking
{
string errorMsg = "Message byte position incorrect after reading an event for the entity \"" + entity.ToString()
+ "\". Read " + (msg.BitPosition - msgPosition) + " bits, expected message length was " + (msgLength * 8) + " bits.";
#if DEBUG
DebugConsole.ThrowError(errorMsg);
#endif
GameAnalyticsManager.AddErrorEventOnce("ClientEntityEventManager.Read:BitPosMismatch", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
//TODO: force the BitPosition to correct place? Having some entity in a potentially incorrect state is not as bad as a desync kick
@@ -300,5 +300,15 @@ namespace Barotrauma.Networking
MidRoundSyncingDone = false;
}
/// <summary>
/// Clears events generated by the current client, used
/// when resynchronizing with the server after a timeout.
/// </summary>
public void ClearSelf()
{
ID = 0;
events.Clear();
}
}
}