|
|
|
@ -26,6 +26,7 @@ public class GeoIPCity extends BaseReader { |
|
|
|
|
|
|
|
public String GetCity(String ip) { |
|
|
|
try { |
|
|
|
if (ip == null || ip.isEmpty() || ip.startsWith("10.") || ip.startsWith("127.") || ip.startsWith("192.168")) return "Unknown"; |
|
|
|
return databaseReader.city(InetAddress.getByName(ip)).getCity().getName(); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("[IGNORING] Cannot fetch city of ip", e); |
|
|
|
|