1 Tic Tac Toe Game Protocol
2 =========================
3 Note: All square numbers in the protol below are as follows:
11 For a specific game the following API endpoints are defined.
12 (Note: Only the trailing portion of the API URI is provided here.
13 The preceding portions of the path must be determined externally.)
17 This is a server-sent events stream that allows the server to push
18 game-related events to clients. When a client connects to this API
19 endpoint the server will return a header that includes:
21 Content-type: text/event-stream
22 Connection: keep-alive
23 Cache-Control: no-cache
25 and will keep the connection open to return events.
27 The following event types will be returned by the server:
31 WHEN: When a client first connects
33 WHAT: Static information about the game (will not change)
38 data: {"id":"WXYZ","url":"https://lmno.games/WXYZ"}
42 WHEN: When a client first connects
44 WHAT: Snapshot of the current dynamic game state
49 data: {"moves":[0,8],"board":["X","","","","","","","","O"],"next_player":"X"}
53 WHEN: When a client (maybe yourself) issues a legal move
64 Behavior: Adds a new move to the game
66 Example data: { "move": 1 }