From 727446f6d52c3b986711adf581a5bf057701aae1 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 10 Nov 2012 15:13:09 +0000 Subject: 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 --- source/Root.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/Root.cpp b/source/Root.cpp index d8b929102..bef960afd 100644 --- a/source/Root.cpp +++ b/source/Root.cpp @@ -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 ); -- cgit v1.2.3