mirror of
https://github.com/minetest-mods/xban2.git
synced 2024-11-14 12:20:18 +01:00
Don't store the IP of the player if get_player_ip
fails.
This commit is contained in:
parent
dc874b5382
commit
678af46dd7
13
init.lua
13
init.lua
|
@ -170,10 +170,19 @@ end)
|
|||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
local e = xban.find_entry(name)
|
||||
local ip = minetest.get_player_ip(name)
|
||||
local e = xban.find_entry(name) or xban.find_entry(ip, true)
|
||||
if not e then
|
||||
if ip then
|
||||
e = xban.find_entry(ip, true)
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
e.names[name] = true
|
||||
e.names[ip] = true
|
||||
if ip then
|
||||
e.names[ip] = true
|
||||
end
|
||||
e.last_seen = os.time()
|
||||
end)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user