Tic-tac-toe
Turn-based, 1v1. Same architecture as Checkers — this page covers only what's genuinely different: the move shape and the AFK timing.
Turn-based1v1Hosted: socket + REST
Session creation
{ "game": "tictactoe", "matchType": "matchmaking", "players": [{ "id": "user_1" }] }Socket events
| Event | Direction | Payload |
|---|---|---|
game:started | server → client | { roomId, players, board, currentTurn, afkTimeoutEnabled, afkTimeoutSeconds, afkWarnSeconds, playerId, mark: 'X'|'O' } |
game:move | client → server | { roomId, position: number, playerId } |
game:move:made | server → client | Broadcast after a valid move — full updated board + currentTurn |
game:over | server → client | Result object, same shape as the game.ended webhook |
tictactoe:afk_warning_cleared | server → client | Fires when a player about to be AFK-forfeited moves in time |
Board
position is a flat index 0–8 into the 3×3 board, row-major.
socket.emit('game:move', { roomId, playerId, position: 4 }); // center squareAFK timeout
60 second timeout, 20 second warning — the default; not currently overridable via afkConfig for this game.
Hosted matchmaking
Supports hosted matchmaking via both direct socket events and the REST endpoints — same shape as Checkers.