ServerEntityEventManager doesn't prevent creating a duplicate event if the previous one has already been sent to someone, handling exceptions in WriteEvent

This commit is contained in:
Regalis
2017-03-11 15:39:11 +02:00
parent 5bdb57b98a
commit 9e3d51edf4
2 changed files with 11 additions and 2 deletions

View File

@@ -30,7 +30,16 @@ namespace Barotrauma.Networking
{
//write into a temporary buffer so we can write the length before the actual data
NetBuffer tempBuffer = new NetBuffer();
WriteEvent(tempBuffer, e, recipient);
try
{
WriteEvent(tempBuffer, e, recipient);
}
catch (Exception exception)
{
DebugConsole.ThrowError("Failed to write an event for the entity \""+e.Entity+"\"", exception);
continue;
}
Debug.Assert(
tempBuffer.LengthBytes < 128,