Skip to content

Reconnecting

Lost your connection? You don't lose your place, if you come back in time.

Leaving on purpose? See Disconnecting. Logging out gives you no waiting time.

Waiting time

  • Starts when your connection drops.
  • How long: set by the server. The other players in your match see it as timeout in game.opponent_disconnected.
  • Counts for everyone, guest or account, in a match or waiting in a lobby.
  • While you wait, the server keeps your name, your lobby place and your matches.
  • Too late? You lose your matches, your lobby place is gone, and your name is free again.

In a tournament

In a tournament your turn time limit is your waiting time.

  • Your matches go on without you. The other players keep moving.
  • Is it your turn, also at the start of your next match? Your turn timer runs, the same as when you are connected.
  • Come back before it runs out, and you can still make your move.
  • Timer runs out? You lose that match, with reason "timeout".

How to come back

  1. Connect again.
  2. Say hello.
  3. Send session.reconnect with the session token you got when you logged in.
C: REQ <id1> session.hello {"version": 1}
S: RES <id1> OK
C: REQ <id2> session.reconnect {"session_token": "<session_token>"}
S: RES <id2> OK
S: EVT <m> game.action {"type": "move", "player": "<other>", "move": <move>}
S: EVT <m> game.your_turn
  • <id1>, <m> and the other placeholders: put in the real value.
  • Use the session token, not your account token. On WebSocket, connect to /ws without the account token.
  • The server sends you every event you missed. You don't have to ask.
  • Missed events for one match come in the right order.
  • Events from different matches can be mixed up.
  • Too late or wrong session token: ERR SESSION_EXPIRED.
  • Still connected somewhere else? The server disconnects that old connection.
  • Reconnect on a fresh connection. Already logged in on this one: ERR AUTH_FAILED.

What the other players see

Event When
game.opponent_disconnected {"player": "<other>", "timeout": <seconds>} A player lost connection. timeout is how long the server waits for them.
game.opponent_reconnected {"player": "<other>"} That player came back in time
game.result with "reason": "disconnect" That player did not come back in time
  • In a tournament, timeout is what is left of that player's turn time limit, or null when it is not their turn.

Server restarts

  • If you were in a match, it is saved.
  • Come back the same way, with session.reconnect.