• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java S00PacketKeepAlive类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.network.play.server.S00PacketKeepAlive的典型用法代码示例。如果您正苦于以下问题:Java S00PacketKeepAlive类的具体用法?Java S00PacketKeepAlive怎么用?Java S00PacketKeepAlive使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



S00PacketKeepAlive类属于net.minecraft.network.play.server包,在下文中一共展示了S00PacketKeepAlive类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: update

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
/**
 * Like the old updateEntity(), except more generic.
 */
public void update()
{
    this.field_147366_g = false;
    ++this.networkTickCount;
    this.serverController.theProfiler.startSection("keepAlive");

    if ((long)this.networkTickCount - this.lastSentPingPacket > 40L)
    {
        this.lastSentPingPacket = (long)this.networkTickCount;
        this.lastPingTime = this.currentTimeMillis();
        this.field_147378_h = (int)this.lastPingTime;
        this.sendPacket(new S00PacketKeepAlive(this.field_147378_h));
    }

    this.serverController.theProfiler.endSection();

    if (this.chatSpamThresholdCount > 0)
    {
        --this.chatSpamThresholdCount;
    }

    if (this.itemDropThreshold > 0)
    {
        --this.itemDropThreshold;
    }

    if (this.playerEntity.getLastActiveTime() > 0L && this.serverController.getMaxPlayerIdleMinutes() > 0 && MinecraftServer.getCurrentTimeMillis() - this.playerEntity.getLastActiveTime() > (long)(this.serverController.getMaxPlayerIdleMinutes() * 1000 * 60))
    {
        this.kickPlayerFromServer("You have been idle for too long!");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:NetHandlerPlayServer.java


示例2: queueUnwrappedPacket

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public boolean queueUnwrappedPacket(EntityPlayer player, Object packetObj) {
    if (packetObj == null) return true;
    if (player == null) {
        if (packetObj instanceof C00PacketKeepAlive || packetObj instanceof S00PacketKeepAlive) {
            NORELEASE.fixme("Shouldn't this, like, not happen?");
            return true;
        }
        NORELEASE.println("No player to handle: " + packetObj + " " + packetObj.getClass().getSimpleName());
        return true;
    }
    if (player.worldObj.isRemote) return false;
    Packet packet = (Packet) packetObj;
    // May possibly need to inject the liason into things up higher, during reading. Somehow. Hopefulloy won't be needed.
    InteractionLiason liason = InteractionLiason.activeLiasons.get(player);
    if (liason == null) {
        if (!(packet instanceof C00PacketKeepAlive)) {
            // Seems our system isn't perfect. :/
            // Keepalives are generated from a different thread I guess.
            Hammer.logWarning("Liasonless wrapped packet: " + packet.getClass().getSimpleName() + " " + packet.toString());
        }
        return true;
    }
    NetHandlerPlayServer handler = liason.playerNetServerHandler;
    if (packet instanceof FMLProxyPacket) {
        FMLProxyPacket fml = (FMLProxyPacket) packet;
        NetworkDispatcher dispatcher = handler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
        fml.setTarget(Side.CLIENT);
        fml.setDispatcher(dispatcher);
        if (fml.payload().readerIndex() != 0) {
            Core.logSevere("Packet double-processing detected! Channel: " + fml.channel());
            return true;
        }
    }
    packet.processPacket(handler);
    return true;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:37,代码来源:HammerProxy.java


示例3: onNetworkTick

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
/**
 * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer
 * for a login-timeout
 */
public void onNetworkTick()
{
    this.field_147366_g = false;
    ++this.networkTickCount;
    this.serverController.theProfiler.startSection("keepAlive");

    if ((long)this.networkTickCount - this.field_147377_k > 40L)
    {
        this.field_147377_k = (long)this.networkTickCount;
        this.field_147379_i = this.func_147363_d();
        this.field_147378_h = (int)this.field_147379_i;
        this.sendPacket(new S00PacketKeepAlive(this.field_147378_h));
    }

    if (this.chatSpamThresholdCount > 0)
    {
        --this.chatSpamThresholdCount;
    }

    if (this.field_147375_m > 0)
    {
        --this.field_147375_m;
    }

    this.serverController.theProfiler.endStartSection("playerTick");
    this.serverController.theProfiler.endSection();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:32,代码来源:NetHandlerPlayServer.java


示例4: onNetworkTick

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public void onNetworkTick()
{
    this.field_147366_g = false;
    ++this.networkTickCount;
    this.serverController.theProfiler.startSection("keepAlive");

    if ((long)this.networkTickCount - this.field_147377_k > 40L)
    {
        this.field_147377_k = (long)this.networkTickCount;
        this.field_147379_i = this.func_147363_d();
        this.field_147378_h = (int)this.field_147379_i;
        this.sendPacket(new S00PacketKeepAlive(this.field_147378_h));
    }

    // CraftBukkit start
    for (int spam; (spam = this.chatSpamThresholdCount) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1);) ;

    /* Use thread-safe field access instead
    if (this.chatSpamThresholdCount > 0)
    {
        --this.chatSpamThresholdCount;
    }
    */
    // CraftBukkit end

    if (this.field_147375_m > 0)
    {
        --this.field_147375_m;
    }

    if (this.playerEntity.func_154331_x() > 0L && this.serverController.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.playerEntity.func_154331_x() > (long)(this.serverController.func_143007_ar() * 1000 * 60))
    {
        this.kickPlayerFromServer("You have been idle for too long!");
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:36,代码来源:NetHandlerPlayServer.java


示例5: onNetworkTick

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public void onNetworkTick()
{
    this.field_147366_g = false;
    ++this.networkTickCount;
    this.serverController.theProfiler.startSection("keepAlive");

    if ((long)this.networkTickCount - this.field_147377_k > 40L)
    {
        this.field_147377_k = (long)this.networkTickCount;
        this.field_147379_i = this.func_147363_d();
        this.field_147378_h = (int)this.field_147379_i;
        this.sendPacket(new S00PacketKeepAlive(this.field_147378_h));
    }

    if (this.chatSpamThresholdCount > 0)
    {
        --this.chatSpamThresholdCount;
    }

    if (this.field_147375_m > 0)
    {
        --this.field_147375_m;
    }

    if (this.playerEntity.func_154331_x() > 0L && this.serverController.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.playerEntity.func_154331_x() > (long)(this.serverController.func_143007_ar() * 1000 * 60))
    {
        this.kickPlayerFromServer("You have been idle for too long!");
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:30,代码来源:NetHandlerPlayServer.java


示例6: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public void handleKeepAlive(S00PacketKeepAlive packetIn)
{
    this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:NetHandlerPlayClient.java


示例7: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public void handleKeepAlive(S00PacketKeepAlive packetIn) {
	this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:NetHandlerPlayClient.java


示例8: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
public void handleKeepAlive(S00PacketKeepAlive p_147272_1_)
{
    this.addToSendQueue(new C00PacketKeepAlive(p_147272_1_.func_149134_c()));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:NetHandlerPlayClient.java


示例9: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
void handleKeepAlive(S00PacketKeepAlive packetIn); 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:2,代码来源:INetHandlerPlayClient.java


示例10: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
void handleKeepAlive(S00PacketKeepAlive var1); 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:2,代码来源:INetHandlerPlayClient.java


示例11: handleKeepAlive

import net.minecraft.network.play.server.S00PacketKeepAlive; //导入依赖的package包/类
void handleKeepAlive(S00PacketKeepAlive p_147272_1_); 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:INetHandlerPlayClient.java



注:本文中的net.minecraft.network.play.server.S00PacketKeepAlive类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RxLocation类代码示例发布时间:2022-05-23
下一篇:
Java AminoAcidCompound类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap