diff --git a/commands.lua b/commands.lua index ea09c93..09fc976 100644 --- a/commands.lua +++ b/commands.lua @@ -47,17 +47,16 @@ if not governing.modgeoip then func = function(name, param) if not param then return true, "usage: /geoip " end - minetest.log("warning", "[governing/geoip] Player " .. name .. " queries : " .. param) - if not minetest.get_player_ip then return true, "minetest.get_player_ip no available! engine its too older or client does not provide such info." end + if not minetest.get_player_ip then return true, "[geoip]: engine its too older, canot get ip of player." end local ip = minetest.get_player_ip(param) - if not ip then return true, "no ip available! seems ".. name .." does not provide such info!" end + if not ip then return true, "[geoip] no ip available! seems "..param.." does not provide such info!" end governing.lookup(ip, function(result) local txt = format_result(result) - if not txt then return true, "Geoip error: "..name..":"..ip": " .. (result.description or "unknown error") end - minetest.log("action", "[geoip] result for player " .. param .. ": " .. txt) - minetest.chat_send_player(name, txt) + if not txt then return true, "[geoip]: "..param..":"..ip" error: "..(result.description or "unknown error") end + minetest.log("action", "[geoip] "..param..": "..txt) + minetest.chat_send_player(name, param..": "..txt) end) end