mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
ensure judges are omniscient when not spectating (#6831)
This commit is contained in:
parent
5101cc3d74
commit
45ab2602c6
2 changed files with 5 additions and 5 deletions
|
|
@ -1562,7 +1562,7 @@ Server_AbstractPlayer::cmdRevealCards(const Command_RevealCards &cmd, ResponseCo
|
||||||
zone->addWritePermission(cmd.player_id());
|
zone->addWritePermission(cmd.player_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isJudge()) {
|
if (judge) {
|
||||||
ges.setOverwriteOwnership(true);
|
ges.setOverwriteOwnership(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ void Server_Game::sendGameStateToPlayers()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Event_GameStateChanged event;
|
Event_GameStateChanged event;
|
||||||
createGameStateChangedEvent(&event, participant, false, false);
|
createGameStateChangedEvent(&event, participant, participant->isJudge(), false);
|
||||||
|
|
||||||
gec = prepareGameEvent(event, -1);
|
gec = prepareGameEvent(event, -1);
|
||||||
}
|
}
|
||||||
|
|
@ -750,7 +750,7 @@ void Server_Game::createGameJoinedEvent(Server_AbstractParticipant *joiningParti
|
||||||
event2.set_active_player_id(activePlayer);
|
event2.set_active_player_id(activePlayer);
|
||||||
event2.set_active_phase(activePhase);
|
event2.set_active_phase(activePhase);
|
||||||
|
|
||||||
bool omniscient = joiningParticipant->isSpectator() && (spectatorsSeeEverything || joiningParticipant->isJudge());
|
bool omniscient = (joiningParticipant->isSpectator() && spectatorsSeeEverything) || joiningParticipant->isJudge();
|
||||||
for (auto *participant : participants.values()) {
|
for (auto *participant : participants.values()) {
|
||||||
participant->getInfo(event2.add_player_list(), joiningParticipant, omniscient, true);
|
participant->getInfo(event2.add_player_list(), joiningParticipant, omniscient, true);
|
||||||
}
|
}
|
||||||
|
|
@ -766,8 +766,8 @@ void Server_Game::sendGameEventContainer(GameEventContainer *cont,
|
||||||
|
|
||||||
cont->set_game_id(gameId);
|
cont->set_game_id(gameId);
|
||||||
for (auto *participant : participants.values()) {
|
for (auto *participant : participants.values()) {
|
||||||
const bool playerPrivate = (participant->getPlayerId() == privatePlayerId) ||
|
const bool playerPrivate = (participant->getPlayerId() == privatePlayerId) || participant->isJudge() ||
|
||||||
(participant->isSpectator() && (spectatorsSeeEverything || participant->isJudge()));
|
(participant->isSpectator() && spectatorsSeeEverything);
|
||||||
if ((recipients.testFlag(GameEventStorageItem::SendToPrivate) && playerPrivate) ||
|
if ((recipients.testFlag(GameEventStorageItem::SendToPrivate) && playerPrivate) ||
|
||||||
(recipients.testFlag(GameEventStorageItem::SendToOthers) && !playerPrivate))
|
(recipients.testFlag(GameEventStorageItem::SendToOthers) && !playerPrivate))
|
||||||
participant->sendGameEvent(*cont);
|
participant->sendGameEvent(*cont);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue