Package de.zh32.pingtest

Examples of de.zh32.pingtest.Response$Player


                        JOptionPane.ERROR_MESSAGE);
            } else {
                String name = serverName.getText();
                final String host = serverHost.getText();
                final int port = Integer.parseInt(serverPort.getText().replaceAll("[^0-9]", ""));
                QueryVersion qv = null;

                final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("tools.serverchecker" + "" +
                        ".checkingserver"), 0, Language.INSTANCE.localize("tools.serverchecker.checkingserver"),
                        "Cancelled Server Check!");
                dialog.addThread(new Thread() {
View Full Code Here


            return QueryVersion.mc16;
        } catch (Exception ex) {
        }

        try {
            ServerListPing14 ping14 = new ServerListPing14();
            ping14.setAddress(inetSocketAddress);
            ping14.fetchData();
            return QueryVersion.mc14;
        } catch (Exception ex) {
        }

        try {
View Full Code Here

        InetSocketAddress inetSocketAddress = new InetSocketAddress(host, port);

        switch (qv) {
            case mc14:
                try {
                    ServerListPing14 ping14 = new ServerListPing14();
                    ping14.setAddress(inetSocketAddress);
                    ping14.fetchData();
                    return ping14.getPlayersOnline();
                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc16:
                try {
View Full Code Here

public class MCQuery {
    public static QueryVersion getMinecraftServerQueryVersion(String host, int port) {
        InetSocketAddress inetSocketAddress = new InetSocketAddress(host, port);

        try {
            ServerListPing16 ping16 = new ServerListPing16();
            ping16.setAddress(inetSocketAddress);
            ping16.fetchData();
            return QueryVersion.mc16;
        } catch (Exception ex) {
        }

        try {
View Full Code Here

                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc16:
                try {
                    ServerListPing16 ping16 = new ServerListPing16();
                    ping16.setAddress(inetSocketAddress);
                    ping16.fetchData();
                    return ping16.getPlayersOnline();
                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc17:
                try {
View Full Code Here

        }

        // 1.7 must be queried last because if not, the rest of the checks will ALWAYS fail for some
        // reason of which I'm not sure of yet
        try {
            ServerListPing17 ping17 = new ServerListPing17();
            ping17.setAddress(inetSocketAddress);
            ping17.fetchData();
            return QueryVersion.mc17;
        } catch (Exception ex) {
        }

        return null; // Couldn't determine version so return null
View Full Code Here

                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc17:
                try {
                    ServerListPing17 ping17 = new ServerListPing17();
                    ping17.setAddress(inetSocketAddress);
                    StatusResponse response = ping17.fetchData();
                    return response.getPlayers().getOnline();
                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc18b:
View Full Code Here

                return -1; // Server not reachable so send -1 for offline
            case mc17:
                try {
                    ServerListPing17 ping17 = new ServerListPing17();
                    ping17.setAddress(inetSocketAddress);
                    StatusResponse response = ping17.fetchData();
                    return response.getPlayers().getOnline();
                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc18b:
                try {
View Full Code Here

            return QueryVersion.mc14;
        } catch (Exception ex) {
        }

        try {
            ServerListPingB18 pingb18 = new ServerListPingB18();
            pingb18.setAddress(inetSocketAddress);
            pingb18.fetchData();
            return QueryVersion.mc18b;
        } catch (Exception ex) {
        }

        // 1.7 must be queried last because if not, the rest of the checks will ALWAYS fail for some
View Full Code Here

                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            case mc18b:
                try {
                    ServerListPingB18 pingb18 = new ServerListPingB18();
                    pingb18.setAddress(inetSocketAddress);
                    pingb18.fetchData();
                    return pingb18.getPlayersOnline();
                } catch (Exception ex) {
                }
                return -1; // Server not reachable so send -1 for offline
            default:
                return -1; // Meaning server unreachable since there was no match to the qv
View Full Code Here

TOP

Related Classes of de.zh32.pingtest.Response$Player

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.