summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/ProtectionAreas
diff options
context:
space:
mode:
Diffstat (limited to 'MCServer/Plugins/ProtectionAreas')
-rw-r--r--MCServer/Plugins/ProtectionAreas/CommandHandlers.lua2
-rw-r--r--MCServer/Plugins/ProtectionAreas/Storage.lua12
2 files changed, 11 insertions, 3 deletions
diff --git a/MCServer/Plugins/ProtectionAreas/CommandHandlers.lua b/MCServer/Plugins/ProtectionAreas/CommandHandlers.lua
index b28c5149a..4ed629ed8 100644
--- a/MCServer/Plugins/ProtectionAreas/CommandHandlers.lua
+++ b/MCServer/Plugins/ProtectionAreas/CommandHandlers.lua
@@ -308,7 +308,7 @@ function HandleRemoveUserAll(a_Split, a_Player)
end
-- Remove the user from the DB
- g_Storage.RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName());
+ g_Storage:RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName());
return true;
end
diff --git a/MCServer/Plugins/ProtectionAreas/Storage.lua b/MCServer/Plugins/ProtectionAreas/Storage.lua
index defa9b394..c444016f2 100644
--- a/MCServer/Plugins/ProtectionAreas/Storage.lua
+++ b/MCServer/Plugins/ProtectionAreas/Storage.lua
@@ -289,8 +289,16 @@ end
--- Removes the user from all areas in the specified world
function cStorage:RemoveUserAll(a_UserName, a_WorldName)
- -- TODO
- LOGWARNING("cStorage:RemoveUserAll(): Not implemented yet!");
+ assert(a_UserName);
+ assert(a_WorldName);
+ assert(self);
+
+ local sql = "DELETE FROM AllowedUsers WHERE UserName = '" .. a_UserName .."'";
+ if (not(self:DBExec(sql))) then
+ LOGWARNING("SQL error while removing user " .. a_UserName .. " from all areas");
+ return false;
+ end
+ return true;
end