Exception: copy extends past end of input
See original GitHub issueReported by @quanglam68 in the Gitter channel:
hi, I still learning the unity client. testing the code given for exchanging information with 2 clients and the server works fine. ex: trace in one client : OnUpdateHandler: { "players" : { "SkkPLJeag" : { "x" : 520, "y" : 0 }, "HJrDLkxpx" : { "x" : 255, "y" : 0 } } }
but when i make the data bigger in the server, this.state.players[client.id] = { a:0, b: 0, d:0, x: 0, y: 0 };
I have an error in the client when it tries to apply the patch
Exception: copy extends past end of input
Fossil.Delta.Apply (System.Byte[] origin, System.Byte[] delta) (at Assets/Colyseus/FossilDelta/Delta.cs:187)
Colyseus.Room.ApplyPatch (System.Byte[] delta) (at Assets/Colyseus/Room.cs:129)
Colyseus.Client.ParseMessage (System.Byte[] recv) (at Assets/Colyseus/Client.cs:179)
Colyseus.Client.Recv () (at Assets/Colyseus/Client.cs:90)
ColyseusClient.FixedUpdate () (at Assets/Source/colyseus/ColyseusClient.cs:39)
My analysis is the pb appear at the call : this._previousState = Fossil.Delta.Apply (this._previousState, delta, out error);
seems that _previousState
array size is too small. How can we set its size to it is bigger to match with the data set in the server
I Lost a day to understand and to change various things but I cannot find a solution / or even an quickfix
Any help is appreciated . Tks
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (14 by maintainers)
Top GitHub Comments
Hi @niklaswolf, thanks for sending the sources. I hope to find some time during this week to check it out. Sorry.
It’s finally fixed! Thanks @niklaswolf for your pull-request! 🎉