Java 类net.minecraft.network.packet.Packet0KeepAlive 实例源码

项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72570_d() {
   this.field_72584_h = false;
   ++this.field_72571_f;
   this.field_72573_d.field_71304_b.func_76320_a("packetflow");
   this.field_72575_b.func_74428_b();
   this.field_72573_d.field_71304_b.func_76318_c("keepAlive");
   if((long)this.field_72571_f - this.field_72580_l > 20L) {
      this.field_72580_l = (long)this.field_72571_f;
      this.field_72582_j = System.nanoTime() / 1000000L;
      this.field_72585_i = field_72583_k.nextInt();
      this.func_72567_b(new Packet0KeepAlive(this.field_72585_i));
   }

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

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

   this.field_72573_d.field_71304_b.func_76318_c("playerTick");
   this.field_72573_d.field_71304_b.func_76319_b();
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72477_a(Packet0KeepAlive p_72477_1_) {
   if(p_72477_1_.field_73592_a == this.field_72585_i) {
      int var2 = (int)(System.nanoTime() / 1000000L - this.field_72582_j);
      this.field_72574_e.field_71138_i = (this.field_72574_e.field_71138_i * 3 + var2) / 4;
   }

}
项目:RuneCraftery    文件:GuiDownloadTerrain.java   
public void func_73876_c() {
   ++this.field_74260_b;
   if(this.field_74260_b % 20 == 0) {
      this.field_74261_a.func_72552_c(new Packet0KeepAlive());
   }

   if(this.field_74261_a != null) {
      this.field_74261_a.func_72551_d();
   }

}
项目:RuneCraftery    文件:NetServerHandler.java   
/**
 * run once each game tick
 */
public void networkTick()
{
    this.field_72584_h = false;
    ++this.currentTicks;
    this.mcServer.theProfiler.startSection("packetflow");
    this.netManager.processReadPackets();
    this.mcServer.theProfiler.endStartSection("keepAlive");

    if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L)
    {
        this.ticksOfLastKeepAlive = (long)this.currentTicks;
        this.keepAliveTimeSent = System.nanoTime() / 1000000L;
        this.keepAliveRandomID = randomGenerator.nextInt();
        this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID));
    }

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

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

    this.mcServer.theProfiler.endStartSection("playerTick");
    this.mcServer.theProfiler.endSection();
}
项目:RuneCraftery    文件:NetServerHandler.java   
/**
 * Handle a keep alive packet.
 */
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)
{
    if (par1Packet0KeepAlive.randomId == this.keepAliveRandomID)
    {
        int i = (int)(System.nanoTime() / 1000000L - this.keepAliveTimeSent);
        this.playerEntity.ping = (this.playerEntity.ping * 3 + i) / 4;
    }
}
项目:RuneCraftery    文件:GuiDownloadTerrain.java   
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    ++this.updateCounter;

    if (this.updateCounter % 20 == 0)
    {
        this.netHandler.addToSendQueue(new Packet0KeepAlive());
    }

    if (this.netHandler != null)
    {
        this.netHandler.processReadPackets();
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
/**
 * run once each game tick
 */
public void networkTick()
{
    this.field_72584_h = false;
    ++this.currentTicks;
    this.mcServer.theProfiler.startSection("packetflow");
    this.netManager.processReadPackets();
    this.mcServer.theProfiler.endStartSection("keepAlive");

    if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L)
    {
        this.ticksOfLastKeepAlive = (long)this.currentTicks;
        this.keepAliveTimeSent = System.nanoTime() / 1000000L;
        this.keepAliveRandomID = randomGenerator.nextInt();
        this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID));
    }

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

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

    this.mcServer.theProfiler.endStartSection("playerTick");
    this.mcServer.theProfiler.endSection();
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
/**
 * Handle a keep alive packet.
 */
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)
{
    if (par1Packet0KeepAlive.randomId == this.keepAliveRandomID)
    {
        int i = (int)(System.nanoTime() / 1000000L - this.keepAliveTimeSent);
        this.playerEntity.ping = (this.playerEntity.ping * 3 + i) / 4;
    }
}
项目:BetterNutritionMod    文件:GuiDownloadTerrain.java   
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    ++this.updateCounter;

    if (this.updateCounter % 20 == 0)
    {
        this.netHandler.addToSendQueue(new Packet0KeepAlive());
    }

    if (this.netHandler != null)
    {
        this.netHandler.processReadPackets();
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)
{
    nch.handleKeepAlive(par1Packet0KeepAlive);      
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72477_a(Packet0KeepAlive p_72477_1_) {
   this.func_72509_a(p_72477_1_);
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72477_a(Packet0KeepAlive p_72477_1_) {
   this.func_72552_c(new Packet0KeepAlive(p_72477_1_.field_73592_a));
}
项目:RuneCraftery    文件:NetClientHandler.java   
/**
 * Handle a keep alive packet.
 */
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)
{
    this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId));
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
/**
 * Handle a keep alive packet.
 */
public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive)
{
    this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId));
}