From 99a409de09378aab005959fb9d3264bffa72ff88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Wed, 2 Sep 2026 09:47:27 +0200 Subject: [PATCH] [Server] Adapt tournament engine to the shared settings message - read games per match from Command_CreateGame.tournament_settings after the proto rework replaced the standalone games_per_match field - use qWarning to match the surrounding file --- .../libcockatrice/network/server/remote/game/server_game.cpp | 2 +- .../network/server/remote/server_protocolhandler.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp index f0b154fc1..0098be19d 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp @@ -977,7 +977,7 @@ void Server_Game::startTournament() // A tournament with fewer than two players can't produce a valid bracket. if (tournament->getPlayerCount() < 2) { - qCWarning() << "Cannot start tournament with fewer than 2 players"; + qWarning() << "Cannot start tournament with fewer than 2 players"; return; } diff --git a/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp index a3802441f..cdde723c6 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp @@ -918,7 +918,8 @@ Server_ProtocolHandler::cmdCreateGame(const Command_CreateGame &cmd, Server_Room bool shareDecklistsOnLoad = cmd.has_share_decklists_on_load() ? cmd.share_decklists_on_load() : false; bool isTournament = cmd.has_is_tournament() ? cmd.is_tournament() : false; - int gamesPerMatch = cmd.has_games_per_match() ? static_cast(cmd.games_per_match()) : 1; + int gamesPerMatch = + cmd.has_tournament_settings() ? static_cast(cmd.tournament_settings().games_per_match()) : 1; const int gameId = databaseInterface->getNextGameId(); if (gameId == -1) {