Package net.minecraft.server.network
Class ServerLoginNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerLoginNetworkHandler
- All Implemented Interfaces:
PacketListener,ServerCookieResponsePacketListener,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 named net/minecraft/server/network/ServerLoginNetworkHandlerintermediary net/minecraft/class_3248official arw
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ClientConnection(package private) static final Loggerprivate intprivate static final AtomicIntegerprivate final byte[]private @Nullable com.mojang.authlib.GameProfile(package private) final MinecraftServerprivate final Stringprivate ServerLoginNetworkHandler.Stateprivate static final intprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionServerLoginNetworkHandler(MinecraftServer server, ClientConnection connection, boolean transferred) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomCrashReportInfo(CrashReport report, CrashReportSection section) voiddisconnect(Text reason) private booleanhasPlayerWithId(com.mojang.authlib.GameProfile profile) booleanvoidvoidCalled when the connection this listener listens to has disconnected.voidvoidonHello(LoginHelloC2SPacket packet) voidonKey(LoginKeyC2SPacket packet) voidprivate voidsendSuccessPacket(com.mojang.authlib.GameProfile profile) (package private) voidstartVerify(com.mojang.authlib.GameProfile profile) voidtick()Ticks this packet listener on the game engine thread.private voidtickVerify(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.PacketListener
accepts, createDisconnectionInfo, fillCrashReportMethods inherited from interface net.minecraft.network.listener.ServerCrashSafePacketListener
onPacketExceptionMethods inherited from interface net.minecraft.network.listener.ServerLoginPacketListener
getPhaseMethods inherited from interface net.minecraft.network.listener.ServerPacketListener
getSide
-
Field Details
-
NEXT_AUTHENTICATOR_THREAD_ID
- Mappings:
Namespace Name Mixin selector named NEXT_AUTHENTICATOR_THREAD_IDLnet/minecraft/server/network/ServerLoginNetworkHandler;NEXT_AUTHENTICATOR_THREAD_ID:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_14157Lnet/minecraft/class_3248;field_14157:Ljava/util/concurrent/atomic/AtomicInteger;official bLarw;b:Ljava/util/concurrent/atomic/AtomicInteger;
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/server/network/ServerLoginNetworkHandler;LOGGER:Lorg/slf4j/Logger;intermediary field_14166Lnet/minecraft/class_3248;field_14166:Lorg/slf4j/Logger;official cLarw;c:Lorg/slf4j/Logger;
-
TIMEOUT_TICKS
private static final int TIMEOUT_TICKS- See Also:
- Mappings:
Namespace Name Mixin selector named TIMEOUT_TICKSLnet/minecraft/server/network/ServerLoginNetworkHandler;TIMEOUT_TICKS:Iintermediary field_29779Lnet/minecraft/class_3248;field_29779:Iofficial dLarw;d:I
-
nonce
private final byte[] nonce- Mappings:
Namespace Name Mixin selector named nonceLnet/minecraft/server/network/ServerLoginNetworkHandler;nonce:[Bintermediary field_14167Lnet/minecraft/class_3248;field_14167:[Bofficial eLarw;e:[B
-
server
- Mappings:
Namespace Name Mixin selector named serverLnet/minecraft/server/network/ServerLoginNetworkHandler;server:Lnet/minecraft/server/MinecraftServer;intermediary field_14162Lnet/minecraft/class_3248;field_14162:Lnet/minecraft/server/MinecraftServer;official fLarw;f:Lnet/minecraft/server/MinecraftServer;
-
connection
- Mappings:
Namespace Name Mixin selector named connectionLnet/minecraft/server/network/ServerLoginNetworkHandler;connection:Lnet/minecraft/network/ClientConnection;intermediary field_14158Lnet/minecraft/class_3248;field_14158:Lnet/minecraft/class_2535;official gLarw;g:Lvt;
-
state
- Mappings:
Namespace Name Mixin selector named stateLnet/minecraft/server/network/ServerLoginNetworkHandler;state:Lnet/minecraft/server/network/ServerLoginNetworkHandler$State;intermediary field_14163Lnet/minecraft/class_3248;field_14163:Lnet/minecraft/class_3248$class_3249;official hLarw;h:Larw$a;
-
loginTicks
private int loginTicks- Mappings:
Namespace Name Mixin selector named loginTicksLnet/minecraft/server/network/ServerLoginNetworkHandler;loginTicks:Iintermediary field_14156Lnet/minecraft/class_3248;field_14156:Iofficial iLarw;i:I
-
profileName
- Mappings:
Namespace Name Mixin selector named profileNameLnet/minecraft/server/network/ServerLoginNetworkHandler;profileName:Ljava/lang/String;intermediary field_45028Lnet/minecraft/class_3248;field_45028:Ljava/lang/String;official jLarw;j:Ljava/lang/String;
-
profile
- Mappings:
Namespace Name Mixin selector named profileLnet/minecraft/server/network/ServerLoginNetworkHandler;profile:Lcom/mojang/authlib/GameProfile;intermediary field_45029Lnet/minecraft/class_3248;field_45029:Lcom/mojang/authlib/GameProfile;official kLarw;k:Lcom/mojang/authlib/GameProfile;
-
serverId
- See Also:
- Mappings:
Namespace Name Mixin selector named serverIdLnet/minecraft/server/network/ServerLoginNetworkHandler;serverId:Ljava/lang/String;intermediary field_14165Lnet/minecraft/class_3248;field_14165:Ljava/lang/String;official lLarw;l:Ljava/lang/String;
-
transferred
private final boolean transferred- Mappings:
Namespace Name Mixin selector named transferredLnet/minecraft/server/network/ServerLoginNetworkHandler;transferred:Zintermediary field_48275Lnet/minecraft/class_3248;field_48275:Zofficial mLarw;m:Z
-
-
Constructor Details
-
ServerLoginNetworkHandler
public ServerLoginNetworkHandler(MinecraftServer server, ClientConnection connection, boolean transferred) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/server/network/ServerLoginNetworkHandler;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/network/ClientConnection;Z)Vintermediary <init>Lnet/minecraft/class_3248;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/class_2535;Z)Vofficial <init>Larw;<init>(Lnet/minecraft/server/MinecraftServer;Lvt;Z)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:
tickin interfaceTickablePacketListener- Mappings:
Namespace Name Mixin selector named tickLnet/minecraft/network/listener/TickablePacketListener;tick()Vintermediary method_18784Lnet/minecraft/class_7633;method_18784()Vofficial dLwn;d()V
-
isConnectionOpen
public boolean isConnectionOpen()- Specified by:
isConnectionOpenin interfacePacketListener- Mappings:
Namespace Name Mixin selector named isConnectionOpenLnet/minecraft/network/listener/PacketListener;isConnectionOpen()Zintermediary method_48106Lnet/minecraft/class_2547;method_48106()Zofficial cLwf;c()Z
-
disconnect
- Mappings:
Namespace Name Mixin selector named disconnectLnet/minecraft/server/network/ServerLoginNetworkHandler;disconnect(Lnet/minecraft/text/Text;)Vintermediary method_14380Lnet/minecraft/class_3248;method_14380(Lnet/minecraft/class_2561;)Vofficial aLarw;a(Lwz;)V
-
hasPlayerWithId
private boolean hasPlayerWithId(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector named hasPlayerWithIdLnet/minecraft/server/network/ServerLoginNetworkHandler;hasPlayerWithId(Lcom/mojang/authlib/GameProfile;)Zintermediary method_52416Lnet/minecraft/class_3248;method_52416(Lcom/mojang/authlib/GameProfile;)Zofficial aLarw;a(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:
onDisconnectedin interfacePacketListener- Mappings:
Namespace Name Mixin selector named onDisconnectedLnet/minecraft/network/listener/PacketListener;onDisconnected(Lnet/minecraft/network/DisconnectionInfo;)Vintermediary method_10839Lnet/minecraft/class_2547;method_10839(Lnet/minecraft/class_9812;)Vofficial aLwf;a(Lvv;)V
-
getConnectionInfo
- Mappings:
Namespace Name Mixin selector named getConnectionInfoLnet/minecraft/server/network/ServerLoginNetworkHandler;getConnectionInfo()Ljava/lang/String;intermediary method_14383Lnet/minecraft/class_3248;method_14383()Ljava/lang/String;official eLarw;e()Ljava/lang/String;
-
onHello
- Specified by:
onHelloin interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector named onHelloLnet/minecraft/network/listener/ServerLoginPacketListener;onHello(Lnet/minecraft/network/packet/c2s/login/LoginHelloC2SPacket;)Vintermediary method_12641Lnet/minecraft/class_2911;method_12641(Lnet/minecraft/class_2915;)Vofficial aLaiw;a(Laiy;)V
-
startVerify
void startVerify(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector named startVerifyLnet/minecraft/server/network/ServerLoginNetworkHandler;startVerify(Lcom/mojang/authlib/GameProfile;)Vintermediary method_52417Lnet/minecraft/class_3248;method_52417(Lcom/mojang/authlib/GameProfile;)Vofficial bLarw;b(Lcom/mojang/authlib/GameProfile;)V
-
tickVerify
private void tickVerify(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector named tickVerifyLnet/minecraft/server/network/ServerLoginNetworkHandler;tickVerify(Lcom/mojang/authlib/GameProfile;)Vintermediary method_52419Lnet/minecraft/class_3248;method_52419(Lcom/mojang/authlib/GameProfile;)Vofficial cLarw;c(Lcom/mojang/authlib/GameProfile;)V
-
sendSuccessPacket
private void sendSuccessPacket(com.mojang.authlib.GameProfile profile) - Mappings:
Namespace Name Mixin selector named sendSuccessPacketLnet/minecraft/server/network/ServerLoginNetworkHandler;sendSuccessPacket(Lcom/mojang/authlib/GameProfile;)Vintermediary method_52420Lnet/minecraft/class_3248;method_52420(Lcom/mojang/authlib/GameProfile;)Vofficial dLarw;d(Lcom/mojang/authlib/GameProfile;)V
-
onKey
- Specified by:
onKeyin interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector named onKeyLnet/minecraft/network/listener/ServerLoginPacketListener;onKey(Lnet/minecraft/network/packet/c2s/login/LoginKeyC2SPacket;)Vintermediary method_12642Lnet/minecraft/class_2911;method_12642(Lnet/minecraft/class_2917;)Vofficial aLaiw;a(Laiz;)V
-
onQueryResponse
- Specified by:
onQueryResponsein interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector named onQueryResponseLnet/minecraft/network/listener/ServerLoginPacketListener;onQueryResponse(Lnet/minecraft/network/packet/c2s/login/LoginQueryResponseC2SPacket;)Vintermediary method_12640Lnet/minecraft/class_2911;method_12640(Lnet/minecraft/class_2913;)Vofficial aLaiw;a(Laix;)V
-
onEnterConfiguration
- Specified by:
onEnterConfigurationin interfaceServerLoginPacketListener- Mappings:
Namespace Name Mixin selector named onEnterConfigurationLnet/minecraft/network/listener/ServerLoginPacketListener;onEnterConfiguration(Lnet/minecraft/network/packet/c2s/login/EnterConfigurationC2SPacket;)Vintermediary method_52289Lnet/minecraft/class_2911;method_52289(Lnet/minecraft/class_8593;)Vofficial aLaiw;a(Laja;)V
-
addCustomCrashReportInfo
- Specified by:
addCustomCrashReportInfoin interfacePacketListener- Mappings:
Namespace Name Mixin selector named addCustomCrashReportInfoLnet/minecraft/network/listener/PacketListener;addCustomCrashReportInfo(Lnet/minecraft/util/crash/CrashReport;Lnet/minecraft/util/crash/CrashReportSection;)Vintermediary method_55597Lnet/minecraft/class_2547;method_55597(Lnet/minecraft/class_128;Lnet/minecraft/class_129;)Vofficial aLwf;a(Lo;Lp;)V
-
onCookieResponse
- Specified by:
onCookieResponsein interfaceServerCookieResponsePacketListener- Mappings:
Namespace Name Mixin selector named onCookieResponseLnet/minecraft/network/listener/ServerCookieResponsePacketListener;onCookieResponse(Lnet/minecraft/network/packet/c2s/common/CookieResponseC2SPacket;)Vintermediary method_55851Lnet/minecraft/class_9090;method_55851(Lnet/minecraft/class_9091;)Vofficial aLabr;a(Labs;)V
-