Cockatrice/common
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
..
lib Update PegLib, Fix Database Searching CFG (#5244) 2024-12-21 03:37:08 +00:00
pb client: Support arbitrary game zones (#5877) 2025-05-06 21:18:08 -04:00
sfmt update sfmt to version 1.5.1 from 1.4.1 (#4124) 2020-10-02 12:13:12 -04:00
CMakeLists.txt Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
color.h Tabs to spaces. 2014-07-08 22:53:02 -04:00
debug_pb_message.cpp Allow up to 100 dice to be rolled at a time (#5047) 2024-06-12 08:37:04 -04:00
debug_pb_message.h implement custom protobuf debug string creation (#4532) 2022-02-23 23:46:23 +01:00
decklist.cpp Refactor function structs into lambdas (#5675) 2025-04-20 04:07:22 +00:00
decklist.h Refactor function structs into lambdas (#5675) 2025-04-20 04:07:22 +00:00
expression.cpp Update PegLib, Fix Database Searching CFG (#5244) 2024-12-21 03:37:08 +00:00
expression.h Counter expressions (#3534) 2019-02-02 13:56:49 -05:00
featureset.cpp Address /W4 compiler warnings for Windows (#4910) 2023-10-15 20:31:13 -04:00
featureset.h Address /W4 compiler warnings for Windows (#4910) 2023-10-15 20:31:13 -04:00
get_pb_extension.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
get_pb_extension.h Clang-format (#3028) 2018-01-27 10:41:32 +01:00
passwordhasher.cpp miscellaneous refactors (#4521) 2022-01-16 17:58:53 -05:00
passwordhasher.h miscellaneous refactors (#4521) 2022-01-16 17:58:53 -05:00
rng_abstract.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
rng_abstract.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
rng_sfmt.cpp Address /W4 compiler warnings for Windows (#4910) 2023-10-15 20:31:13 -04:00
rng_sfmt.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
room_message_type.h Fix Mac Builds (#4844) 2023-08-06 22:45:45 -04:00
server_abstractuserinterface.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
server_abstractuserinterface.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
server_arrow.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
server_arrow.h assign new arrow id when arrow is moved to transformed card (#5012) 2024-03-27 14:47:00 +01:00
server_arrowtarget.cpp Tabs to spaces. 2014-07-08 22:53:02 -04:00
server_arrowtarget.h Clang-format (#3028) 2018-01-27 10:41:32 +01:00
server_card.cpp Keep card annotations on stack (#5399) 2024-12-31 14:08:25 -05:00
server_card.h Keep card annotations on stack (#5399) 2024-12-31 14:08:25 -05:00
server_cardzone.cpp Allow Judges to see all information, regardless of room settings (#5053) 2024-06-16 19:12:37 -04:00
server_cardzone.h remove cards being looked at from the count on drawing (#4671) 2022-10-17 16:35:54 -04:00
server_counter.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
server_counter.h clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
server_database_interface.cpp Overhaul common's CMakeLists.txt 2014-06-11 01:24:34 +02:00
server_database_interface.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
server_game.cpp Refactor files in common to new Qt Slot/Signal syntax (#5872) 2025-04-21 16:30:40 -04:00
server_game.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
server_player_reference.h Clang-format (#3028) 2018-01-27 10:41:32 +01:00
server_player.cpp Support creating face-down tokens (#5800) 2025-04-28 00:30:23 -04:00
server_player.h Support creating face-down tokens (#5800) 2025-04-28 00:30:23 -04:00
server_protocolhandler.cpp Refactor files in common to new Qt Slot/Signal syntax (#5872) 2025-04-21 16:30:40 -04:00
server_protocolhandler.h Support Qt6, Min Qt5.8, Fix Win32, Fix Servatrice 2022-05-06 17:31:08 -04:00
server_remoteuserinterface.cpp clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
server_remoteuserinterface.h apply chat flood prevention in games next to rooms (#4387) 2021-06-28 01:57:46 -04:00
server_response_containers.cpp Allow Judges to see all information, regardless of room settings (#5053) 2024-06-16 19:12:37 -04:00
server_response_containers.h Allow Judges to see all information, regardless of room settings (#5053) 2024-06-16 19:12:37 -04:00
server_room.cpp Refactor files in common to new Qt Slot/Signal syntax (#5872) 2025-04-21 16:30:40 -04:00
server_room.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
server.cpp Refactor files in common to new Qt Slot/Signal syntax (#5872) 2025-04-21 16:30:40 -04:00
server.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
serverinfo_user_container.cpp Support Qt6, Min Qt5.8, Fix Win32, Fix Servatrice 2022-05-06 17:31:08 -04:00
serverinfo_user_container.h add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
trice_limits.h Deck limit (#5559) 2025-02-04 22:22:15 +00:00
user_level.h Fix Mac Builds (#4844) 2023-08-06 22:45:45 -04:00