cg:game.save
- Save game¶
-
cg:game.save
¶
This packet is used to save a game for the purpose of continuing it later.
Internal Name | cg:game.save |
Direction | Clientbound |
Since Version | v0.1.0 |
Valid States | game_* |
Purpose¶
This packet is used, when all players decided to adjourn the game. The server will send the clients in the game this packet containing the game data, that should be saved locally for being able to load it when continuing the game.
Structure¶
Note that all examples shown here contain placeholder data and will have different content in actual packets.
This is the data sent by the server:
{
"game_id": "e8d1e1e2-75c8-4225-ab1a-16dabcc260d1",
"data": {
"id": "e8d1e1e2-75c8-4225-ab1a-16dabcc260d1"
"type": "dk",
"creation_time": 1591004154.1594243,
"players": [
"acb8fa68-5c22-42cc-a4fa-1ba600dcdb9e", "c4db1dfe-9d6c-41c2-9a88-ea7c641738a6",
"d940a7e4-c19a-4904-abcf-71aab689da11", "ac5085ad-148d-4838-b800-dba3c6a5c91c"
],
"gamerules": {
"dk.etc": ["and", "so", "on"]
},
"round_num": 3,
"buckrounds": [],
"scores": [[-3, 3, 3, -3], [2, 2, 2, -6], [5, -5, 5, -5]],
"current_points": [4, 0, 10, -14],
"game_summaries": [
["re_win", "re"],
["kontra_win", "no90"],
["kontra_win", "kontra", "no90", "against_cqs"]
]
}
}
game_id
is the game’s UUID.
data
is a dictionary containing the data of the saved game. It should contain following keys:
id
: see game_id
type
The game type. It can be dk
(Doppelkopf), sk
(Skat), cn
(Canasta) and rm
(Rummy).
creation_time
is the system time at which the game was created.
players
is a list of the UUIDs of the players.
gamerules
is a dictionary containing the game’s gamerules.
round_num
is the amount of rounds, that have already been played.
buckrounds
is a list of the buckrounds, that still have to be played. Its exact structure depends on the buckround
gamerules.
scores
is a list containing lists for each round. In these lists, the scores for the round are saved.
curront_points
is a list containing the current scores for the players.
game_summaries
is a list containing the game summaries for all rounds.