Parameter ServerTitle done the ususal way
This commit is contained in:
parent
d0df67fa7f
commit
6f51e91266
|
@ -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) {
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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 != "") {
|
||||
|
|
Loading…
Reference in New Issue