public @Override ServerQueryInformation queryServer(InetSocketAddress destination) {
ServerQueryInformation query = new ServerQueryInformation();
String ipStr = destination.getAddress().getHostAddress();
int port = destination.getPort()+1; // UT2004 uses game port + 1 for server query
long started = System.currentTimeMillis();
ServerInfo serverInfo = QueriEd.serverQuery("UT2004",ipStr,port);
query.ping = (int)(System.currentTimeMillis() - started);
String serverName = null;
if(serverInfo != null) {
serverName = serverInfo.getName();
query.mapName = serverInfo.getMap();
int realport = Integer.parseInt(serverInfo.getPort());
if(realport != destination.getPort())
System.err.println("ERROR: real port from query: " + realport + " is not the same as current destination port: " + destination.getPort());
query.setPlayerCount(serverInfo.getPlayerCount());
query.setMaxPlayerCount(serverInfo.getMaxPlayers());
System.out.println("Queried server: " + serverName);
} else
System.err.println("Unable to query server.");
query.serverName = serverName;
return query;