summaryrefslogtreecommitdiffstats
path: root/src/GroupManager.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-09 01:14:42 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-09 01:14:42 +0100
commit9d1c9097e3a62f11cce94d1807c16a310eba6c2c (patch)
treef186174dd8567c9f0d43969a19782d8fdb2fb2ed /src/GroupManager.cpp
parentMerge branch 'master' into playerimprovements (diff)
parentMerge pull request #656 from mc-server/ReloadGroups (diff)
downloadcuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar.gz
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar.bz2
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar.lz
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar.xz
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.tar.zst
cuberite-9d1c9097e3a62f11cce94d1807c16a310eba6c2c.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 --");
}