diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-02-05 18:10:08 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-02-05 18:10:08 +0100 |
commit | 7c750914f0ddd0fec414e8690b10145ed61e7fa9 (patch) | |
tree | d8d3ad52e2561af40793357bc638d68b54666c9a /src/GroupManager.cpp | |
parent | Named the different quartz block. (diff) | |
download | cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar.gz cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar.bz2 cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar.lz cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar.xz cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.tar.zst cuberite-7c750914f0ddd0fec414e8690b10145ed61e7fa9.zip |
Diffstat (limited to 'src/GroupManager.cpp')
-rw-r--r-- | src/GroupManager.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index d5567d91e..99befa0ff 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -44,6 +44,18 @@ cGroupManager::cGroupManager() : m_pState( new sGroupManagerState ) { LOGD("-- Loading Groups --"); + + LoadGroups(); + + LOGD("-- Groups Successfully Loaded --"); +} + + + + + +void cGroupManager::LoadGroups() +{ cIniFile IniFile; if (!IniFile.ReadFile("groups.ini")) { @@ -71,8 +83,10 @@ cGroupManager::cGroupManager() unsigned int NumKeys = IniFile.GetNumKeys(); for (size_t i = 0; i < NumKeys; i++) { - std::string KeyName = IniFile.GetKeyName( i ); + AString KeyName = IniFile.GetKeyName( i ); cGroup* Group = GetGroup( KeyName.c_str() ); + + Group->ClearPermission(); // Needed in case the groups are reloaded. LOGD("Loading group: %s", KeyName.c_str() ); @@ -107,7 +121,7 @@ cGroupManager::cGroupManager() } } - std::string Groups = IniFile.GetValue(KeyName, "Inherits", ""); + AString Groups = IniFile.GetValue(KeyName, "Inherits", ""); if (!Groups.empty()) { AStringVector Split = StringSplitAndTrim(Groups, ","); @@ -117,13 +131,8 @@ cGroupManager::cGroupManager() } } } - LOGD("-- Groups Successfully Loaded --"); } - - - - cGroup* cGroupManager::GetGroup( const AString & a_Name ) { GroupMap::iterator itr = m_pState->Groups.find( a_Name ); |