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

项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
   /* WDL >>> */
   if(WDL.downloading)
   {
       WDL.stop();
       try{Thread.sleep(2000);}catch(Exception e){}
   }
   /* <<< WDL */
    nch.handleKickDisconnect(par1Packet255KickDisconnect);      
}
项目:RuneCraftery    文件:NetLoginHandler.java   
public void func_72527_a(String p_72527_1_) {
   try {
      this.field_72534_f.func_98033_al().func_98233_a("Disconnecting " + this.func_72528_e() + ": " + p_72527_1_);
      this.field_72538_b.func_74429_a(new Packet255KickDisconnect(p_72527_1_));
      this.field_72538_b.func_74423_d();
      this.field_72539_c = true;
   } catch (Exception var3) {
      var3.printStackTrace();
   }

}
项目:RuneCraftery    文件:NetLoginHandler.java   
public void func_72467_a(Packet254ServerPing p_72467_1_) {
   try {
      ServerConfigurationManager var2 = this.field_72534_f.func_71203_ab();
      String var3 = null;
      if(p_72467_1_.func_140050_d()) {
         var3 = this.field_72534_f.func_71273_Y() + "\u00a7" + var2.func_72394_k() + "\u00a7" + var2.func_72352_l();
      } else {
         List var4 = Arrays.asList(new Serializable[]{Integer.valueOf(1), Integer.valueOf(78), this.field_72534_f.func_71249_w(), this.field_72534_f.func_71273_Y(), Integer.valueOf(var2.func_72394_k()), Integer.valueOf(var2.func_72352_l())});

         Object var6;
         for(Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) {
            var6 = var5.next();
            if(var3 == null) {
               var3 = "\u00a7";
            } else {
               var3 = var3 + "\u0000";
            }
         }
      }

      InetAddress var8 = null;
      if(this.field_72538_b.func_74452_g() != null) {
         var8 = this.field_72538_b.func_74452_g().getInetAddress();
      }

      this.field_72538_b.func_74429_a(new Packet255KickDisconnect(var3));
      this.field_72538_b.func_74423_d();
      if(var8 != null && this.field_72534_f.func_71212_ac() instanceof DedicatedServerListenThread) {
         ((DedicatedServerListenThread)this.field_72534_f.func_71212_ac()).func_71761_a(var8);
      }

      this.field_72539_c = true;
   } catch (Exception var7) {
      var7.printStackTrace();
   }

}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72565_c(String p_72565_1_) {
   if(!this.field_72576_c) {
      this.field_72574_e.func_71123_m();
      this.func_72567_b(new Packet255KickDisconnect(p_72565_1_));
      this.field_72575_b.func_74423_d();
      this.field_72573_d.func_71203_ab().func_92062_k(ChatMessageComponent.func_111082_b("multiplayer.player.left", new Object[]{this.field_72574_e.func_96090_ax()}).func_111059_a(EnumChatFormatting.YELLOW));
      this.field_72573_d.func_71203_ab().func_72367_e(this.field_72574_e);
      this.field_72576_c = true;
   }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72492_a(Packet255KickDisconnect p_72492_1_) {
   this.field_72555_g.func_74424_a("disconnect.kicked", new Object[0]);
   this.field_72554_f = true;
   this.field_72563_h.func_71403_a((WorldClient)null);
   if(this.field_98183_l != null) {
      this.field_72563_h.func_71373_a(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[]{p_72492_1_.field_73631_a}));
   } else {
      this.field_72563_h.func_71373_a(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[]{p_72492_1_.field_73631_a}));
   }

}
项目:RuneCraftery    文件:NetLoginHandler.java   
public void raiseErrorAndDisconnect(String par1Str)
{
    try
    {
        this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str);
        this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str));
        this.myTCPConnection.serverShutdown();
        this.connectionComplete = true;
    }
    catch (Exception exception)
    {
        exception.printStackTrace();
    }
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void kickPlayerFromServer(String par1Str)
{
    if (!this.connectionClosed)
    {
        this.playerEntity.mountEntityAndWakeUp();
        this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str));
        this.netManager.serverShutdown();
        this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
        this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity);
        this.connectionClosed = true;
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
    this.netManager.networkShutdown("disconnect.kicked", par1Packet255KickDisconnect.reason);
    this.disconnected = true;
    this.mc.loadWorld((WorldClient)null);

    if (this.field_98183_l != null)
    {
        this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
    }
    else
    {
        this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
    }
}
项目:BetterNutritionMod    文件:NetLoginHandler.java   
public void raiseErrorAndDisconnect(String par1Str)
{
    try
    {
        this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str);
        this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str));
        this.myTCPConnection.serverShutdown();
        this.connectionComplete = true;
    }
    catch (Exception exception)
    {
        exception.printStackTrace();
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
public void kickPlayerFromServer(String par1Str)
{
    if (!this.connectionClosed)
    {
        this.playerEntity.mountEntityAndWakeUp();
        this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str));
        this.netManager.serverShutdown();
        this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
        this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity);
        this.connectionClosed = true;
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
    this.netManager.networkShutdown("disconnect.kicked", par1Packet255KickDisconnect.reason);
    this.disconnected = true;
    this.mc.loadWorld((WorldClient)null);

    if (this.field_98183_l != null)
    {
        this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
    }
    else
    {
        this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
    }
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72492_a(Packet255KickDisconnect p_72492_1_) {
   this.func_72509_a(p_72492_1_);
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72492_a(Packet255KickDisconnect p_72492_1_) {
   this.field_72575_b.func_74424_a("disconnect.quitting", new Object[0]);
}
项目:RuneCraftery    文件:WorldClient.java   
public void func_72882_A() {
   this.field_73035_a.func_72546_b(new Packet255KickDisconnect("Quitting"));
}
项目:RuneCraftery    文件:NetLoginHandler.java   
/**
 * Handle a server ping packet.
 */
public void handleServerPing(Packet254ServerPing par1Packet254ServerPing)
{
    try
    {
        ServerConfigurationManager serverconfigurationmanager = this.mcServer.getConfigurationManager();
        String s = null;

        if (par1Packet254ServerPing.func_140050_d())
        {
            s = this.mcServer.getMOTD() + "\u00a7" + serverconfigurationmanager.getCurrentPlayerCount() + "\u00a7" + serverconfigurationmanager.getMaxPlayers();
        }
        else
        {
            List list = Arrays.asList(new Serializable[] {Integer.valueOf(1), Integer.valueOf(78), this.mcServer.getMinecraftVersion(), this.mcServer.getMOTD(), Integer.valueOf(serverconfigurationmanager.getCurrentPlayerCount()), Integer.valueOf(serverconfigurationmanager.getMaxPlayers())});
            Object object;

            for (Iterator iterator = list.iterator(); iterator.hasNext(); s = s + object.toString().replaceAll("\u0000", ""))
            {
                object = iterator.next();

                if (s == null)
                {
                    s = "\u00a7";
                }
                else
                {
                    s = s + "\u0000";
                }
            }
        }

        InetAddress inetaddress = null;

        if (this.myTCPConnection.getSocket() != null)
        {
            inetaddress = this.myTCPConnection.getSocket().getInetAddress();
        }

        this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(s));
        this.myTCPConnection.serverShutdown();

        if (inetaddress != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread)
        {
            ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(inetaddress);
        }

        this.connectionComplete = true;
    }
    catch (Exception exception)
    {
        exception.printStackTrace();
    }
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
    this.netManager.networkShutdown("disconnect.quitting", new Object[0]);
}
项目:RuneCraftery    文件:WorldClient.java   
/**
 * If on MP, sends a quitting packet.
 */
