Package de.zh32.pingtest

Examples of de.zh32.pingtest.ServerListPing17$Version


  }
 
  public static Version toWGAVersion(VersionCompliance versionCompliance) {
    if (versionCompliance != null) {
      if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA3)) {
        return new Version(3, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA4)) {
        return new Version(4, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA41)) {
        return new Version(4, 1, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA50)) {
        return new Version(5, 0 ,0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA51)) {
                return new Version(5, 1 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA52)) {
                return new Version(5, 2 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA53)) {
                return new Version(5, 3 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA54)) {
                return new Version(5, 4 ,0);
            }
    }
    return null;
  }
View Full Code Here


        bean.setUniqueName(sValue)
        update(bean);
        break;
      case 1:
        try {       
          bean.setVersion(new Version((String)value));
          update(bean);
        } catch (RuntimeException e) {
          // unparsable version
            throw new IllegalArgumentException("Unparseable plugin version");
        }
View Full Code Here

                        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

TOP

Related Classes of de.zh32.pingtest.ServerListPing17$Version

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.