From 21febaf4b342aecd5d797b1e2017591fde208388 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 21 Feb 2014 14:53:46 +0100 Subject: Add 'Group not found', when the Server load the users.ini and add auto generate from users.ini --- src/Entities/Player.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Entities') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 70ddb3c98..7a3aaf568 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1529,7 +1529,11 @@ void cPlayer::LoadPermissionsFromDisk() AStringVector Split = StringSplit( Groups, "," ); for( unsigned int i = 0; i < Split.size(); i++ ) { - AddToGroup( Split[i].c_str() ); + if (!cRoot::Get()->GetGroupManager()->ExistsGroup(Split[i])) + { + LOGWARNING("The group %s for player %s was not found!", Split[i].c_str(), m_PlayerName.c_str()); + } + AddToGroup(Split[i].c_str()); } } else -- cgit v1.2.3 From 3777873f22b8a19ed282be076357d5b3c2eb43ee Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 21 Feb 2014 15:10:31 +0100 Subject: Remove users.ini generation in Player.cpp and use the CheckUsers() Function --- src/Entities/Player.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 7a3aaf568..19173592e 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1545,12 +1545,7 @@ void cPlayer::LoadPermissionsFromDisk() } else { - LOGWARN("Regenerating users.ini, player %s will be added to the \"Default\" group", m_PlayerName.c_str()); - IniFile.AddHeaderComment(" This is the file in which the group the player belongs to is stored"); - IniFile.AddHeaderComment(" The format is: [PlayerName] | Groups=GroupName"); - - IniFile.SetValue(m_PlayerName, "Groups", "Default"); - IniFile.WriteFile("users.ini"); + cRoot::Get()->GetGroupManager()->CheckUsers(); AddToGroup("Default"); } ResolvePermissions(); -- cgit v1.2.3