net.minecraft.network

## Class NetLoginHandler

- java.lang.Object
- - net.minecraft.network.packet.NetHandler
  - - net.minecraft.network.NetLoginHandler

-     public class NetLoginHandler
      extends NetHandler

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `clientUsername`
    `boolean` | `connectionComplete`
    `TcpConnection` | `myTCPConnection`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetLoginHandler(MinecraftServer par1MinecraftServer, Socket par2Socket, String par3Str)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `completeConnection(String s)`
    `static boolean` | `func_72531_a(NetLoginHandler par0NetLoginHandler, boolean par1)`
    `EntityPlayer` | `getPlayer()`
    `String` | `getUsernameAndAddress()`
    `void` | `handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand)`
    `void` | `handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)`
    `void` | `handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload)`
    `void` | `handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)`
    `void` | `handleLogin(Packet1Login par1Packet1Login)`
    `void` | `handleServerPing(Packet254ServerPing par1Packet254ServerPing)` Handle a server ping packet.
    `void` | `handleSharedKey(Packet252SharedKey par1Packet252SharedKey)`
    `void` | `handleVanilla250Packet(Packet250CustomPayload payload)`
    `void` | `initializePlayerConnection()` on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd
    `boolean` | `isServerHandler()` determine if it is a server handler
    `void` | `raiseErrorAndDisconnect(String par1Str)`
    `void` | `tryLogin()` Logs the user in if a login packet is found, otherwise keeps processing network packets unless the timeout has occurred.
    `void` | `unexpectedPacket(Packet par1Packet)` Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing.

    - ### Methods inherited from class net.minecraft.network.packet.NetHandler

      `canProcessPacketsAsync, handleAnimation, handleAttachEntity, handleAutoComplete, handleBlockChange, handleBlockDestroy, handleBlockDig, handleBlockEvent, handleBlockItemSwitch, handleChat, handleClientInfo, handleCloseWindow, handleCollect, handleCreativeSetSlot, handleDestroyEntity, handleDoorChange, handleEnchantItem, handleEntity, handleEntityAction, handleEntityEffect, handleEntityExpOrb, handleEntityHeadRotation, handleEntityMetadata, handleEntityPainting, handleEntityStatus, handleEntityTeleport, handleEntityVelocity, handleExperience, handleExplosion, handleFlying, handleGameEvent, handleKeepAlive, handleKickDisconnect, handleLevelSound, handleMapChunk, handleMapChunks, handleMapData, handleMobSpawn, handleMultiBlockChange, handleNamedEntitySpawn, handleOpenWindow, handlePlace, handlePlayerAbilities, handlePlayerInfo, handlePlayerInventory, handleRemoveEntityEffect, handleRespawn, handleServerAuthData, handleSetDisplayObjective, handleSetObjective, handleSetPlayerTeam, handleSetScore, handleSetSlot, handleSleep, handleSpawnPosition, handleStatistic, handleTileEntityData, handleTransaction, handleUpdateHealth, handleUpdateProgressbar, handleUpdateSign, handleUpdateTime, handleUseEntity, handleVehicleSpawn, handleWeather, handleWindowClick, handleWindowItems, handleWorldParticles`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### myTCPConnection

          public final TcpConnection myTCPConnection

    - #### connectionComplete

          public boolean connectionComplete

    - #### clientUsername

          public String clientUsername

  - ### Constructor Detail

    - #### NetLoginHandler

          public NetLoginHandler(MinecraftServer par1MinecraftServer,
                         Socket par2Socket,
                         String par3Str)
                          throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### tryLogin

          public void tryLogin()

      Logs the user in if a login packet is found, otherwise keeps processing network packets unless the timeout has occurred.

    - #### raiseErrorAndDisconnect

          public void raiseErrorAndDisconnect(String par1Str)

    - #### handleClientProtocol

          public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)

      Overrides:
        `handleClientProtocol` in class `NetHandler`

    - #### handleSharedKey

          public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey)

      Overrides:
        `handleSharedKey` in class `NetHandler`

    - #### handleClientCommand

          public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand)

      Overrides:
        `handleClientCommand` in class `NetHandler`

    - #### handleLogin

          public void handleLogin(Packet1Login par1Packet1Login)

      Overrides:
        `handleLogin` in class `NetHandler`

    - #### initializePlayerConnection

          public void initializePlayerConnection()

      on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd

    - #### completeConnection

          public void completeConnection(String s)

    - #### handleErrorMessage

          public void handleErrorMessage(String par1Str,
                                Object[] par2ArrayOfObj)

      Overrides:
        `handleErrorMessage` in class `NetHandler`

    - #### handleServerPing

          public void handleServerPing(Packet254ServerPing par1Packet254ServerPing)

      Handle a server ping packet.
      Overrides:
        `handleServerPing` in class `NetHandler`

    - #### unexpectedPacket

          public void unexpectedPacket(Packet par1Packet)

      Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing.
      Overrides:
        `unexpectedPacket` in class `NetHandler`

    - #### getUsernameAndAddress

          public String getUsernameAndAddress()

    - #### isServerHandler

          public boolean isServerHandler()

      determine if it is a server handler
      Specified by:
        `isServerHandler` in class `NetHandler`

    - #### func_72531_a

          public static boolean func_72531_a(NetLoginHandler par0NetLoginHandler,
                             boolean par1)

    - #### handleCustomPayload

          public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload)

      Overrides:
        `handleCustomPayload` in class `NetHandler`

    - #### handleVanilla250Packet

          public void handleVanilla250Packet(Packet250CustomPayload payload)

      Specified by:
        `handleVanilla250Packet` in class `NetHandler`

    - #### getPlayer

          public EntityPlayer getPlayer()

      Specified by:
        `getPlayer` in class `NetHandler`