"ReliableMessages", networkevents aren't sent if FillNetworkEvent fails

This commit is contained in:
Regalis
2015-10-19 22:49:38 +03:00
parent c3d1b971dd
commit 5f07d4b0c9
22 changed files with 604 additions and 76 deletions

View File

@@ -636,7 +636,7 @@ namespace Barotrauma
}
public override void FillNetworkData(NetworkEventType type, NetOutgoingMessage message, object data)
public override bool FillNetworkData(NetworkEventType type, NetOutgoingMessage message, object data)
{
int sectionIndex = 0;
byte byteIndex = 0;
@@ -648,12 +648,14 @@ namespace Barotrauma
}
catch
{
return;
return false;
}
message.Write((float)NetTime.Now);
message.Write(byteIndex);
message.Write(sections[sectionIndex].damage);
return true;
}
public override void ReadNetworkData(NetworkEventType type, NetIncomingMessage message)