Package net.minecraft.server.network
Class ServerLoginNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerLoginNetworkHandler
- All Implemented Interfaces:
PacketListener
,ServerCrashSafePacketListener
,ServerLoginPacketListener
,ServerPacketListener
,TickablePacketListener
public class ServerLoginNetworkHandler
extends Object
implements ServerLoginPacketListener, TickablePacketListener
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 alr
intermediary net/minecraft/class_3248
named net/minecraft/server/network/ServerLoginNetworkHandler
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescription(package private) final ClientConnection
(package private) static final Logger
private int
private static final AtomicInteger
private final byte[]
private @Nullable com.mojang.authlib.GameProfile
(package private) @Nullable String
(package private) final MinecraftServer
private final String
private ServerLoginNetworkHandler.State
private static final int
private static final Text
-
Constructor Summary
ConstructorDescriptionServerLoginNetworkHandler
(MinecraftServer server, ClientConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionprotected static com.mojang.authlib.GameProfile
createOfflineProfile
(String name) void
disconnect
(Text reason) private boolean
hasPlayerWithId
(com.mojang.authlib.GameProfile profile) boolean
static boolean
isValidName
(String name) void
onDisconnected
(Text reason) Called when the connection this listener listens to has disconnected.void
void
onHello
(LoginHelloC2SPacket packet) void
onKey
(LoginKeyC2SPacket packet) void
private void
sendSuccessPacket
(com.mojang.authlib.GameProfile profile) (package private) void
startVerify
(com.mojang.authlib.GameProfile profile) void
tick()
Ticks this packet listener on the game engine thread.private void
tickVerify
(com.mojang.authlib.GameProfile profile) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.network.listener.PacketListener
accepts
Methods inherited from interface net.minecraft.network.listener.ServerCrashSafePacketListener
shouldCrashOnException
Methods inherited from interface net.minecraft.network.listener.ServerLoginPacketListener
getState
Methods inherited from interface net.minecraft.network.listener.ServerPacketListener
getSide
-
Field Details
-
NEXT_AUTHENTICATOR_THREAD_ID
- Mappings:
Namespace Name Mixin selector official a
Lalr;a: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 b
Lalr;b:Lorg/slf4j/Logger;
intermediary field_14166
Lnet/minecraft/class_3248;field_14166:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/server/network/ServerLoginNetworkHandler;LOGGER:Lorg/slf4j/Logger;
-
TIMEOUT_TICKS
private static final int TIMEOUT_TICKS- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lalr;c:I
intermediary field_29779
Lnet/minecraft/class_3248;field_29779:I
named TIMEOUT_TICKS
Lnet/minecraft/server/network/ServerLoginNetworkHandler;TIMEOUT_TICKS:I
-
UNEXPECTED_QUERY_RESPONSE_TEXT
- Mappings:
Namespace Name Mixin selector official d
Lalr;d:Ltl;
intermediary field_45027
Lnet/minecraft/class_3248;field_45027:Lnet/minecraft/class_2561;
named UNEXPECTED_QUERY_RESPONSE_TEXT
Lnet/minecraft/server/network/ServerLoginNetworkHandler;UNEXPECTED_QUERY_RESPONSE_TEXT:Lnet/minecraft/text/Text;
-
nonce
private final byte[] nonce- Mappings:
Namespace Name Mixin selector official e
Lalr;e:[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 f
Lalr;f: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 g
Lalr;g:Lsm;
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
Lalr;h:Lalr$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
Lalr;i:I
intermediary field_14156
Lnet/minecraft/class_3248;field_14156:I
named loginTicks
Lnet/minecraft/server/network/ServerLoginNetworkHandler;loginTicks:I
-
profileName
- Mappings:
Namespace Name Mixin selector official j
Lalr;j:Ljava/lang/String;
intermediary field_45028
Lnet/minecraft/class_3248;field_45028:Ljava/lang/String;
named profileName
Lnet/minecraft/server/network/ServerLoginNetworkHandler;profileName:Ljava/lang/String;
-
profile
@Nullable private @Nullable com.mojang.authlib.GameProfile profile- Mappings:
Namespace Name Mixin selector official k
Lalr;k:Lcom/mojang/authlib/GameProfile;
intermediary field_45029
Lnet/minecraft/class_3248;field_45029: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 l
Lalr;l: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;
-
-
Constructor Details
-
ServerLoginNetworkHandler
- Mappings:
Namespace Name Mixin selector official <init>
Lalr;<init>(Lnet/minecraft/server/MinecraftServer;Lsm;)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 packet listener on the game engine thread. The listener is responsible for synchronizing between the game engine and netty event loop threads.- Specified by:
tick
in interfaceTickablePacketListener
- Mappings:
Namespace Name Mixin selector official e
Lta;e()V
intermediary method_18784
Lnet/minecraft/class_7633;method_18784()V
named tick
Lnet/minecraft/network/listener/TickablePacketListener;tick()V
-
isConnectionOpen
public boolean isConnectionOpen()- Specified by:
isConnectionOpen
in interfacePacketListener
- Mappings:
Namespace Name Mixin selector official c
Lsu;c()Z
intermediary method_48106
Lnet/minecraft/class_2547;method_48106()Z
named isConnectionOpen
Lnet/minecraft/network/listener/PacketListener;isConnectionOpen()Z
-
disconnect
- Mappings:
Namespace Name Mixin selector official b
Lalr;b(Ltl;)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
-
hasPlayerWithId
private boolean hasPlayerWithId(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector official a
Lalr;a(Lcom/mojang/authlib/GameProfile;)Z
intermediary method_52416
Lnet/minecraft/class_3248;method_52416(Lcom/mojang/authlib/GameProfile;)Z
named hasPlayerWithId
Lnet/minecraft/server/network/ServerLoginNetworkHandler;hasPlayerWithId(Lcom/mojang/authlib/GameProfile;)Z
-
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
Lsu;a(Ltl;)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 f
Lalr;f()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
Ladk;a(Ladm;)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
-
startVerify
void startVerify(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector official b
Lalr;b(Lcom/mojang/authlib/GameProfile;)V
intermediary method_52417
Lnet/minecraft/class_3248;method_52417(Lcom/mojang/authlib/GameProfile;)V
named startVerify
Lnet/minecraft/server/network/ServerLoginNetworkHandler;startVerify(Lcom/mojang/authlib/GameProfile;)V
-
tickVerify
private void tickVerify(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector official c
Lalr;c(Lcom/mojang/authlib/GameProfile;)V
intermediary method_52419
Lnet/minecraft/class_3248;method_52419(Lcom/mojang/authlib/GameProfile;)V
named tickVerify
Lnet/minecraft/server/network/ServerLoginNetworkHandler;tickVerify(Lcom/mojang/authlib/GameProfile;)V
-
sendSuccessPacket
private void sendSuccessPacket(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector official d
Lalr;d(Lcom/mojang/authlib/GameProfile;)V
intermediary method_52420
Lnet/minecraft/class_3248;method_52420(Lcom/mojang/authlib/GameProfile;)V
named sendSuccessPacket
Lnet/minecraft/server/network/ServerLoginNetworkHandler;sendSuccessPacket(Lcom/mojang/authlib/GameProfile;)V
-
isValidName
- Mappings:
Namespace Name Mixin selector official a
Lalr;a(Ljava/lang/String;)Z
intermediary method_40085
Lnet/minecraft/class_3248;method_40085(Ljava/lang/String;)Z
named isValidName
Lnet/minecraft/server/network/ServerLoginNetworkHandler;isValidName(Ljava/lang/String;)Z
-
onKey
- Specified by:
onKey
in interfaceServerLoginPacketListener
- Mappings:
Namespace Name Mixin selector official a
Ladk;a(Ladn;)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
Ladk;a(Ladl;)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
-
onEnterConfiguration
- Specified by:
onEnterConfiguration
in interfaceServerLoginPacketListener
- Mappings:
Namespace Name Mixin selector official a
Ladk;a(Lado;)V
intermediary method_52289
Lnet/minecraft/class_2911;method_52289(Lnet/minecraft/class_8593;)V
named onEnterConfiguration
Lnet/minecraft/network/listener/ServerLoginPacketListener;onEnterConfiguration(Lnet/minecraft/network/packet/c2s/login/EnterConfigurationC2SPacket;)V
-
createOfflineProfile
- Mappings:
Namespace Name Mixin selector official b
Lalr;b(Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;
intermediary method_52418
Lnet/minecraft/class_3248;method_52418(Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;
named createOfflineProfile
Lnet/minecraft/server/network/ServerLoginNetworkHandler;createOfflineProfile(Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;
-