Java 类net.minecraft.network.status.client.C01PacketPing 实例源码

项目:DecompiledMinecraft    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing packetIn)
{
    this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime()));
    this.networkManager.closeChannel(field_183007_a);
}
项目:DecompiledMinecraft    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing packetIn)
{
    this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime()));
    this.networkManager.closeChannel(field_183007_a);
}
项目:BaseClient    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing packetIn)
{
    this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime()));
    this.networkManager.closeChannel(field_183007_a);
}
项目:BaseClient    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing packetIn)
{
    this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime()));
    this.networkManager.closeChannel(field_183007_a);
}
项目:Resilience-Client-Source    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing p_147311_1_)
{
    this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(p_147311_1_.func_149289_c()), new GenericFutureListener[0]);
}
项目:Cauldron    文件:RealmsServerStatusPinger.java   
public void pingServer(final String p_pingServer_1_, final ServerPing p_pingServer_2_) throws IOException
{
    if (p_pingServer_1_ != null && !p_pingServer_1_.startsWith("0.0.0.0") && !p_pingServer_1_.isEmpty())
    {
        RealmsServerAddress realmsserveraddress = RealmsServerAddress.parseString(p_pingServer_1_);
        final NetworkManager networkmanager = NetworkManager.provideLanClient(InetAddress.getByName(realmsserveraddress.getHost()), realmsserveraddress.getPort());
        this.connections.add(networkmanager);
        networkmanager.setNetHandler(new INetHandlerStatusClient()
        {
            private boolean field_154345_e = false;
            private static final String __OBFID = "CL_00001807";
            public void handleServerInfo(S00PacketServerInfo p_147397_1_)
            {
                ServerStatusResponse serverstatusresponse = p_147397_1_.func_149294_c();

                if (serverstatusresponse.func_151318_b() != null)
                {
                    p_pingServer_2_.nrOfPlayers = String.valueOf(serverstatusresponse.func_151318_b().func_151333_b());
                }

                networkmanager.scheduleOutboundPacket(new C01PacketPing(Realms.currentTimeMillis()), new GenericFutureListener[0]);
                this.field_154345_e = true;
            }
            public void handlePong(S01PacketPong p_147398_1_)
            {
                networkmanager.closeChannel(new ChatComponentText("Finished"));
            }
            public void onDisconnect(IChatComponent p_147231_1_)
            {
                if (!this.field_154345_e)
                {
                    RealmsServerStatusPinger.LOGGER.error("Can\'t ping " + p_pingServer_1_ + ": " + p_147231_1_.getUnformattedText());
                }
            }
            public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_)
            {
                if (p_147232_2_ != EnumConnectionState.STATUS)
                {
                    throw new UnsupportedOperationException("Unexpected change in protocol to " + p_147232_2_);
                }
            }
            public void onNetworkTick() {}
        });

        try
        {
            networkmanager.scheduleOutboundPacket(new C00Handshake(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION, realmsserveraddress.getHost(), realmsserveraddress.getPort(), EnumConnectionState.STATUS), new GenericFutureListener[0]);
            networkmanager.scheduleOutboundPacket(new C00PacketServerQuery(), new GenericFutureListener[0]);
        }
        catch (Throwable throwable)
        {
            LOGGER.error(throwable);
        }
    }
}
项目:Cauldron    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing p_147311_1_)
{
    this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(p_147311_1_.func_149289_c()), new GenericFutureListener[0]);
}
项目:Cauldron    文件:RealmsServerStatusPinger.java   
public void pingServer(final String p_pingServer_1_, final ServerPing p_pingServer_2_) throws IOException
{
    if (p_pingServer_1_ != null && !p_pingServer_1_.startsWith("0.0.0.0") && !p_pingServer_1_.isEmpty())
    {
        RealmsServerAddress realmsserveraddress = RealmsServerAddress.parseString(p_pingServer_1_);
        final NetworkManager networkmanager = NetworkManager.provideLanClient(InetAddress.getByName(realmsserveraddress.getHost()), realmsserveraddress.getPort());
        this.connections.add(networkmanager);
        networkmanager.setNetHandler(new INetHandlerStatusClient()
        {
            private boolean field_154345_e = false;
            private static final String __OBFID = "CL_00001807";
            public void handleServerInfo(S00PacketServerInfo p_147397_1_)
            {
                ServerStatusResponse serverstatusresponse = p_147397_1_.func_149294_c();

                if (serverstatusresponse.func_151318_b() != null)
                {
                    p_pingServer_2_.nrOfPlayers = String.valueOf(serverstatusresponse.func_151318_b().func_151333_b());
                }

                networkmanager.scheduleOutboundPacket(new C01PacketPing(Realms.currentTimeMillis()), new GenericFutureListener[0]);
                this.field_154345_e = true;
            }
            public void handlePong(S01PacketPong p_147398_1_)
            {
                networkmanager.closeChannel(new ChatComponentText("Finished"));
            }
            public void onDisconnect(IChatComponent p_147231_1_)
            {
                if (!this.field_154345_e)
                {
                    RealmsServerStatusPinger.LOGGER.error("Can\'t ping " + p_pingServer_1_ + ": " + p_147231_1_.getUnformattedText());
                }
            }
            public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_)
            {
                if (p_147232_2_ != EnumConnectionState.STATUS)
                {
                    throw new UnsupportedOperationException("Unexpected change in protocol to " + p_147232_2_);
                }
            }
            public void onNetworkTick() {}
        });

        try
        {
            networkmanager.scheduleOutboundPacket(new C00Handshake(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION, realmsserveraddress.getHost(), realmsserveraddress.getPort(), EnumConnectionState.STATUS), new GenericFutureListener[0]);
            networkmanager.scheduleOutboundPacket(new C00PacketServerQuery(), new GenericFutureListener[0]);
        }
        catch (Throwable throwable)
        {
            LOGGER.error(throwable);
        }
    }
}
项目:Cauldron    文件:NetHandlerStatusServer.java   
public void processPing(C01PacketPing p_147311_1_)
{
    this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(p_147311_1_.func_149289_c()), new GenericFutureListener[0]);
}
项目:DecompiledMinecraft    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing packetIn);
项目:DecompiledMinecraft    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing packetIn);
项目:BaseClient    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing packetIn);
项目:BaseClient    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing packetIn);
项目:Resilience-Client-Source    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing var1);
项目:Cauldron    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing p_147311_1_);
项目:Cauldron    文件:INetHandlerStatusServer.java   
void processPing(C01PacketPing p_147311_1_);