From d25316422d7d9069626b9f09f630155f30534938 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 10 May 2020 15:43:44 -0700 Subject: [PATCH] Update the game-state event and increment protocol to version 0.5 Specifically, we change to lowercase names for the states, and we also include both the old and new states on each transition. This also means there is a new "none" state for the initial game-state event. --- api.text | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/api.text b/api.text index 250ed10..b1a8f79 100644 --- a/api.text +++ b/api.text @@ -1,6 +1,6 @@ Empires Game Protocol ===================== -Version: 0.4 +Version: 0.5 For a specific game the following API endpoints are defined. (Note: Only the trailing portion of the API URI is provided here. @@ -53,20 +53,25 @@ For a specific game the following API endpoints are defined. WHEN: When client first connects and whenever game state changes - VALUES: Game state will be one of the following: + VALUES: Event gives both the old and new state. Game state + Each will be one of the following: - JOIN: Players are choosing characters and joining the game - REVEAL: Character names are being revealed to players - CAPTURE: Players are guessing characters in capture attempts + none: Pseudo-state used as old_state when game is started + join: Players are choosing characters and joining the game + reveal: Character names are being revealed to players + capture: Players are guessing characters in capture attempts - EXAMPLE: + EXAMPLES: + + event: game-state + data: {"old_state":"none","new_state":"join"} event: game-state - data: {"state":"REVEAL"} + data: {"old_state":"join","new_state":"reveal"} TYPE: character-reveal - WHEN: Periodically during the REVEAL state of the game + WHEN: Periodically during the "reveal" state of the game EXAMPLE: -- 2.43.0