Don't store the IP of the player if `get_player_ip` fails.

This commit is contained in:
Diego Martinez 2014-12-26 23:26:54 -03:00
parent dc874b5382
commit 678af46dd7
1 changed files with 11 additions and 2 deletions

View File

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