diff options
author | worktycho <work.tycho@gmail.com> | 2014-05-25 19:40:32 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-05-25 19:40:32 +0200 |
commit | d481f9ece34d239536ebe849e1b21d2de426bbc5 (patch) | |
tree | a9d710ba47ae9e9caf44ba4e93671d37c9c53d55 | |
parent | Update README.md (diff) | |
parent | A fix that is better than #950. (diff) | |
download | cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar.gz cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar.bz2 cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar.lz cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar.xz cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.tar.zst cuberite-d481f9ece34d239536ebe849e1b21d2de426bbc5.zip |
-rw-r--r-- | src/GroupManager.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 3586560bf..ba25d95ba 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 } |