isle-portable/extensions
Christian Semmler 982957ee5e
Add WebSocket reconnection with exponential backoff
Automatically reconnect when the WebSocket connection is lost (e.g.
phone sleep, alt-tab, network blip) instead of exiting the game.

- Add reconnection state machine (CONNECTED → RECONNECTING → CONNECTED
  or DISCONNECTED) with exponential backoff (1s→30s cap, 10 max attempts)
- Add OnConnectionStatusChanged callback (connected/reconnecting/failed/
  rejected) to PlatformCallbacks, with Emscripten CustomEvent dispatch
  and native SDL_Log implementations
- Add WorldStateSync::ResetForReconnect() to clear session state
- Only exit the game on room-full rejection (WasRejected); connection
  loss is handled internally by the state machine
- Rename WasDisconnected→WasRejected, CheckDisconnected→CheckRejected,
  IsMultiplayerDisconnected→IsMultiplayerRejected through the full call
  chain for accurate naming
- Remove Module._exitCode from JS onclose; use C++ callback +
  sessionStorage for room-full signaling instead
- Clean up EXIT_CONNECTION_LOST constant (obsolete)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 13:34:45 -07:00
..
docs/multiplayer Fix camera flip bugs, refactor camera (#11) 2026-03-10 01:15:22 +01:00
include/extensions Add WebSocket reconnection with exponential backoff 2026-03-16 13:34:45 -07:00
src Add WebSocket reconnection with exponential backoff 2026-03-16 13:34:45 -07:00