Log number of cards revealed to other players. (#3555)

This commit is contained in:
Rob Blanckaert 2019-02-04 23:33:11 -08:00 committed by Zach H
parent 2bf444e4b7
commit a719e3b306
3 changed files with 4 additions and 1 deletions

View file

@ -1854,7 +1854,8 @@ void Player::eventRevealCards(const Event_RevealCards &event)
static_cast<GameScene *>(scene())->addRevealedZoneView(this, zone, cardList, event.grant_write_access()); static_cast<GameScene *>(scene())->addRevealedZoneView(this, zone, cardList, event.grant_write_access());
} }
emit logRevealCards(this, zone, event.card_id(), cardName, otherPlayer, false, cardList.size()); emit logRevealCards(this, zone, event.card_id(), cardName, otherPlayer, false,
event.has_number_of_cards() ? event.number_of_cards() : cardList.size());
} }
} }

View file

@ -11,4 +11,5 @@ message Event_RevealCards {
optional sint32 other_player_id = 3 [default = -1]; optional sint32 other_player_id = 3 [default = -1];
repeated ServerInfo_Card cards = 4; repeated ServerInfo_Card cards = 4;
optional bool grant_write_access = 5; optional bool grant_write_access = 5;
optional uint32 number_of_cards = 6;
} }

View file

@ -1660,6 +1660,7 @@ Server_Player::cmdRevealCards(const Command_RevealCards &cmd, ResponseContainer
Event_RevealCards eventOthers; Event_RevealCards eventOthers;
eventOthers.set_grant_write_access(cmd.grant_write_access()); eventOthers.set_grant_write_access(cmd.grant_write_access());
eventOthers.set_zone_name(zone->getName().toStdString()); eventOthers.set_zone_name(zone->getName().toStdString());
eventOthers.set_number_of_cards(cardsToReveal.size());
if (cmd.has_card_id()) if (cmd.has_card_id())
eventOthers.set_card_id(cmd.card_id()); eventOthers.set_card_id(cmd.card_id());
if (cmd.has_player_id()) if (cmd.has_player_id())