Fixed servers failing to write network events for wires with too many nodes, causing clients syncing to fail and everyone getting kicked out due to desync. Now the wire events are split into multiple events, and there's a hard cap (255) on the number of nodes per wire. Closes #563
+ Writing too much data into an event no longer breaks event syncing completely, if it happens the server just logs an error and writes an empty event.
This commit is contained in:
@@ -55,6 +55,13 @@ namespace Barotrauma.Networking
|
||||
GameAnalyticsManager.AddErrorEventOnce("NetEntityEventManager.Write:TooLong" + e.Entity.ToString(),
|
||||
GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
|
||||
"Too much data in network event for entity \"" + e.Entity.ToString() + "\" (" + tempEventBuffer.LengthBytes + " bytes");
|
||||
|
||||
//write an empty event breaking the event syncing
|
||||
tempBuffer.Write((UInt16)0);
|
||||
tempBuffer.WritePadBits();
|
||||
eventCount++;
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
//the ID has been taken by another entity (the original entity has been removed) -> write an empty event
|
||||
|
||||
Reference in New Issue
Block a user