From 748f60bb7e13cc3422d8d628268d6ee55f1fae83 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 10 May 2020 14:18:57 -0700 Subject: [PATCH] Add "/reveal","/start" endpoints and "game-state","character-reveal" events Incrementing the protocol version to 0.4. This is perhaps the minimum that is actually needed to play a game? We'll see if this is sufficient as we get both client and server coded to this and try it out. --- api.text | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/api.text b/api.text index 41e365c..250ed10 100644 --- a/api.text +++ b/api.text @@ -1,6 +1,6 @@ Empires Game Protocol ===================== -Version: 0.3 +Version: 0.4 For a specific game the following API endpoints are defined. (Note: Only the trailing portion of the API URI is provided here. @@ -49,6 +49,30 @@ For a specific game the following API endpoints are defined. event: player-leave data: {"id":3} + TYPE: game-state + + WHEN: When client first connects and whenever game state changes + + VALUES: Game state 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 + + EXAMPLE: + + event: game-state + data: {"state":"REVEAL"} + + TYPE: character-reveal + + WHEN: Periodically during the REVEAL state of the game + + EXAMPLE: + + event: character-reveal + data: {"character":"Albert Einstein"} + TYPE: capture WHEN: When one player captures another @@ -72,6 +96,22 @@ For a specific game the following API endpoints are defined. Behavior: Removes an existing player with the given ID +/reveal + + Method: POST + + When: Only valid when in game state of JOIN + + Behavior: Change state to REVEAL; reveal character names to all clienta + +/start + + Method: POST + + When: Only valid when in game state of REVEAL + + Behavior: Change game state to CAPTURE + /reset Method: POST -- 2.43.0