diff options
| author | Diego Martinez <kaeza@users.sf.net> | 2014-12-26 23:26:54 -0300 | 
|---|---|---|
| committer | Diego Martinez <kaeza@users.sf.net> | 2014-12-26 23:27:48 -0300 | 
| commit | 678af46dd7b6a3bec0cbeade863a589687abfffc (patch) | |
| tree | 879045aff58fb4d5f76c7fc0e4c2cc1272208989 | |
| parent | dc874b538200eca3f65d5100ceeef3179c97b82c (diff) | |
Don't store the IP of the player if `get_player_ip` fails.
| -rw-r--r-- | init.lua | 13 | 
1 files changed, 11 insertions, 2 deletions
| @@ -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) | 
