summaryrefslogtreecommitdiffstats
path: root/src/GroupManager.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-02-05 19:58:02 +0100
committerMattes D <github@xoft.cz>2014-02-05 19:58:02 +0100
commit694fa5d54188012a4fa727bbbe82ff92ca289d79 (patch)
treefcd2ccb8b83f34ff032fa35171e494e7bfd65b85 /src/GroupManager.cpp
parentMerge pull request #647 from worktycho/runMCServer (diff)
parentForgot extra lines. (diff)
downloadcuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar.gz
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar.bz2
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar.lz
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar.xz
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.tar.zst
cuberite-694fa5d54188012a4fa727bbbe82ff92ca289d79.zip
Diffstat (limited to 'src/GroupManager.cpp')
-rw-r--r--src/GroupManager.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp
index d5567d91e..723b86f94 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,7 +131,6 @@ cGroupManager::cGroupManager()
}
}
}
- LOGD("-- Groups Successfully Loaded --");
}