summaryrefslogtreecommitdiffstats
path: root/src/GroupManager.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-27 22:09:30 +0200
committermadmaxoft <github@xoft.cz>2014-05-27 22:09:30 +0200
commitdff71823d40690b676a617025c5fb70b7eeaf209 (patch)
treeeda6ddf26d9e24b634a5940b3d2a0fbb72148ffb /src/GroupManager.cpp
parentAdded AlchemistVillage prefabs (Thanks, KingsCraftAu). (diff)
parentStuff. (diff)
downloadcuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.gz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.bz2
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.lz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.xz
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.tar.zst
cuberite-dff71823d40690b676a617025c5fb70b7eeaf209.zip
Diffstat (limited to 'src/GroupManager.cpp')
-rw-r--r--src/GroupManager.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp
index 3586560bf..523697b07 100644
--- a/src/GroupManager.cpp
+++ b/src/GroupManager.cpp
@@ -45,8 +45,14 @@ cGroupManager::cGroupManager()
{
LOGD("-- Loading Groups --");
- LoadGroups();
- CheckUsers();
+ if (!LoadGroups())
+ {
+ LOGWARNING("ERROR: Groups could not load!");
+ }
+ if (!CheckUsers())
+ {
+ LOGWARNING("ERROR: User file could not be found!");
+ }
LOGD("-- Groups Successfully Loaded --");
}
@@ -70,13 +76,13 @@ void cGroupManager::GenerateDefaultUsersIni(cIniFile & a_IniFile)
-void cGroupManager::CheckUsers(void)
+bool cGroupManager::CheckUsers()
{
cIniFile IniFile;
if (!IniFile.ReadFile("users.ini"))
{
GenerateDefaultUsersIni(IniFile);
- return;
+ return true;
}
int NumKeys = IniFile.GetNumKeys();
@@ -97,13 +103,15 @@ void cGroupManager::CheckUsers(void)
}
} // for itr - Split[]
} // for i - ini file keys
+ // Always return true for now, just but we can handle writefile fails later.
+ return true;
}
-void cGroupManager::LoadGroups()
+bool cGroupManager::LoadGroups()
{
cIniFile IniFile;
if (!IniFile.ReadFile("groups.ini"))
@@ -180,6 +188,8 @@ void cGroupManager::LoadGroups()
}
}
}
+ // Always return true, we can handle writefile fails later.
+ return true;
}