Made settings.ini default to settings.example.ini when it doesn't exist

I suggest to do the same with the other ini files?

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1030 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
faketruth 2012-11-10 15:13:09 +00:00
parent 8f637d401d
commit 727446f6d5
1 changed files with 6 additions and 1 deletions

View File

@ -98,7 +98,12 @@ void cRoot::Start()
LOG("Starting server...");
cIniFile IniFile("settings.ini");
IniFile.ReadFile();
if ( IniFile.ReadFile() == false )
{
IniFile.Path("settings.example.ini");
IniFile.ReadFile();
IniFile.Path("settings.ini");
}
m_PrimaryServerVersion = IniFile.GetValueSetI("Server", "PrimaryServerVersion", cProtocolRecognizer::PROTO_VERSION_1_4_2);
int Port = IniFile.GetValueSetI("Server", "Port", 25565 );