Java 类net.minecraft.network.play.server.S00PacketKeepAlive 实例源码

项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:Factorization    文件:HammerProxy.java   
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;
}
项目:Resilience-Client-Source    文件:NetHandlerPlayServer.java   
/**
 * 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();
}
项目:Cauldron    文件:NetHandlerPlayServer.java   
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!");
    }
}
项目:Cauldron    文件:NetHandlerPlayServer.java   
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!");
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive packetIn)
{
    this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive packetIn)
{
    this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive packetIn) {
    this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive p_147272_1_)
{
    this.addToSendQueue(new C00PacketKeepAlive(p_147272_1_.func_149134_c()));
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive p_147272_1_)
{
    this.addToSendQueue(new C00PacketKeepAlive(p_147272_1_.func_149134_c()));
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleKeepAlive(S00PacketKeepAlive p_147272_1_)
{
    this.addToSendQueue(new C00PacketKeepAlive(p_147272_1_.func_149134_c()));
}
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive var1);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive p_147272_1_);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleKeepAlive(S00PacketKeepAlive p_147272_1_);