Cockatrice/common/pb
Basile Clement 286a7494d3
client: Support arbitrary game zones (#5877)
* Remove `isView` flag from CardZone

This flag is used for two purposes:

 1. It is used as a check for casting to a zone to a `ZoneViewZone`;

 2. Non-view zones are added to the player's zones on construction

This patch removes the `isView` flag and instead:

 1. We directly cast zones to `ZoneViewZone` using a dynamic (qobject)
    cast and use the result of the cast instead of the `isView` flag to
    detect if we are a view zone or not;

 2. The player records its own zones when they are created, simplifying
    control flow.

* Review

* client: Support arbitrary game zones

Currently, the client ignores cards in unknown zones, as there is an
implicit assumption that the set of zones known by the server and the
client are the same.

This patch makes it so that the client accept "custom zones" from the
server (zones outside the builtin deck, graveyard, exile, sideboard,
table, stack and hand zones) using the information from the
ServerInfo_CardZone. Moving cards from/into these zones happens
through a "View custom zone" action in the Game > Player menu and
properly appears in the chat.

Note that this patch intentionally does not introduce any support for
having the server actually create such zones. Instead, this patch aims
to improve backwards compatibility for when we do get to adding this
capability in the future, by making sure that current clients will be
able to interact with future new zones (even if suboptimally).
2025-05-06 21:18:08 -04:00
..
admin_commands.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
card_attributes.proto
CMakeLists.txt Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
color.proto
command_attach_card.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_change_zone_properties.proto Always look at top card (#4238) 2021-03-13 14:54:13 -05:00
command_concede.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_create_arrow.proto
command_create_counter.proto
command_create_token.proto Support creating face-down tokens (#5800) 2025-04-28 00:30:23 -04:00
command_deck_del_dir.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_deck_del.proto
command_deck_download.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_deck_list.proto
command_deck_new_dir.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_deck_select.proto
command_deck_upload.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_del_counter.proto
command_delete_arrow.proto
command_draw_cards.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_dump_zone.proto Support viewing the bottom X cards of library (#5410) 2025-01-05 21:17:18 -05:00
command_flip_card.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_game_say.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_inc_card_counter.proto
command_inc_counter.proto
command_kick_from_game.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_leave_game.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_move_card.proto Support viewing the bottom X cards of library (#5410) 2025-01-05 21:17:18 -05:00
command_mulligan.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_next_turn.proto
command_ready_start.proto Support starting games with fewer than max players (#5338) 2024-12-26 18:32:20 -05:00
command_replay_delete_match.proto
command_replay_download.proto
command_replay_list.proto
command_replay_modify_match.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_reveal_cards.proto Allow revealing specific cards from hand and library (#4743) 2023-02-07 17:12:04 -05:00
command_reverse_turn.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_roll_die.proto Allow up to 100 dice to be rolled at a time (#5047) 2024-06-12 08:37:04 -04:00
command_set_active_phase.proto
command_set_card_attr.proto
command_set_card_counter.proto
command_set_counter.proto
command_set_sideboard_lock.proto
command_set_sideboard_plan.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_shuffle.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
command_undo_draw.proto
commands.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
context_concede.proto Unconcede (#3515) 2019-01-27 12:50:41 -05:00
context_connection_state_changed.proto
context_deck_select.proto
context_move_card.proto
context_mulligan.proto
context_ping_changed.proto
context_ready_start.proto
context_set_sideboard_lock.proto
context_undo_draw.proto
event_add_to_list.proto
event_attach_card.proto
event_change_zone_properties.proto Always look at top card (#4238) 2021-03-13 14:54:13 -05:00
event_connection_closed.proto
event_create_arrow.proto
event_create_counter.proto
event_create_token.proto Support creating face-down tokens (#5800) 2025-04-28 00:30:23 -04:00
event_del_counter.proto
event_delete_arrow.proto
event_destroy_card.proto
event_draw_cards.proto
event_dump_zone.proto Support viewing the bottom X cards of library (#5410) 2025-01-05 21:17:18 -05:00
event_flip_card.proto
event_game_closed.proto
event_game_host_changed.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
event_game_joined.proto Judge mode (#3531) 2019-02-21 14:00:00 -05:00
event_game_say.proto
event_game_state_changed.proto
event_join_room.proto
event_join.proto
event_kicked.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
event_leave_room.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
event_leave.proto
event_list_games.proto
event_list_rooms.proto
event_move_card.proto Multiple Printings per Deck (#5171) 2024-11-18 21:56:44 -05:00
event_notify_user.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
event_player_properties_changed.proto
event_remove_from_list.proto
event_remove_messages.proto add option to delete a user's messages (#4362) 2021-09-14 16:05:20 -04:00
event_replay_added.proto
event_reveal_cards.proto Allow revealing specific cards from hand and library (#4743) 2023-02-07 17:12:04 -05:00
event_reverse_turn.proto Add a new command to reverse turn order (#3802) 2019-08-27 20:04:27 -04:00
event_roll_die.proto Allow up to 100 dice to be rolled at a time (#5047) 2024-06-12 08:37:04 -04:00
event_room_say.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
event_server_complete_list.proto
event_server_identification.proto allow login using hashed passwords (#4464) 2021-11-09 20:00:41 -05:00
event_server_message.proto
event_server_shutdown.proto
event_set_active_phase.proto
event_set_active_player.proto
event_set_card_attr.proto
event_set_card_counter.proto
event_set_counter.proto
event_shuffle.proto Move to bottom of library in random order. (#3549) 2019-02-07 14:08:44 -05:00
event_user_joined.proto
event_user_left.proto
event_user_message.proto
game_commands.proto deprecate the gender property from the protocol entirely (#4496) 2021-12-14 01:51:57 -05:00
game_event_container.proto Judge mode (#3531) 2019-02-21 14:00:00 -05:00
game_event_context.proto Unconcede (#3515) 2019-01-27 12:50:41 -05:00
game_event.proto deprecate the gender property from the protocol entirely (#4496) 2021-12-14 01:51:57 -05:00
game_replay.proto
isl_message.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
moderator_commands.proto Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
move_card_to_zone.proto
response_activate.proto
response_adjust_mod.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_ban_history.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_deck_download.proto
response_deck_list.proto
response_deck_upload.proto
response_dump_zone.proto
response_forgotpasswordrequest.proto
response_get_admin_notes.proto Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
response_get_games_of_user.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_get_user_info.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_join_room.proto
response_list_users.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_login.proto
response_password_salt.proto allow login using hashed passwords (#4464) 2021-11-09 20:00:41 -05:00
response_register.proto
response_replay_download.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_replay_list.proto
response_viewlog_history.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_warn_history.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response_warn_list.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
response.proto Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
room_commands.proto Add the ability to define starting life total during game creation. (#5174) 2024-12-19 23:52:47 +00:00
room_event.proto add option to delete a user's messages (#4362) 2021-09-14 16:05:20 -04:00
server_message.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_arrow.proto
serverinfo_ban.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_card.proto Multiple Printings per Deck (#5171) 2024-11-18 21:56:44 -05:00
serverinfo_cardcounter.proto
serverinfo_chat_message.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_counter.proto
serverinfo_deckstorage.proto
serverinfo_game.proto
serverinfo_gametype.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_player.proto
serverinfo_playerping.proto
serverinfo_playerproperties.proto Judge mode (#3531) 2019-02-21 14:00:00 -05:00
serverinfo_replay_match.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_replay.proto
serverinfo_room.proto
serverinfo_user.proto Add custom server-side pawn colors (#5543) 2025-02-02 03:25:25 +00:00
serverinfo_warning.proto apply clang format to proto files (#4123) 2020-10-02 12:14:05 -04:00
serverinfo_zone.proto client: Support arbitrary game zones (#5877) 2025-05-06 21:18:08 -04:00
session_commands.proto remove unused include in pb file (#4572) 2022-02-12 23:40:47 +01:00
session_event.proto