Package net.minecraft.server.network
Class ServerLoginNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerLoginNetworkHandler
- All Implemented Interfaces:
PacketListener
,ServerLoginPacketListener
The server login network handler.
It listens to packets on the netty event loop and is ticked on the server thread simultaneously.
- Implementation Requirements:
- The vanilla implementation is created by a handshake network
handler. It first receives a hello packet from the client. If it is in
online mode, it goes through
an additional authentication process. Then it optionally sends a network
compression packet. Finally, when it can accept the player (no player
UUID conflicts), it will accept the player by sending a login success
packet and then transitions the connection's packet listener to a
ServerPlayNetworkHandler
. - Mappings:
Namespace Name official aec
intermediary net/minecraft/class_3248
named net/minecraft/server/network/ServerLoginNetworkHandler
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal ClientConnection
private @Nullable ServerPlayerEntity
The delayed player, waiting to join the server once the existing player with the same UUID is gone.(package private) static final Logger
private int
private static final AtomicInteger
private final byte[]
(package private) @Nullable com.mojang.authlib.GameProfile
private static final Random
(package private) final MinecraftServer
private final String
(package private) ServerLoginNetworkHandler.State
private static final int
-
Constructor Summary
ConstructorDescriptionServerLoginNetworkHandler
(MinecraftServer server, ClientConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates the player to be added to the server and adds it to the server.private void
addToServer
(ServerPlayerEntity player) void
disconnect
(Text reason) Returns the connection this packet listener intends to listen to.void
onDisconnected
(Text reason) Called when the connection this listener listens to has disconnected.void
onHello
(LoginHelloC2SPacket packet) void
onKey
(LoginKeyC2SPacket packet) void
void
tick()
Ticks this login network handler.protected com.mojang.authlib.GameProfile
toOfflineProfile
(com.mojang.authlib.GameProfile profile)
-
Field Details
-
NEXT_AUTHENTICATOR_THREAD_ID
- Mappings:
Namespace Name Mixin selector official b
Laec;b:Ljava/util/concurrent/atomic/AtomicInteger;
intermediary field_14157
Lnet/minecraft/class_3248;field_14157:Ljava/util/concurrent/atomic/AtomicInteger;
named NEXT_AUTHENTICATOR_THREAD_ID
Lnet/minecraft/server/network/ServerLoginNetworkHandler;NEXT_AUTHENTICATOR_THREAD_ID:Ljava/util/concurrent/atomic/AtomicInteger;
-
LOGGER
- Mappings:
Namespace Name Mixin selector official c
Laec;c:Lorg/apache/logging/log4j/Logger;
intermediary field_14166
Lnet/minecraft/class_3248;field_14166:Lorg/apache/logging/log4j/Logger;
named LOGGER
Lnet/minecraft/server/network/ServerLoginNetworkHandler;LOGGER:Lorg/apache/logging/log4j/Logger;
-
TIMEOUT_TICKS
private static final int TIMEOUT_TICKS- See Also:
- Mappings:
Namespace Name Mixin selector official d
Laec;d:I
intermediary field_29779
Lnet/minecraft/class_3248;field_29779:I
named TIMEOUT_TICKS
Lnet/minecraft/server/network/ServerLoginNetworkHandler;TIMEOUT_TICKS:I
-
RANDOM
- Mappings:
Namespace Name Mixin selector official e
Laec;e:Ljava/util/Random;
intermediary field_14164
Lnet/minecraft/class_3248;field_14164:Ljava/util/Random;
named RANDOM
Lnet/minecraft/server/network/ServerLoginNetworkHandler;RANDOM:Ljava/util/Random;
-
nonce
private final byte[] nonce- Mappings:
Namespace Name Mixin selector official f
Laec;f:[B
intermediary field_14167
Lnet/minecraft/class_3248;field_14167:[B
named nonce
Lnet/minecraft/server/network/ServerLoginNetworkHandler;nonce:[B
-
server
- Mappings:
Namespace Name Mixin selector official g
Laec;g:Lnet/minecraft/server/MinecraftServer;
intermediary field_14162
Lnet/minecraft/class_3248;field_14162:Lnet/minecraft/server/MinecraftServer;
named server
Lnet/minecraft/server/network/ServerLoginNetworkHandler;server:Lnet/minecraft/server/MinecraftServer;
-
connection
- Mappings:
Namespace Name Mixin selector official a
Laec;a:Lpl;
intermediary field_14158
Lnet/minecraft/class_3248;field_14158:Lnet/minecraft/class_2535;
named connection
Lnet/minecraft/server/network/ServerLoginNetworkHandler;connection:Lnet/minecraft/network/ClientConnection;
-
state
- Mappings:
Namespace Name Mixin selector official h
Laec;h:Laec$a;
intermediary field_14163
Lnet/minecraft/class_3248;field_14163:Lnet/minecraft/class_3248$class_3249;
named state
Lnet/minecraft/server/network/ServerLoginNetworkHandler;state:Lnet/minecraft/server/network/ServerLoginNetworkHandler$State;
-
loginTicks
private int loginTicks- Mappings:
Namespace Name Mixin selector official i
Laec;i:I
intermediary field_14156
Lnet/minecraft/class_3248;field_14156:I
named loginTicks
Lnet/minecraft/server/network/ServerLoginNetworkHandler;loginTicks:I
-
profile
- Mappings:
Namespace Name Mixin selector official j
Laec;j:Lcom/mojang/authlib/GameProfile;
intermediary field_14160
Lnet/minecraft/class_3248;field_14160:Lcom/mojang/authlib/GameProfile;
named profile
Lnet/minecraft/server/network/ServerLoginNetworkHandler;profile:Lcom/mojang/authlib/GameProfile;
-
serverId
- See Also:
- Mappings:
Namespace Name Mixin selector official k
Laec;k:Ljava/lang/String;
intermediary field_14165
Lnet/minecraft/class_3248;field_14165:Ljava/lang/String;
named serverId
Lnet/minecraft/server/network/ServerLoginNetworkHandler;serverId:Ljava/lang/String;
-
delayedPlayer
The delayed player, waiting to join the server once the existing player with the same UUID is gone.This will only be non-
null
if the state is delay-accept, and is reset tonull
once the player is accepted.- Mappings:
Namespace Name Mixin selector official l
Laec;l:Ladj;
intermediary field_14161
Lnet/minecraft/class_3248;field_14161:Lnet/minecraft/class_3222;
named delayedPlayer
Lnet/minecraft/server/network/ServerLoginNetworkHandler;delayedPlayer:Lnet/minecraft/server/network/ServerPlayerEntity;
-
-
Constructor Details
-
ServerLoginNetworkHandler
- Mappings:
Namespace Name Mixin selector official <init>
Laec;<init>(Lnet/minecraft/server/MinecraftServer;Lpl;)V
intermediary <init>
Lnet/minecraft/class_3248;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/class_2535;)V
named <init>
Lnet/minecraft/server/network/ServerLoginNetworkHandler;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/network/ClientConnection;)V
-
-
Method Details
-
tick
public void tick()Ticks this login network handler.This accepts the player to the server if ready. If the state is delay accept, it checks if the old player with the same UUID is gone and admits the player.
- API Note:
- This should only be called on the server thread.
- Mappings:
Namespace Name Mixin selector official b
Laec;b()V
intermediary method_18785
Lnet/minecraft/class_3248;method_18785()V
named tick
Lnet/minecraft/server/network/ServerLoginNetworkHandler;tick()V
-
getConnection
Returns the connection this packet listener intends to listen to.- Specified by:
getConnection
in interfacePacketListener
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lpq;a()Lpl;
intermediary method_2872
Lnet/minecraft/class_2547;method_2872()Lnet/minecraft/class_2535;
named getConnection
Lnet/minecraft/network/listener/PacketListener;getConnection()Lnet/minecraft/network/ClientConnection;
-
disconnect
- Mappings:
Namespace Name Mixin selector official b
Laec;b(Lpz;)V
intermediary method_14380
Lnet/minecraft/class_3248;method_14380(Lnet/minecraft/class_2561;)V
named disconnect
Lnet/minecraft/server/network/ServerLoginNetworkHandler;disconnect(Lnet/minecraft/text/Text;)V
-
acceptPlayer
public void acceptPlayer()Creates the player to be added to the server and adds it to the server.If a player with the same UUID is in the world, it will create the player and transition to the delay accept state.
- API Note:
- This method should only be called on the server thread.
- Mappings:
Namespace Name Mixin selector official c
Laec;c()V
intermediary method_14384
Lnet/minecraft/class_3248;method_14384()V
named acceptPlayer
Lnet/minecraft/server/network/ServerLoginNetworkHandler;acceptPlayer()V
-
addToServer
- Mappings:
Namespace Name Mixin selector official a
Laec;a(Ladj;)V
intermediary method_33800
Lnet/minecraft/class_3248;method_33800(Lnet/minecraft/class_3222;)V
named addToServer
Lnet/minecraft/server/network/ServerLoginNetworkHandler;addToServer(Lnet/minecraft/server/network/ServerPlayerEntity;)V
-
onDisconnected
Called when the connection this listener listens to has disconnected. Can be used to display the disconnection reason.- Specified by:
onDisconnected
in interfacePacketListener
- Parameters:
reason
- the reason of disconnection; may be a generic message- Mappings:
Namespace Name Mixin selector official a
Lpq;a(Lpz;)V
intermediary method_10839
Lnet/minecraft/class_2547;method_10839(Lnet/minecraft/class_2561;)V
named onDisconnected
Lnet/minecraft/network/listener/PacketListener;onDisconnected(Lnet/minecraft/text/Text;)V
-
getConnectionInfo
- Mappings:
Namespace Name Mixin selector official d
Laec;d()Ljava/lang/String;
intermediary method_14383
Lnet/minecraft/class_3248;method_14383()Ljava/lang/String;
named getConnectionInfo
Lnet/minecraft/server/network/ServerLoginNetworkHandler;getConnectionInfo()Ljava/lang/String;
-
onHello
- Specified by:
onHello
in interfaceServerLoginPacketListener
- Mappings:
Namespace Name Mixin selector official a
Lxb;a(Lxd;)V
intermediary method_12641
Lnet/minecraft/class_2911;method_12641(Lnet/minecraft/class_2915;)V
named onHello
Lnet/minecraft/network/listener/ServerLoginPacketListener;onHello(Lnet/minecraft/network/packet/c2s/login/LoginHelloC2SPacket;)V
-
onKey
- Specified by:
onKey
in interfaceServerLoginPacketListener
- Mappings:
Namespace Name Mixin selector official a
Lxb;a(Lxe;)V
intermediary method_12642
Lnet/minecraft/class_2911;method_12642(Lnet/minecraft/class_2917;)V
named onKey
Lnet/minecraft/network/listener/ServerLoginPacketListener;onKey(Lnet/minecraft/network/packet/c2s/login/LoginKeyC2SPacket;)V
-
onQueryResponse
- Specified by:
onQueryResponse
in interfaceServerLoginPacketListener
- Mappings:
Namespace Name Mixin selector official a
Lxb;a(Lxc;)V
intermediary method_12640
Lnet/minecraft/class_2911;method_12640(Lnet/minecraft/class_2913;)V
named onQueryResponse
Lnet/minecraft/network/listener/ServerLoginPacketListener;onQueryResponse(Lnet/minecraft/network/packet/c2s/login/LoginQueryResponseC2SPacket;)V
-
toOfflineProfile
protected com.mojang.authlib.GameProfile toOfflineProfile(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector official a
Laec;a(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
intermediary method_14375
Lnet/minecraft/class_3248;method_14375(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
named toOfflineProfile
Lnet/minecraft/server/network/ServerLoginNetworkHandler;toOfflineProfile(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
-