EntityEventManagers wait for 1.5*roundtriptime before resending messages (less unnecessary resends), skipping to the next event in a packet if an exception is thrown while reading an event
This commit is contained in:
@@ -73,9 +73,22 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
else
|
||||
{
|
||||
long msgPosition = msg.Position;
|
||||
|
||||
DebugConsole.NewMessage("received msg "+thisEventID, Microsoft.Xna.Framework.Color.Green);
|
||||
lastReceivedID++;
|
||||
ReadEvent(msg, entity, sendingTime, sender);
|
||||
try
|
||||
{
|
||||
ReadEvent(msg, entity, sendingTime, sender);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
#if DEBUG
|
||||
DebugConsole.ThrowError("Failed to read event for entity \""+entity.ToString()+"\"!", e);
|
||||
#endif
|
||||
msg.Position = msgPosition + msgLength * 8;
|
||||
}
|
||||
}
|
||||
msg.ReadPadBits();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user