jespertheend / splix

MIT License
21 stars 6 forks source link

Attempted to add a trail vertex in between two previous vertices #43

Open jespertheend opened 1 year ago

jespertheend commented 1 year ago

The server crashes frequently with the following stack trace:

error: Uncaught Error: Assertion failed: Attempted to add a trail vertex in between two previous vertices.
    at Player.#addTrailVertex (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:354:13)
    at Player.#drainMovementQueue (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:313:25)
    at Player.loop (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:556:29)
    at Game.loop (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Game.js:59:11)
    at ApplicationLoop.loop (file:///home/runner/work/splix/splix/gameServer/src/ApplicationLoop.js:15:26)
    at Object.action (ext:deno_web/02_timers.js:146:11)
    at handleTimerMacrotask (ext:deno_web/02_timers.js:63:10)

It also frequently logs a similar stack trace, though in this case the server doesn't crash because errors inside the message handler are always caught.

An error occurred while handling a websocket message ArrayBuffer {} Error: Assertion failed: Attempted to add a trail vertex in between two previous vertices.
    at Player.#addTrailVertex (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:354:13)
    at Player.#drainMovementQueue (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:313:25)
    at Player.clientPosUpdateRequested (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:269:27)
    at WebSocketConnection.onMessage (file:///home/runner/work/splix/splix/gameServer/src/WebSocketConnection.js:245:17)
    at WebSocket.<anonymous> (file:///home/runner/work/splix/splix/gameServer/src/WebSocketManager.js:23:24)
    at innerInvokeEventListeners (ext:deno_web/02_event.js:783:7)
    at invokeEventListeners (ext:deno_web/02_event.js:823:5)
    at dispatch (ext:deno_web/02_event.js:692:9)
    at WebSocket.dispatchEvent (ext:deno_web/02_event.js:1082:12)
    at WebSocket.[[[eventLoop]]] (ext:deno_websocket/01_websocket.js:433:16)
jespertheend commented 1 year ago

This may have been fixed in #41

jespertheend commented 11 months ago

Seems like this is still an issue, though less frequently. The stack trace is different though.

Oct 21 18:17:07 splix-fra splixGameServer[506574]: error: Uncaught Error: Assertion failed: Attempted to add a trail vertex in between two previous vertices.
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at Player.#addTrailVertex (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:390:13)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at Player.#updateCurrentTile (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:932:25)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at Player.loop (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Player.js:588:28)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at Game.loop (file:///home/runner/work/splix/splix/gameServer/src/gameplay/Game.js:59:11)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at ApplicationLoop.loop (file:///home/runner/work/splix/splix/gameServer/src/ApplicationLoop.js:15:26)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at Object.action (ext:deno_web/02_timers.js:151:11)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at handleTimerMacrotask (ext:deno_web/02_timers.js:65:10)
Oct 21 18:17:07 splix-fra splixGameServer[506574]:     at eventLoopTick (ext:core/01_core.js:189:21)