this should have the game_mode setting working correctly on the server

This commit is contained in:
darkrose 2015-12-18 16:38:37 +10:00
parent 8175d85b81
commit e3ebd8c055
1 changed files with 29 additions and 1 deletions

View File

@ -80,7 +80,7 @@ public:
}
}
bool parseConfigLine(const std::string &line)
virtual bool parseConfigLine(const std::string &line)
{
JMutexAutoLock lock(m_mutex);
@ -674,6 +674,34 @@ public:
// you'll find this in defaultsettings.cpp
void setGameDefaults(std::string mode);
virtual bool parseConfigLine(const std::string &line)
{
JMutexAutoLock lock(m_mutex);
std::string trimmedline = trim(line);
// Ignore comments
if (trimmedline[0] == '#')
return true;
Strfnd sf(trim(line));
std::string name = sf.next("=");
name = trim(name);
if (name == "")
return true;
std::string value = sf.next("\n");
value = trim(value);
m_settings[name] = value;
if (name == "game_mode")
setGameDefaults(value);
return true;
}
virtual void set(std::string name, std::string value)
{
{