Closed NakOh closed 4 years ago
colyseus-unity3d/Assets/Plugins/Colyseus/Serializer/FossilDeltaSerializer.cs
public void SetState (byte[] encodedState, int offset) { State.Set (MsgPack.Deserialize<IndexedDictionary<string, object>> (new MemoryStream ( ArrayUtils.SubArray (encodedState, offset, encodedState.Length - 1) ))); // previousState = encodedState; -> Fixed it! previousState = ArrayUtils.SubArray (encodedState, offset, encodedState.Length - 1); }
Debugging took about 10 hours ...
I had to use FossilDeltaSerializer.
Thanks @NakOh, I've applied a similar fix here: https://github.com/colyseus/colyseus-unity3d/blob/master/Assets/Plugins/Colyseus/Serializer/FossilDeltaSerializer.cs
colyseus-unity3d/Assets/Plugins/Colyseus/Serializer/FossilDeltaSerializer.cs
public void SetState (byte[] encodedState, int offset) { State.Set (MsgPack.Deserialize<IndexedDictionary<string, object>> (new MemoryStream ( ArrayUtils.SubArray (encodedState, offset, encodedState.Length - 1) ))); // previousState = encodedState; -> Fixed it! previousState = ArrayUtils.SubArray (encodedState, offset, encodedState.Length - 1); }
Debugging took about 10 hours ...
I had to use FossilDeltaSerializer.