diff options
author | Mattes D <github@xoft.cz> | 2014-05-08 20:16:35 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-09 18:32:03 +0200 |
commit | fb58ef55beddc73500029ae6c0fe08400de550d2 (patch) | |
tree | 8e36e0eba345faa98c499ac63f7bdeae5c02d9da /src/GroupManager.cpp | |
parent | Initialise m_HasTeleported in both constructors (diff) | |
download | cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.gz cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.bz2 cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.lz cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.xz cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.zst cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/GroupManager.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 33b601e82..3586560bf 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -79,23 +79,24 @@ void cGroupManager::CheckUsers(void) return; } - unsigned int NumKeys = IniFile.GetNumKeys(); - for (size_t i = 0; i < NumKeys; i++) + int NumKeys = IniFile.GetNumKeys(); + for (int i = 0; i < NumKeys; i++) { - AString Player = IniFile.GetKeyName( i ); + AString Player = IniFile.GetKeyName(i); AString Groups = IniFile.GetValue(Player, "Groups", ""); - if (!Groups.empty()) + if (Groups.empty()) + { + continue; + } + AStringVector Split = StringSplitAndTrim(Groups, ","); + for (AStringVector::const_iterator itr = Split.begin(), end = Split.end(); itr != end; ++itr) { - AStringVector Split = StringSplit( Groups, "," ); - for( unsigned int i = 0; i < Split.size(); i++ ) + if (!ExistsGroup(*itr)) { - if (!ExistsGroup(Split[i])) - { - LOGWARNING("The group %s for player %s was not found!", Split[i].c_str(), Player.c_str()); - } + LOGWARNING("The group %s for player %s was not found!", Split[i].c_str(), Player.c_str()); } - } - } + } // for itr - Split[] + } // for i - ini file keys } @@ -128,15 +129,15 @@ void cGroupManager::LoadGroups() IniFile.WriteFile("groups.ini"); } - unsigned int NumKeys = IniFile.GetNumKeys(); - for (size_t i = 0; i < NumKeys; i++) + int NumKeys = IniFile.GetNumKeys(); + for (int i = 0; i < NumKeys; i++) { - AString KeyName = IniFile.GetKeyName( i ); - cGroup* Group = GetGroup( KeyName.c_str() ); + 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() ); + LOGD("Loading group %s", KeyName.c_str()); Group->SetName(KeyName); AString Color = IniFile.GetValue(KeyName, "Color", "-"); |