From eb90648bdad1443c9cfc72e903a93642e10a0ab7 Mon Sep 17 00:00:00 2001 From: scratko Date: Fri, 16 Aug 2024 18:10:11 +0300 Subject: Global fixes v2.0 Added spectator mode. Added screen of game result. Added definition of durak. If not all players can replenish their decks, they take cards one at a time in turn. --- server/server.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'server/server.h') diff --git a/server/server.h b/server/server.h index 86e0fca..3578606 100644 --- a/server/server.h +++ b/server/server.h @@ -26,7 +26,8 @@ enum server_states { defense_phase_in, tossing_phase_out, tossing_phase_in, - table + table, + end_game }; enum client_game_states { @@ -39,7 +40,9 @@ enum client_game_states { defense, tossing, card_acceptance_status, - tossing_limit_status + tossing_limit_status, + spectator, + result }; enum tossing_mode { @@ -49,6 +52,13 @@ enum tossing_mode { none }; +enum spectator_mode { + spectator_attack, + spectator_defense, + spectator_tossing, + spectator_table +}; + struct session { int fd; enum client_game_states state; @@ -90,10 +100,16 @@ struct server { const char *trump_card; struct game_info *gi; struct session **turn_queue; + /* changes if the player has discarded all his cards + * (and shuffled_deck_size == 0) + */ + int turn_queue_size; struct card_count cc; int position_whose_turn; struct card_queue cq; struct cards_on_table cot; + int durak_position; + int tossing_limit; }; #endif -- cgit v1.2.3