[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
This commit is contained in:
Lukas Brübach 2026-09-02 09:47:27 +02:00
parent fd25d102bf
commit 4580ab5a3b
2 changed files with 3 additions and 2 deletions

View file

@ -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;
}

View file

@ -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<int>(cmd.games_per_match()) : 1;
int gamesPerMatch =
cmd.has_tournament_settings() ? static_cast<int>(cmd.tournament_settings().games_per_match()) : 1;
const int gameId = databaseInterface->getNextGameId();
if (gameId == -1) {