v0.6.0 multi-user game support with longpoll, tests and doc updated

This commit is contained in:
lixen committed 2025-11-05 12:08:18 -05:00
1 parent b8e3f631a2
commit 5d17008f72
13 files changed
+708 -120

No files matched your search

+17
View File
@@ -154,6 +154,23 @@ Note: When authenticated, human player IDs match the user's ID. Anonymous player
Returns current game state.
**Long-polling support:**
Add query parameters for real-time updates:
- `wait=true` - Enable long-polling (waits up to 25 seconds)
- `moveCount=N` - Last known move count
Returns immediately if game state changed, otherwise waits for updates:
```
GET /games/{gameId}?wait=true&moveCount=5
```
Response includes all game data. Compare `moves` array length to detect changes.
**Timeout behavior:**
- Returns current state after 25 seconds even if no changes
- Client disconnection cancels wait immediately
- Game deletion notifies all waiting clients
### Make Move
`POST /games/{gameId}/moves`