summaryrefslogtreecommitdiffstats
path: root/source/Root.cpp
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2013-10-28 23:40:13 +0100
committerSamuel Barney <samjbarney@gmail.com>2013-10-28 23:40:13 +0100
commitd7a490a99205d69abce52c77854fafee52b4e82b (patch)
tree92e68ff622fc89bd94e11c7ed7fc548ed3129047 /source/Root.cpp
parentGot spiders and other mobs respecting night and day for spawning (diff)
parentProtoProxy: Implemented 1.7.2 status request / response / ping. (diff)
downloadcuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.gz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.bz2
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.lz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.xz
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.tar.zst
cuberite-d7a490a99205d69abce52c77854fafee52b4e82b.zip
Diffstat (limited to 'source/Root.cpp')
-rw-r--r--source/Root.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/Root.cpp b/source/Root.cpp
index 1f6437784..e992ff614 100644
--- a/source/Root.cpp
+++ b/source/Root.cpp
@@ -116,8 +116,8 @@ void cRoot::Start(void)
m_Server = new cServer();
LOG("Reading server config...");
- cIniFile IniFile("settings.ini");
- if (!IniFile.ReadFile())
+ cIniFile IniFile;
+ if (!IniFile.ReadFile("settings.ini"))
{
LOGWARNING("settings.ini inaccessible, all settings are reset to default values");
}
@@ -138,7 +138,6 @@ void cRoot::Start(void)
LOGERROR("Failure starting server, aborting...");
return;
}
- IniFile.WriteFile();
m_WebAdmin = new cWebAdmin();
m_WebAdmin->Init();
@@ -149,7 +148,7 @@ void cRoot::Start(void)
m_FurnaceRecipe = new cFurnaceRecipe();
LOGD("Loading worlds...");
- LoadWorlds();
+ LoadWorlds(IniFile);
LOGD("Loading plugin manager...");
m_PluginManager = new cPluginManager();
@@ -160,8 +159,10 @@ void cRoot::Start(void)
// This sets stuff in motion
LOGD("Starting Authenticator...");
- m_Authenticator.Start();
+ m_Authenticator.Start(IniFile);
+ IniFile.WriteFile("settings.ini");
+
LOGD("Starting worlds...");
StartWorlds();
@@ -245,10 +246,8 @@ void cRoot::LoadGlobalSettings()
-void cRoot::LoadWorlds(void)
+void cRoot::LoadWorlds(cIniFile & IniFile)
{
- cIniFile IniFile("settings.ini"); IniFile.ReadFile();
-
// First get the default world
AString DefaultWorldName = IniFile.GetValueSet("Worlds", "DefaultWorld", "world");
m_pDefaultWorld = new cWorld( DefaultWorldName.c_str() );