public void connectToServerAtStartup(String host, int port) { setupServerList(); OldServerPinger osp = new OldServerPinger(); ServerData serverData = new ServerData("Command Line", host+":"+port); try { osp.func_147224_a(serverData); startupConnectionData.await(30, TimeUnit.SECONDS); } catch (Exception e) { showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port)); return; } connectToServer(new GuiMainMenu(), serverData); }
public void ping(final String ip, final int port) { server = new ServerData("", ip + ":" + port); new Thread("Wurst Server Connector #" + threadNumber.incrementAndGet()) { @Override public void run() { OldServerPinger pinger = new OldServerPinger(); try { logger.info("Pinging " + ip + ":" + port + "..."); pinger.ping(server); logger.info("Ping successful: " + ip + ":" + port); } catch (UnknownHostException e) { logger.info("Unknown host: " + ip + ":" + port); failed = true; } catch (Exception e2) { logger.info("Ping failed: " + ip + ":" + port); failed = true; } pinger.clearPendingNetworks(); done = true; } }.start(); }
public NetworkUtils() { this.pinger = new OldServerPinger(); this.mc = Minecraft.getMinecraft(); this.timer = new Timer(); EventManager.register(this); final PingThread pingThread = new PingThread(); pingThread.start(); }
public OldServerPinger getOldServerPinger() { return this.oldServerPinger; }
public OldServerPinger func_146789_i() { return this.field_146797_f; }