8-Ball Pool
Turn-based, 1v1, server-authoritative physics. The shot itself is simulated server-side — the client sends intent (power, aim, ball-in-hand placement), never a result.
Turn-based1v1Hosted: REST only
Verified directly against the source, not assumed: Pool is the one game of the six where hosted matchmaking has no direct socket event path — there is no
socket.on('hosted:submit_group')handler at all here, unlike every other game documented. You must use the REST endpoints under Hosted Matchmaking. Emitting a hosted:* event at this namespace will simply never be received.Session creation
{ "game": "pool", "matchType": "matchmaking", "players": [{ "id": "user_1" }] }Connect and reconnect
Pool has the longest documented reconnect window of the six games: 60 seconds.
socket.on('connect', () => {
socket.emit('game:reconnect', { roomId, playerId });
});
socket.on('game:reconnected', (fullState) => { /* rehydrate */ });Socket events
| Event | Direction | Payload |
|---|---|---|
game:started | server → client | { roomId, playerId, playerIndex: 0|1, players, ballPositions } |
pool:shot | client → server | { roomId, playerId, power: number, rotation: number, cueBallPos?: {x,y} } |
pool:shot:resolved | server → client | { trajectory, outcome, fromPlayerId } |
game:over | server → client | Result object, same shape as the game.ended webhook |
player:disconnected | server → client | { socketId } |
player:reconnected | server → client | Broadcast to the room when a player rejoins within the window |
game:resign | client → server | { roomId, playerId } |
Taking a shot
socket.emit('pool:shot', {
roomId,
playerId,
power: 0.72, // 0-1
rotation: 1.4, // radians
cueBallPos: { x: 200, y: 340 }, // only sent when placing ball-in-hand
});cueBallPos is applied server-side only when the game state actually has ball-in-hand active for that player — sending it otherwise is simply ignored, not an error.
Shot timer
A player has 90 seconds to take their shot before forfeiting the room to the opponent — starts the moment it becomes their turn, restarted after each shot.