EntitySpawner sends spawn/removal messages to clients using EntityEvents.
EntityEvents and EntitySpawner used to work independently of each other, with separate IDs, and there was no guarantee that spawning and events would happen in the correct order. For example, a client could fail to read events during midround syncing because the entity has been removed, or read an event for an incorrect entity because the entity has been removed and the ID taken by some other entity.
This commit is contained in:
@@ -38,9 +38,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public UInt16 lastSentEntityEventID = 0;
|
||||
public UInt16 lastRecvEntityEventID = 0;
|
||||
|
||||
public UInt16 lastRecvEntitySpawnID = 0;
|
||||
|
||||
|
||||
public List<ChatMessage> chatMsgQueue = new List<ChatMessage>();
|
||||
public UInt16 lastChatMsgQueueID;
|
||||
public float ChatSpamSpeed;
|
||||
@@ -76,8 +74,7 @@ namespace Barotrauma.Networking
|
||||
lastRecvChatMsgID = ChatMessage.LastID;
|
||||
|
||||
lastRecvGeneralUpdate = 0;
|
||||
|
||||
lastRecvEntitySpawnID = 0;
|
||||
|
||||
lastRecvEntityEventID = 0;
|
||||
|
||||
UnreceivedEntityEventCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user