From c24e1aac32051bf2804f6a358d934522704cf7d4 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 8 Nov 2021 15:04:23 -0500 Subject: [PATCH] update protocol with load deck options --- PROTOCOL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PROTOCOL.md b/PROTOCOL.md index cca79d1..acf0f2e 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -103,6 +103,7 @@ Go struct representation: MatchID uuid.UUID `json:"match_id"` Command SessionCmd `json:"command"` GameCommand *game.Command `json:"game_command,omitempty"` + Data string `json:"data,omitempty"` } ID is the player ID in standard UUID format. It is generated by the client, however in the future it may be generated by some type of authentication system @@ -117,9 +118,12 @@ Command is a string representing a command from the following list: poll: Check if the server has any "broadcast" responses. Opts into polling. play: Attempt to run the attached GameCommand ready: Check if both players have joined the game with attached MatchID + load_deck: attempt to set the players deck to the information stored in the Data section GameCommand is a game command following the conventions described above. +Data is a section for miscelaneous arguments + ### Session Command results @@ -150,6 +154,8 @@ Result is a string representing the result of the SessionCommand. The following "played": The server recognized a game command was sent. This does NOT mean the command was succesful; the client should check the GameResult for that information "game ready": Both players have joined the game and game commands can be sent "generic error": An error has occured. + "deck loaded": deck loaded succesfully + "load deck error": error either loading the deck or parsing the deck The following Results are called "Broadcasts" and are sent by the server to ease the work done by the clients. None of them are required to be handled, but it will most likely be useful for clients to handle at least some of them.