From 50e29aba776dd6ad6296e5989faaf4642b4b6705 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 18:32:42 +0100 Subject: A fix that is better than #950. --- src/GroupManager.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/GroupManager.cpp') diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 3586560bf..ba25d95ba 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -45,8 +45,14 @@ cGroupManager::cGroupManager() { LOGD("-- Loading Groups --"); - LoadGroups(); - CheckUsers(); + if (!LoadGroups()) + { + LOGWARNING("ERROR: Groups could not load!"); + } + if (!CheckUsers()) + { + LOGWARNING("ERROR: User file could not be found!"); + } LOGD("-- Groups Successfully Loaded --"); } @@ -70,13 +76,13 @@ void cGroupManager::GenerateDefaultUsersIni(cIniFile & a_IniFile) -void cGroupManager::CheckUsers(void) +bool cGroupManager::CheckUsers() { cIniFile IniFile; if (!IniFile.ReadFile("users.ini")) { GenerateDefaultUsersIni(IniFile); - return; + return true; } int NumKeys = IniFile.GetNumKeys(); @@ -97,13 +103,15 @@ void cGroupManager::CheckUsers(void) } } // for itr - Split[] } // for i - ini file keys + // Always return true for now, just but we can handle writefile fails later. + return true } -void cGroupManager::LoadGroups() +bool cGroupManager::LoadGroups() { cIniFile IniFile; if (!IniFile.ReadFile("groups.ini")) @@ -180,6 +188,8 @@ void cGroupManager::LoadGroups() } } } + // Always return true, we can handle writefile fails later. + return true } -- cgit v1.2.3 From a352ec38958f2884d6fe12fa7320947c65d1a65f Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 25 May 2014 19:46:16 +0100 Subject: SEMICOLONS! --- src/GroupManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/GroupManager.cpp') diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index ba25d95ba..523697b07 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -104,7 +104,7 @@ bool cGroupManager::CheckUsers() } // for itr - Split[] } // for i - ini file keys // Always return true for now, just but we can handle writefile fails later. - return true + return true; } @@ -189,7 +189,7 @@ bool cGroupManager::LoadGroups() } } // Always return true, we can handle writefile fails later. - return true + return true; } -- cgit v1.2.3 From f9fd5193602f4cbf0b201e13e9b410b264d09bf2 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Wed, 11 Jun 2014 17:26:10 +0100 Subject: Changed the teleport permissions to the new ones. --- src/GroupManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/GroupManager.cpp') diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 523697b07..e570bb2b1 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -123,7 +123,7 @@ bool cGroupManager::LoadGroups() IniFile.SetValue("Owner", "Permissions", "*", true); IniFile.SetValue("Owner", "Color", "2", true); - IniFile.SetValue("Moderator", "Permissions", "core.time,core.item,core.teleport,core.ban,core.unban,core.save-all,core.toggledownfall"); + IniFile.SetValue("Moderator", "Permissions", "core.time,core.item,core.tpa,core.tpaccept,core.ban,core.unban,core.save-all,core.toggledownfall"); IniFile.SetValue("Moderator", "Color", "2", true); IniFile.SetValue("Moderator", "Inherits", "Player", true); -- cgit v1.2.3