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:
parent
bfd1ce5e53
commit
52fcb41dd3
@ -308,7 +308,7 @@ function HandleRemoveUserAll(a_Split, a_Player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Remove the user from the DB
|
-- 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;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -289,8 +289,16 @@ end
|
|||||||
|
|
||||||
--- Removes the user from all areas in the specified world
|
--- Removes the user from all areas in the specified world
|
||||||
function cStorage:RemoveUserAll(a_UserName, a_WorldName)
|
function cStorage:RemoveUserAll(a_UserName, a_WorldName)
|
||||||
-- TODO
|
assert(a_UserName);
|
||||||
LOGWARNING("cStorage:RemoveUserAll(): Not implemented yet!");
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user