diff --git a/src/main/java/xyz/mcutils/backend/service/MaxMindService.java b/src/main/java/xyz/mcutils/backend/service/MaxMindService.java index da06cee..7d6554e 100644 --- a/src/main/java/xyz/mcutils/backend/service/MaxMindService.java +++ b/src/main/java/xyz/mcutils/backend/service/MaxMindService.java @@ -55,20 +55,20 @@ public class MaxMindService { } /** - * Lookup the GeoIP information for the query. + * Lookup the GeoIP information for the ip. * - * @param query The query to lookup + * @param ip The query to lookup * @return The GeoIP information */ - public static CityResponse lookup(String query) { + public static CityResponse lookup(String ip) { if (database == null) { // The database isn't loaded, return null return null; } try { - return database.city(InetAddress.getByName(query)); + return database.city(InetAddress.getByName(ip)); } catch (IOException | GeoIp2Exception e) { - log.error("Failed to lookup the GeoIP information for '{}'", query, e); - throw new RuntimeException("Failed to lookup the GeoIP information for '%s'".formatted(query)); + log.error("Failed to lookup the GeoIP information for '{}'", ip, e); + throw new RuntimeException("Failed to lookup the IP for '%s'".formatted(ip)); } } diff --git a/src/main/java/xyz/mcutils/backend/service/pinger/impl/BedrockMinecraftServerPinger.java b/src/main/java/xyz/mcutils/backend/service/pinger/impl/BedrockMinecraftServerPinger.java index 8b4eb9c..46bf145 100644 --- a/src/main/java/xyz/mcutils/backend/service/pinger/impl/BedrockMinecraftServerPinger.java +++ b/src/main/java/xyz/mcutils/backend/service/pinger/impl/BedrockMinecraftServerPinger.java @@ -58,7 +58,7 @@ public final class BedrockMinecraftServerPinger implements MinecraftServerPinger throw new ResourceNotFoundException("Server '%s' didn't respond to ping".formatted(hostname)); } return BedrockMinecraftServer.create(hostname, ip, port, records, - MinecraftServer.GeoLocation.fromMaxMind(MaxMindService.lookup(hostname)), response); // Return the server + MinecraftServer.GeoLocation.fromMaxMind(MaxMindService.lookup(ip)), response); // Return the server } catch (IOException ex ) { if (ex instanceof UnknownHostException) { throw new BadRequestException("Unknown hostname '%s'".formatted(hostname)); diff --git a/src/main/java/xyz/mcutils/backend/service/pinger/impl/JavaMinecraftServerPinger.java b/src/main/java/xyz/mcutils/backend/service/pinger/impl/JavaMinecraftServerPinger.java index 71226e1..8125790 100644 --- a/src/main/java/xyz/mcutils/backend/service/pinger/impl/JavaMinecraftServerPinger.java +++ b/src/main/java/xyz/mcutils/backend/service/pinger/impl/JavaMinecraftServerPinger.java @@ -53,7 +53,7 @@ public final class JavaMinecraftServerPinger implements MinecraftServerPinger