MCPcopy Create free account
hub / github.com/cuberite/cuberite / CheckUsers

Method CheckUsers

src/GroupManager.cpp:73–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73void cGroupManager::CheckUsers(void)
74{
75 cIniFile IniFile;
76 if (!IniFile.ReadFile("users.ini"))
77 {
78 GenerateDefaultUsersIni(IniFile);
79 return;
80 }
81
82 unsigned int NumKeys = IniFile.GetNumKeys();
83 for (size_t i = 0; i < NumKeys; i++)
84 {
85 AString Player = IniFile.GetKeyName( i );
86 AString Groups = IniFile.GetValue(Player, "Groups", "");
87 if (!Groups.empty())
88 {
89 AStringVector Split = StringSplit( Groups, "," );
90 for( unsigned int i = 0; i < Split.size(); i++ )
91 {
92 if (!ExistsGroup(Split[i]))
93 {
94 LOGWARNING("The group %s for player %s was not found!", Split[i].c_str(), Player.c_str());
95 }
96 }
97 }
98 }
99}
100
101
102

Callers 1

ReloadGroupsMethod · 0.80

Calls 8

StringSplitFunction · 0.85
ReadFileMethod · 0.80
GetNumKeysMethod · 0.80
GetKeyNameMethod · 0.80
GetValueMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected