Parameter ServerTitle done the ususal way

This commit is contained in:
titiger 2016-01-07 00:51:23 +01:00
parent d0df67fa7f
commit 6f51e91266
4 changed files with 5 additions and 8 deletions

View File

@ -113,7 +113,6 @@ Config::Config() {
fileNameParameter.first = "";
fileNameParameter.second = "";
custom_path_parameter = "";
serverTitle = "";
}
bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path) {

View File

@ -52,7 +52,6 @@ private:
std::pair<string,string> fileName;
std::pair<bool,bool> fileLoaded;
string custom_path_parameter;
string serverTitle;
static map<ConfigType,Config> 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; }

View File

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

View File

@ -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 != "") {