diff --git a/common/server_game.cpp b/common/server_game.cpp index 4add59011..8f2074276 100644 --- a/common/server_game.cpp +++ b/common/server_game.cpp @@ -323,7 +323,7 @@ void Server_Game::doStartGameIfReady() } for (Server_Player *player : players.values()) { if (!player->getSpectator()) - player->setupZones(); + player->setupZones(room->getGameTypes()); } gameStarted = true; diff --git a/common/server_player.cpp b/common/server_player.cpp index 218ab2fdd..b524fa0e3 100644 --- a/common/server_player.cpp +++ b/common/server_player.cpp @@ -1,5 +1,7 @@ #include "server_player.h" +#include "../servatrice/src/main.h" +#include "../servatrice/src/server_logger.h" #include "color.h" #include "decklist.h" #include "get_pb_extension.h" @@ -162,7 +164,7 @@ int Server_Player::newArrowId() const return id + 1; } -void Server_Player::setupZones() +void Server_Player::setupZones(const QStringList &gameTypes) { // This may need to be customized according to the game rules. // ------------------------------------------------------------------ @@ -178,7 +180,11 @@ void Server_Player::setupZones() addZone(new Server_CardZone(this, "grave", false, ServerInfo_Zone::PublicZone)); addZone(new Server_CardZone(this, "rfg", false, ServerInfo_Zone::PublicZone)); - addCounter(new Server_Counter(0, "life", makeColor(255, 255, 255), 25, 20)); + if (gameTypes.contains(QString("Commander"))) { + addCounter(new Server_Counter(0, "life", makeColor(255, 255, 255), 25, 40)); + } else { + addCounter(new Server_Counter(0, "life", makeColor(255, 255, 255), 25, 20)); + } addCounter(new Server_Counter(1, "w", makeColor(255, 255, 150), 20, 0)); addCounter(new Server_Counter(2, "u", makeColor(150, 150, 255), 20, 0)); addCounter(new Server_Counter(3, "b", makeColor(150, 150, 150), 20, 0)); @@ -904,7 +910,7 @@ Server_Player::cmdUnconcede(const Command_Unconcede & /*cmd*/, ResponseContainer ges.enqueueGameEvent(event, playerId); ges.setGameEventContext(Context_Unconcede()); - setupZones(); + setupZones(game->getRoom()->getGameTypes()); game->sendGameStateToPlayers(); diff --git a/common/server_player.h b/common/server_player.h index e6b91f5e5..c84ffa9f9 100644 --- a/common/server_player.h +++ b/common/server_player.h @@ -169,7 +169,7 @@ public: void addCounter(Server_Counter *counter); void clearZones(); - void setupZones(); + void setupZones(const QStringList& gameTypes); Response::ResponseCode drawCards(GameEventStorage &ges, int number); Response::ResponseCode moveCard(GameEventStorage &ges,