Connect 4
Turn-based, 1v1. Same architecture as Checkers — this page covers what's genuinely different: the move shape and board dimensions.
Turn-based1v1Hosted: socket + REST
Session creation
{ "game": "connect4", "matchType": "matchmaking", "players": [{ "id": "user_1" }] }Socket events
| Event | Direction | Payload |
|---|---|---|
game:started | server → client | { roomId, players, board, currentTurn, rows, cols, afkTimeoutEnabled, afkTimeoutSeconds, afkWarnSeconds, playerId, color: 'red'|'yellow' } |
game:move | client → server | { roomId, column: 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 |
connect4:afk_warning_cleared | server → client | Fires when a player about to be AFK-forfeited moves in time |
Board
Standard 7-column, 6-row board — confirm exact dimensions from the rows/cols fields on game:started rather than hardcoding 7×6, since they're sent dynamically rather than fixed constants.
socket.emit('game:move', { roomId, playerId, column: 3 }); // drops into column 3AFK timeout
90 second timeout, 30 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.