Package net.minecraft.server.network
Class ServerLoginNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerLoginNetworkHandler
- All Implemented Interfaces:
PacketListener,ServerLoginPacketListener,ServerPacketListener
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 afnintermediary net/minecraft/class_3248named net/minecraft/server/network/ServerLoginNetworkHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ClientConnectionprivate @Nullable ServerPlayerEntityThe delayed player, waiting to join the server once the existing player with the same UUID is gone.private static final Textprivate static final Textprivate static final Textprivate PlayerPublicKey.class_7429(package private) static final org.slf4j.Loggerprivate intprivate static final AtomicIntegerprivate final byte[](package private) @Nullable com.mojang.authlib.GameProfileprivate static final AbstractRandom(package private) final MinecraftServerprivate final String(package private) ServerLoginNetworkHandler.Stateprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionServerLoginNetworkHandler(MinecraftServer server, ClientConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates the player to be added to the server and adds it to the server.private voidaddToServer(ServerPlayerEntity player) voiddisconnect(Text reason) Returns the connection this packet listener intends to listen to.static booleanisValidName(String name) private static PlayerPublicKey.class_7429method_43510(LoginHelloC2SPacket loginHelloC2SPacket, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, boolean bool) voidonDisconnected(Text reason) Called when the connection this listener listens to has disconnected.voidonHello(LoginHelloC2SPacket packet) voidonKey(LoginKeyC2SPacket packet) voidvoidtick()Ticks this login network handler.protected com.mojang.authlib.GameProfiletoOfflineProfile(com.mojang.authlib.GameProfile profile) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.listener.ServerPacketListener
shouldCrashOnException
-
Field Details
-
NEXT_AUTHENTICATOR_THREAD_ID
- Mappings:
Namespace Name Mixin selector official bLafn;b:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_14157Lnet/minecraft/class_3248;field_14157:Ljava/util/concurrent/atomic/AtomicInteger;named NEXT_AUTHENTICATOR_THREAD_IDLnet/minecraft/server/network/ServerLoginNetworkHandler;NEXT_AUTHENTICATOR_THREAD_ID:Ljava/util/concurrent/atomic/AtomicInteger;
-
LOGGER
static final org.slf4j.Logger LOGGER- Mappings:
Namespace Name Mixin selector official cLafn;c:Lorg/slf4j/Logger;intermediary field_14166Lnet/minecraft/class_3248;field_14166:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/server/network/ServerLoginNetworkHandler;LOGGER:Lorg/slf4j/Logger;
-
TIMEOUT_TICKS
private static final int TIMEOUT_TICKS- See Also:
- Mappings:
Namespace Name Mixin selector official dLafn;d:Iintermediary field_29779Lnet/minecraft/class_3248;field_29779:Inamed TIMEOUT_TICKSLnet/minecraft/server/network/ServerLoginNetworkHandler;TIMEOUT_TICKS:I
-
RANDOM
- Mappings:
Namespace Name Mixin selector official eLafn;e:Lakt;intermediary field_14164Lnet/minecraft/class_3248;field_14164:Lnet/minecraft/class_5819;named RANDOMLnet/minecraft/server/network/ServerLoginNetworkHandler;RANDOM:Lnet/minecraft/util/math/random/AbstractRandom;
-
field_39020
- Mappings:
Namespace Name Mixin selector official fLafn;f:Lqz;intermediary field_39020Lnet/minecraft/class_3248;field_39020:Lnet/minecraft/class_2561;named field_39020Lnet/minecraft/server/network/ServerLoginNetworkHandler;field_39020:Lnet/minecraft/text/Text;
-
field_39021
- Mappings:
Namespace Name Mixin selector official gLafn;g:Lqz;intermediary field_39021Lnet/minecraft/class_3248;field_39021:Lnet/minecraft/class_2561;named field_39021Lnet/minecraft/server/network/ServerLoginNetworkHandler;field_39021:Lnet/minecraft/text/Text;
-
field_39022
- Mappings:
Namespace Name Mixin selector official hLafn;h:Lqz;intermediary field_39022Lnet/minecraft/class_3248;field_39022:Lnet/minecraft/class_2561;named field_39022Lnet/minecraft/server/network/ServerLoginNetworkHandler;field_39022:Lnet/minecraft/text/Text;
-
nonce
private final byte[] nonce- Mappings:
Namespace Name Mixin selector official iLafn;i:[Bintermediary field_14167Lnet/minecraft/class_3248;field_14167:[Bnamed nonceLnet/minecraft/server/network/ServerLoginNetworkHandler;nonce:[B
-
server
- Mappings:
Namespace Name Mixin selector official jLafn;j:Lnet/minecraft/server/MinecraftServer;intermediary field_14162Lnet/minecraft/class_3248;field_14162:Lnet/minecraft/server/MinecraftServer;named serverLnet/minecraft/server/network/ServerLoginNetworkHandler;server:Lnet/minecraft/server/MinecraftServer;
-
connection
- Mappings:
Namespace Name Mixin selector official aLafn;a:Lql;intermediary field_14158Lnet/minecraft/class_3248;field_14158:Lnet/minecraft/class_2535;named connectionLnet/minecraft/server/network/ServerLoginNetworkHandler;connection:Lnet/minecraft/network/ClientConnection;
-
state
- Mappings:
Namespace Name Mixin selector official kLafn;k:Lafn$b;intermediary field_14163Lnet/minecraft/class_3248;field_14163:Lnet/minecraft/class_3248$class_3249;named stateLnet/minecraft/server/network/ServerLoginNetworkHandler;state:Lnet/minecraft/server/network/ServerLoginNetworkHandler$State;
-
loginTicks
private int loginTicks- Mappings:
Namespace Name Mixin selector official lLafn;l:Iintermediary field_14156Lnet/minecraft/class_3248;field_14156:Inamed loginTicksLnet/minecraft/server/network/ServerLoginNetworkHandler;loginTicks:I
-
profile
- Mappings:
Namespace Name Mixin selector official mLafn;m:Lcom/mojang/authlib/GameProfile;intermediary field_14160Lnet/minecraft/class_3248;field_14160:Lcom/mojang/authlib/GameProfile;named profileLnet/minecraft/server/network/ServerLoginNetworkHandler;profile:Lcom/mojang/authlib/GameProfile;
-
serverId
- See Also:
- Mappings:
Namespace Name Mixin selector official nLafn;n:Ljava/lang/String;intermediary field_14165Lnet/minecraft/class_3248;field_14165:Ljava/lang/String;named serverIdLnet/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-
nullif the state is delay-accept, and is reset tonullonce the player is accepted.- Mappings:
Namespace Name Mixin selector official oLafn;o:Laeu;intermediary field_14161Lnet/minecraft/class_3248;field_14161:Lnet/minecraft/class_3222;named delayedPlayerLnet/minecraft/server/network/ServerLoginNetworkHandler;delayedPlayer:Lnet/minecraft/server/network/ServerPlayerEntity;
-
field_39023
- Mappings:
Namespace Name Mixin selector official pLafn;p:Lbrv$a;intermediary field_39023Lnet/minecraft/class_3248;field_39023:Lnet/minecraft/class_7428$class_7429;named field_39023Lnet/minecraft/server/network/ServerLoginNetworkHandler;field_39023:Lnet/minecraft/network/encryption/PlayerPublicKey$class_7429;
-
-
Constructor Details
-
ServerLoginNetworkHandler
- Mappings:
Namespace Name Mixin selector official <init>Lafn;<init>(Lnet/minecraft/server/MinecraftServer;Lql;)Vintermediary <init>Lnet/minecraft/class_3248;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/class_2535;)Vnamed <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 cLafn;c()Vintermediary method_18785Lnet/minecraft/class_3248;method_18785()Vnamed tickLnet/minecraft/server/network/ServerLoginNetworkHandler;tick()V
-
getConnection
Returns the connection this packet listener intends to listen to.- Specified by:
getConnectionin interfacePacketListener- See Also:
- Mappings:
Namespace Name Mixin selector official aLqq;a()Lql;intermediary method_2872Lnet/minecraft/class_2547;method_2872()Lnet/minecraft/class_2535;named getConnectionLnet/minecraft/network/listener/PacketListener;getConnection()Lnet/minecraft/network/ClientConnection;
-
disconnect
- Mappings:
Namespace Name Mixin selector official bLafn;b(Lqz;)Vintermediary method_14380Lnet/minecraft/class_3248;method_14380(Lnet/minecraft/class_2561;)Vnamed disconnectLnet/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 dLafn;d()Vintermediary method_14384Lnet/minecraft/class_3248;method_14384()Vnamed acceptPlayerLnet/minecraft/server/network/ServerLoginNetworkHandler;acceptPlayer()V
-
addToServer
- Mappings:
Namespace Name Mixin selector official aLafn;a(Laeu;)Vintermediary method_33800Lnet/minecraft/class_3248;method_33800(Lnet/minecraft/class_3222;)Vnamed addToServerLnet/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:
onDisconnectedin interfacePacketListener- Parameters:
reason- the reason of disconnection; may be a generic message- Mappings:
Namespace Name Mixin selector official aLqq;a(Lqz;)Vintermediary method_10839Lnet/minecraft/class_2547;method_10839(Lnet/minecraft/class_2561;)Vnamed onDisconnectedLnet/minecraft/network/listener/PacketListener;onDisconnected(Lnet/minecraft/text/Text;)V
-
getConnectionInfo
- Mappings:
Namespace Name Mixin selector official eLafn;e()Ljava/lang/String;intermediary method_14383Lnet/minecraft/class_3248;method_14383()Ljava/lang/String;named getConnectionInfoLnet/minecraft/server/network/ServerLoginNetworkHandler;getConnectionInfo()Ljava/lang/String;
-
method_43510
@Nullable private static PlayerPublicKey.class_7429 method_43510(LoginHelloC2SPacket loginHelloC2SPacket, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, boolean bool) throws ServerLoginNetworkHandler.class_7423 - Throws:
ServerLoginNetworkHandler.class_7423- Mappings:
Namespace Name Mixin selector official aLafn;a(Lyk;Lcom/mojang/authlib/minecraft/MinecraftSessionService;Z)Lbrv$a;intermediary method_43510Lnet/minecraft/class_3248;method_43510(Lnet/minecraft/class_2915;Lcom/mojang/authlib/minecraft/MinecraftSessionService;Z)Lnet/minecraft/class_7428$class_7429;named method_43510Lnet/minecraft/server/network/ServerLoginNetworkHandler;method_43510(Lnet/minecraft/network/packet/c2s/login/LoginHelloC2SPacket;Lcom/mojang/authlib/minecraft/MinecraftSessionService;Z)Lnet/minecraft/network/encryption/PlayerPublicKey$class_7429;
-
onHello
- Specified by:
onHelloin interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLyi;a(Lyk;)Vintermediary method_12641Lnet/minecraft/class_2911;method_12641(Lnet/minecraft/class_2915;)Vnamed onHelloLnet/minecraft/network/listener/ServerLoginPacketListener;onHello(Lnet/minecraft/network/packet/c2s/login/LoginHelloC2SPacket;)V
-
isValidName
- Mappings:
Namespace Name Mixin selector official aLafn;a(Ljava/lang/String;)Zintermediary method_40085Lnet/minecraft/class_3248;method_40085(Ljava/lang/String;)Znamed isValidNameLnet/minecraft/server/network/ServerLoginNetworkHandler;isValidName(Ljava/lang/String;)Z
-
onKey
- Specified by:
onKeyin interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLyi;a(Lyl;)Vintermediary method_12642Lnet/minecraft/class_2911;method_12642(Lnet/minecraft/class_2917;)Vnamed onKeyLnet/minecraft/network/listener/ServerLoginPacketListener;onKey(Lnet/minecraft/network/packet/c2s/login/LoginKeyC2SPacket;)V
-
onQueryResponse
- Specified by:
onQueryResponsein interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLyi;a(Lyj;)Vintermediary method_12640Lnet/minecraft/class_2911;method_12640(Lnet/minecraft/class_2913;)Vnamed onQueryResponseLnet/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 aLafn;a(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;intermediary method_14375Lnet/minecraft/class_3248;method_14375(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;named toOfflineProfileLnet/minecraft/server/network/ServerLoginNetworkHandler;toOfflineProfile(Lcom/mojang/authlib/GameProfile;)Lcom/mojang/authlib/GameProfile;
-