mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 18:02:14 -07:00
Have various game events respect the new UUID attribute on instantiation.
This commit is contained in:
parent
90c4b223dd
commit
c9690d790c
12 changed files with 58 additions and 26 deletions
|
|
@ -209,7 +209,8 @@ void Server_Player::setupZones()
|
|||
continue;
|
||||
}
|
||||
for (int k = 0; k < currentCard->getNumber(); ++k) {
|
||||
z->insertCard(new Server_Card(currentCard->getName(), nextCardId++, 0, 0, z), -1, 0);
|
||||
z->insertCard(
|
||||
new Server_Card(currentCard->getName(), currentCard->getCardUuid(), nextCardId++, 0, 0, z), -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -338,6 +339,7 @@ Response::ResponseCode Server_Player::drawCards(GameEventStorage &ges, int numbe
|
|||
ServerInfo_Card *cardInfo = eventPrivate.add_cards();
|
||||
cardInfo->set_id(card->getId());
|
||||
cardInfo->set_name(card->getName().toStdString());
|
||||
cardInfo->set_uuid(card->getUUID().toStdString());
|
||||
}
|
||||
|
||||
ges.enqueueGameEvent(eventPrivate, playerId, GameEventStorageItem::SendToPrivate, playerId);
|
||||
|
|
@ -1406,7 +1408,7 @@ Server_Player::cmdCreateToken(const Command_CreateToken &cmd, ResponseContainer
|
|||
yCoord = 0;
|
||||
}
|
||||
|
||||
auto *card = new Server_Card(cardName, newCardId(), xCoord, yCoord);
|
||||
auto *card = new Server_Card(cardName, QString(), newCardId(), xCoord, yCoord);
|
||||
card->moveToThread(thread());
|
||||
card->setPT(nameFromStdString(cmd.pt()));
|
||||
card->setColor(nameFromStdString(cmd.color()));
|
||||
|
|
@ -1941,6 +1943,7 @@ Server_Player::cmdDumpZone(const Command_DumpZone &cmd, ResponseContainer &rc, G
|
|||
Server_Card *card = cards[i];
|
||||
QString displayedName = card->getFaceDown() ? QString() : card->getName();
|
||||
ServerInfo_Card *cardInfo = zoneInfo->add_card_list();
|
||||
cardInfo->set_uuid(card->getUUID().toStdString());
|
||||
cardInfo->set_name(displayedName.toStdString());
|
||||
if (zone->getType() == ServerInfo_Zone::HiddenZone) {
|
||||
cardInfo->set_id(i);
|
||||
|
|
@ -2058,6 +2061,7 @@ Server_Player::cmdRevealCards(const Command_RevealCards &cmd, ResponseContainer
|
|||
ServerInfo_Card *cardInfo = eventPrivate.add_cards();
|
||||
|
||||
cardInfo->set_id(card->getId());
|
||||
cardInfo->set_uuid(card->getUUID().toStdString());
|
||||
cardInfo->set_name(card->getName().toStdString());
|
||||
cardInfo->set_x(card->getX());
|
||||
cardInfo->set_y(card->getY());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue