From f18d84cb1e3be387f708204d626ec27b66bfd2a6 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 4 Jun 2020 18:16:41 -0700 Subject: [PATCH] Add a new game-info event Which gives the game ID and the URL for connecting to the game. This allows the client to display this information so that the player can easily share it with friends, etc. --- tictactoe.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tictactoe.txt b/tictactoe.txt index 2211a05..361caf7 100644 --- a/tictactoe.txt +++ b/tictactoe.txt @@ -26,14 +26,27 @@ For a specific game the following API endpoints are defined. The following event types will be returned by the server: - TYPE: game-state + TYPE: game-info - WHEN: When a client first connections + WHEN: When a client first connects + + WHAT: Static information about the game (will not change) EXAMPLE: + event: game-info + data: {"id":"WXYZ","url":"https://lmno.games/WXYZ"} + + TYPE: game-state + + WHEN: When a client first connects + + WHAT: Snapshot of the current dynamic game state + + EXAMPLE: + event: game-state - data: {"moves":[0,8],"board":["X","","","","","","","","O"],"next_player":"X"} + data: {"moves":[0,8],"board":["X","","","","","","","","O"],"next_player":"X"} TYPE: move -- 2.43.0