Reorder prejoin event to cache exclusions

Reorder prejoin event to cache white listed players and owner
master
shivajiva101 2019-12-01 16:28:49 +00:00 committed by GitHub
parent e526eb6431
commit 4477ed90ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -2093,23 +2093,26 @@ end)
-- Register callback for prejoin event
minetest.register_on_prejoinplayer(function(name, ip)
-- whitelist bypass
if WL[name] or WL[ip] then
minetest.log("action", "[sban] " .. name .. " whitelist login")
return
end
-- known player?
local id = get_id(name) or get_id(ip)
if not id then return end -- unknown player
if not dev and owner_id and owner_id == id then return end -- owner bypass
t_id[name] = {
id = id,
ip = ip,
ts = os.time()
}
-- whitelist bypass
if WL[name] or WL[ip] then
minetest.log("action", "[sban] " .. name .. " whitelist login")
return
end
if not dev and owner_id and owner_id == id then return end -- owner bypass
local data = bans[id]
if not data then