public void sendQuittingDisconnectingPacket()
{
    this.sendQueue.quitWithPacket(new Packet255KickDisconnect("Quitting"));
}
项目:BetterNutritionMod    文件:NetLoginHandler.java   
/**
 * Handle a server ping packet.
 */
public void handleServerPing(Packet254ServerPing par1Packet254ServerPing)
{
    try
    {
        ServerConfigurationManager serverconfigurationmanager = this.mcServer.getConfigurationManager();
        String s = null;

        if (par1Packet254ServerPing.func_140050_d())
        {
            s = this.mcServer.getMOTD() + "\u00a7" + serverconfigurationmanager.getCurrentPlayerCount() + "\u00a7" + serverconfigurationmanager.getMaxPlayers();
        }
        else
        {
            List list = Arrays.asList(new Serializable[] {Integer.valueOf(1), Integer.valueOf(78), this.mcServer.getMinecraftVersion(), this.mcServer.getMOTD(), Integer.valueOf(serverconfigurationmanager.getCurrentPlayerCount()), Integer.valueOf(serverconfigurationmanager.getMaxPlayers())});
            Object object;

            for (Iterator iterator = list.iterator(); iterator.hasNext(); s = s + object.toString().replaceAll("\u0000", ""))
            {
                object = iterator.next();

                if (s == null)
                {
                    s = "\u00a7";
                }
                else
                {
                    s = s + "\u0000";
                }
            }
        }

        InetAddress inetaddress = null;

        if (this.myTCPConnection.getSocket() != null)
        {
            inetaddress = this.myTCPConnection.getSocket().getInetAddress();
        }

        this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(s));
        this.myTCPConnection.serverShutdown();

        if (inetaddress != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread)
        {
            ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(inetaddress);
        }

        this.connectionComplete = true;
    }
    catch (Exception exception)
    {
        exception.printStackTrace();
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
    this.netManager.networkShutdown("disconnect.quitting", new Object[0]);
}
项目:BetterNutritionMod    文件:WorldClient.java   
/**
 * If on MP, sends a quitting packet.
 */
public void sendQuittingDisconnectingPacket()
{
    this.sendQueue.quitWithPacket(new Packet255KickDisconnect("Quitting"));
}