mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 04:50:01 -08:00
[Game] Connect zone dump response before sending the request (#7711)
ZoneViewZone::initializeCards() connected PendingCommand::finished only after ZoneViewZoneLogic::requestZoneDump() had already sent the command. Local games process the dump synchronously, so finished was emitted before the view connected and the library/sideboard view stayed empty. Split requestZoneDump() into prepareZoneDump() and sendZoneDump(), and connect before sending, matching the TabRoom prepare/send convention. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
00151380e3
commit
ff393b8990
3 changed files with 25 additions and 12 deletions
|
|
@ -192,12 +192,14 @@ void ZoneViewZoneLogic::setWriteableRevealZone(bool _writeableRevealZone)
|
|||
writeableRevealZone = _writeableRevealZone;
|
||||
}
|
||||
|
||||
PendingCommand *ZoneViewZoneLogic::requestZoneDump()
|
||||
PendingCommand *ZoneViewZoneLogic::prepareZoneDump()
|
||||
{
|
||||
PlayerActions *actions = getPlayer()->getPlayerActions();
|
||||
PendingCommand *pend = actions->prepareZoneDump(this, numberCards);
|
||||
if (pend != nullptr) {
|
||||
actions->sendGameCommand(pend);
|
||||
}
|
||||
return pend;
|
||||
return getPlayer()->getPlayerActions()->prepareZoneDump(this, numberCards);
|
||||
}
|
||||
|
||||
void ZoneViewZoneLogic::sendZoneDump(PendingCommand *pendingCommand)
|
||||
{
|
||||
if (pendingCommand != nullptr) {
|
||||
getPlayer()->getPlayerActions()->sendGameCommand(pendingCommand);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue