update protocol with load deck options

This commit is contained in:
stryan 2021-11-08 15:04:23 -05:00
parent c588dab2ae
commit c24e1aac32

View File

@ -103,6 +103,7 @@ Go struct representation:
MatchID uuid.UUID `json:"match_id"` MatchID uuid.UUID `json:"match_id"`
Command SessionCmd `json:"command"` Command SessionCmd `json:"command"`
GameCommand *game.Command `json:"game_command,omitempty"` 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 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. poll: Check if the server has any "broadcast" responses. Opts into polling.
play: Attempt to run the attached GameCommand play: Attempt to run the attached GameCommand
ready: Check if both players have joined the game with attached MatchID 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. GameCommand is a game command following the conventions described above.
Data is a section for miscelaneous arguments
### Session Command results ### 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 "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 "game ready": Both players have joined the game and game commands can be sent
"generic error": An error has occured. "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. 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.