diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-06-14 18:19:28 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-06-14 18:19:28 +0200 |
commit | 039c1a75f391b078f2b27a388e73bb203afed58e (patch) | |
tree | f4f213b794eb0c3a2713358c3d5bdd3f0b931486 /src/GroupManager.cpp | |
parent | Fixed bad merge (diff) | |
parent | Merge pull request #1093 from mc-server/BindingsFix (diff) | |
download | cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar.gz cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar.bz2 cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar.lz cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar.xz cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.tar.zst cuberite-039c1a75f391b078f2b27a388e73bb203afed58e.zip |
Diffstat (limited to 'src/GroupManager.cpp')
-rw-r--r-- | src/GroupManager.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 3586560bf..e570bb2b1 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")) @@ -115,7 +123,7 @@ void cGroupManager::LoadGroups() IniFile.SetValue("Owner", "Permissions", "*", true); IniFile.SetValue("Owner", "Color", "2", true); - IniFile.SetValue("Moderator", "Permissions", "core.time,core.item,core.teleport,core.ban,core.unban,core.save-all,core.toggledownfall"); + IniFile.SetValue("Moderator", "Permissions", "core.time,core.item,core.tpa,core.tpaccept,core.ban,core.unban,core.save-all,core.toggledownfall"); IniFile.SetValue("Moderator", "Color", "2", true); IniFile.SetValue("Moderator", "Inherits", "Player", true); @@ -180,6 +188,8 @@ void cGroupManager::LoadGroups() } } } + // Always return true, we can handle writefile fails later. + return true; } |