本文整理汇总了Java中net.minecraft.network.status.client.C01PacketPing类的典型用法代码示例。如果您正苦于以下问题:Java C01PacketPing类的具体用法?Java C01PacketPing怎么用?Java C01PacketPing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
C01PacketPing类属于net.minecraft.network.status.client包,在下文中一共展示了C01PacketPing类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processPing
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
public void processPing(C01PacketPing packetIn)
{
this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime()));
this.networkManager.closeChannel(field_183007_a);
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:NetHandlerStatusServer.java
示例2: processPing
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
public void processPing(C01PacketPing p_147311_1_)
{
this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(p_147311_1_.func_149289_c()), new GenericFutureListener[0]);
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:NetHandlerStatusServer.java
示例3: pingServer
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
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);
}
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:56,代码来源:RealmsServerStatusPinger.java
示例4: processPing
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
void processPing(C01PacketPing packetIn);
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:2,代码来源:INetHandlerStatusServer.java
示例5: processPing
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
void processPing(C01PacketPing var1);
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:2,代码来源:INetHandlerStatusServer.java
示例6: processPing
import net.minecraft.network.status.client.C01PacketPing; //导入依赖的package包/类
void processPing(C01PacketPing p_147311_1_);
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerStatusServer.java
注:本文中的net.minecraft.network.status.client.C01PacketPing类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论