From 31b880df4acd1ace11d1ab8cb1ca83647ac13ef1 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 1 Jun 2020 07:19:45 -0700 Subject: [PATCH] tictactoe: Document a game-state event This gives a snapshot of the current state as well as the history of all moves up until now. This event will be served to a client when joining a game in progress. --- tictactoe.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tictactoe.txt b/tictactoe.txt index 62046a6..b79f72c 100644 --- a/tictactoe.txt +++ b/tictactoe.txt @@ -26,6 +26,15 @@ For a specific game the following API endpoints are defined. The following event types will be returned by the server: + TYPE: game-state + + WHEN: When a client first connections + + EXAMPLE: + + event: game-state + data: {"moves":[0,8],"board":["X","","","","","","","","O"],"next_player":"X"} + TYPE: move WHEN: When a client (maybe yourself) issues a legal move -- 2.43.0