[Server/Client] Fix open_decklists not showing for already-loaded decks on join

Took 6 minutes
This commit is contained in:
Lukas Brübach 2026-08-11 21:51:23 +02:00
parent 83920a4ae9
commit 235c59f815
2 changed files with 6 additions and 1 deletions

View file

@ -287,6 +287,9 @@ void GameEventHandler::eventGameStateChanged(const Event_GameStateChanged &event
if (!game->getGameMetaInfo()->proto().share_decklists_on_load()) {
continue;
}
if (!playerInfo.has_deck_list()) {
continue;
}
opponentDecksToDisplay.append(
qMakePair(playerId, qMakePair(playerName, QString::fromStdString(playerInfo.deck_list()))));

View file

@ -1631,7 +1631,9 @@ void Server_AbstractPlayer::getInfo(ServerInfo_Player *info,
{
getProperties(*info->mutable_properties(), withUserInfo);
if (deck) {
// Deck lists are only shared with other players when the game is in Open Decklists mode,
// so a player joining an open lobby can see every deck that was loaded before they joined.
if (deck && (recipient == this || game->getShareDecklistsOnLoad())) {
info->set_deck_list(deck->writeToString_Native().toStdString());
}