Java 类net.minecraft.client.network.ServerPinger 实例源码

项目:CustomWorldGen    文件:FMLClientHandler.java   
public void connectToServerAtStartup(String host, int port)
{
    setupServerList();
    ServerPinger osp = new ServerPinger();
    ServerData serverData = new ServerData("Command Line", host+":"+port,false);
    try
    {
        osp.ping(serverData);
        startupConnectionData.await(30, TimeUnit.SECONDS);
    }
    catch (Exception e)
    {
        showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port));
        return;
    }
    connectToServer(new GuiMainMenu(), serverData);
}
项目:Wurst-MC-1.12    文件:WurstServerPinger.java   
public void ping(final String ip, final int port)
{
    server = new ServerData("", ip + ":" + port, false);
    new Thread("Wurst Server Connector #" + threadNumber.incrementAndGet())
    {
        @Override
        public void run()
        {
            ServerPinger pinger = new ServerPinger();
            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();
}
项目:morecommands    文件:PatchEntityPlayerSP.java   
private static GuiScreen connectToServerAtStartup(String host, int port) {
    if (startupConnectionDataField == null || serverDataTagField == null)
        return null;

    CountDownLatch startupConnectionData = ReflectionHelper.get(ObfuscatedField.FMLClientHandler_startupConnectionData, startupConnectionDataField, null);
    Map<ServerData, ExtendedServerListData> serverDataTag = ReflectionHelper.get(ObfuscatedField.FMLClientHandler_serverDataTag, serverDataTagField, FMLClientHandler.instance());

    if (startupConnectionData == null || serverDataTag == null)
        return null;

    FMLClientHandler.instance().setupServerList();
    ServerPinger osp = new ServerPinger();
    ServerData serverData = new ServerData("Command Line", host+":"+port,false);

    try {
        osp.ping(serverData);
        startupConnectionData.await(30, TimeUnit.SECONDS);
    }
    catch (Exception e) {
        return GuiConnecting.newGuiConnecting(new GuiMainMenu(), Minecraft.getMinecraft(), host, port);
    }

    ExtendedServerListData extendedData = serverDataTag.get(serverData);

    if (extendedData != null && extendedData.isBlocked)
           return new GuiAccessDenied(new GuiMainMenu(), serverData);
    else
        return GuiConnecting.newGuiConnecting(new GuiMainMenu(), Minecraft.getMinecraft(), serverData);
}
项目:Backmemed    文件:GuiMultiplayer.java   
public ServerPinger getOldServerPinger()
{
    return this.oldServerPinger;
}
项目:CustomWorldGen    文件:GuiMultiplayer.java   
public ServerPinger getOldServerPinger()
{
    return this.oldServerPinger;
}
项目:Coherence    文件:UiMultiplayer.java   
public ServerPinger getOldServerPinger()
{
    return this.oldServerPinger;
}
项目:ExpandedRailsMod    文件:GuiMultiplayer.java   
public ServerPinger getOldServerPinger()
{
    return this.oldServerPinger;
}