Allow Judges to see all information, regardless of room settings (#5053)

This commit is contained in:
Zach H 2024-06-16 19:12:37 -04:00 committed by GitHub
parent e2ab8db958
commit b7fbc12ac0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 23 deletions

View file

@ -323,11 +323,15 @@ void Server_CardZone::getInfo(ServerInfo_Zone *info, Server_Player *playerWhosAs
info->set_name(name.toStdString());
info->set_type(type);
info->set_with_coords(has_coords);
info->set_card_count(cards.size());
info->set_card_count(static_cast<int>(cards.size()));
info->set_always_reveal_top_card(alwaysRevealTopCard);
info->set_always_look_at_top_card(alwaysLookAtTopCard);
if ((((playerWhosAsking == player) || omniscient) && (type != ServerInfo_Zone::HiddenZone)) ||
((playerWhosAsking != player) && (type == ServerInfo_Zone::PublicZone))) {
const auto selfPlayerAsking = playerWhosAsking == player || omniscient;
const auto zonesSelfCanSee = type != ServerInfo_Zone::HiddenZone;
const auto otherPlayerAsking = playerWhosAsking != player;
const auto zonesOthersCanSee = type == ServerInfo_Zone::PublicZone;
if ((selfPlayerAsking && zonesSelfCanSee) || (otherPlayerAsking && zonesOthersCanSee)) {
QListIterator<Server_Card *> cardIterator(cards);
while (cardIterator.hasNext())
cardIterator.next()->getInfo(info->add_card_list());