From 6f51e91266965228d0c32f68ca8fee0936380008 Mon Sep 17 00:00:00 2001 From: titiger Date: Thu, 7 Jan 2016 00:51:23 +0100 Subject: [PATCH] Parameter ServerTitle done the ususal way --- source/glest_game/global/config.cpp | 1 - source/glest_game/global/config.h | 4 ---- source/glest_game/main/main.cpp | 2 +- source/glest_game/menu/menu_state_custom_game.cpp | 6 ++++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index 71b74140..ea36da14 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -113,7 +113,6 @@ Config::Config() { fileNameParameter.first = ""; fileNameParameter.second = ""; custom_path_parameter = ""; - serverTitle = ""; } bool Config::tryCustomPath(std::pair &type, std::pair &file, string custom_path) { diff --git a/source/glest_game/global/config.h b/source/glest_game/global/config.h index db4a89de..21dea25e 100644 --- a/source/glest_game/global/config.h +++ b/source/glest_game/global/config.h @@ -52,7 +52,6 @@ private: std::pair fileName; std::pair fileLoaded; string custom_path_parameter; - string serverTitle; static map configList; @@ -119,9 +118,6 @@ public: string toString(); - string getServerTitle() {return serverTitle;} - void setServerTitle(string name) {serverTitle=name;} - static string getCustomRuntimeProperty(string key) { return customRuntimeProperties[key]; } static void setCustomRuntimeProperty(string key, string value) { customRuntimeProperties[key] = value; } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 4cc548bb..ff066a84 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -4233,7 +4233,7 @@ int glestMain(int argc, char** argv) { string serverTitle = paramPartTokens[1]; printf("Forcing serverTitle[%s]\n",serverTitle.c_str()); - config.setServerTitle(serverTitle); + config.setString("ServerTitle",serverTitle,true); } else { printf("\nInvalid missing server title specified on commandline [%s] value [%s]\n\n",argv[foundParamIndIndex],(paramPartTokens.size() >= 2 ? paramPartTokens[1].c_str() : NULL)); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index eb2e6935..36bafed0 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -732,8 +732,10 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, string MenuStateCustomGame::createGameName(string controllingPlayer){ Config &config = Config::getInstance(); - if(config.getServerTitle()!="" && controllingPlayer == ""){ - return config.getServerTitle(); + string serverTitle=config.getString("ServerTitle",""); + + if(serverTitle!="" && controllingPlayer == ""){ + return serverTitle; } else if (this->headlessServerMode == true) { if (controllingPlayer != "") {