1
0

ProtectionAreas: Implemented the ProtRemUserAll command's DB access

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1567 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-06-08 19:49:26 +00:00
parent bfd1ce5e53
commit 52fcb41dd3
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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