Sending NetEntityEvents from client to server, ItemComponent class doesn't implement the INetSerializable interfaces (only the derived classes do), reactor syncing

This commit is contained in:
Regalis
2016-11-13 19:34:23 +02:00
parent 724172fe7c
commit 3d234aef73
16 changed files with 146 additions and 59 deletions

View File

@@ -61,6 +61,7 @@ namespace Barotrauma.Networking
client.entityEventLastSent[entityEvent.ID] = (float)NetTime.Now;
}
msg.Write((byte)ServerNetObject.ENTITY_STATE);
Write(msg, eventsToSync, client);
}
@@ -80,6 +81,11 @@ namespace Barotrauma.Networking
clientEntity.ServerRead(buffer, sender);
}
public void Read(NetIncomingMessage msg, Client client)
{
base.Read(msg, 0.0f, ref client.lastSentEntityEventID);
}
public void Clear()
{
events.Clear();