类 ServerLoginNetworkHandler
- java.lang.Object
-
- net.minecraft.server.network.ServerLoginNetworkHandler
-
- 所有已实现的接口:
PacketListener,ServerLoginPacketListener
public class ServerLoginNetworkHandler extends Object implements 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's in online mode, it goes through an additional authentication process. Then it optionally sends a network compression packet next. 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 server play network handler.
- Mappings:
Namespace Name official acdintermediary net/minecraft/class_3248named net/minecraft/server/network/ServerLoginNetworkHandler
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 (专用程序包) static classServerLoginNetworkHandler.State
-
字段概要
字段 修饰符和类型 字段 说明 ClientConnectionconnectionprivate @Nullable ServerPlayerEntitydelayedPlayerThe delayed player, waiting to join the server once the existing player with the same UUID is gone.private static intfield_29779private static LoggerLOGGERprivate intloginTicksprivate static AtomicIntegerNEXT_AUTHENTICATOR_THREAD_IDprivate byte[]nonceprivate @Nullable com.mojang.authlib.GameProfileprofileprivate static RandomRANDOMprivate MinecraftServerserverprivate StringserverIdprivate ServerLoginNetworkHandler.Statestate
-
构造器概要
构造器 构造器 说明 ServerLoginNetworkHandler(MinecraftServer server, ClientConnection connection)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidacceptPlayer()Creates the player to be added to the server and adds it to the server.private voidaddToServer(ServerPlayerEntity player)voiddisconnect(Text reason)ClientConnectiongetConnection()Returns the connection this packet listener intends to listen to.StringgetConnectionInfo()voidonDisconnected(Text reason)Called when the connection this listener listens to has disconnected.voidonHello(LoginHelloC2SPacket packet)voidonKey(LoginKeyC2SPacket packet)voidonQueryResponse(LoginQueryResponseC2SPacket packet)voidtick()Ticks this login network handler.protected com.mojang.authlib.GameProfiletoOfflineProfile(com.mojang.authlib.GameProfile profile)
-
-
-
字段详细资料
-
NEXT_AUTHENTICATOR_THREAD_ID
private static final AtomicInteger NEXT_AUTHENTICATOR_THREAD_ID
- Mappings:
Namespace Name Mixin selector official bLacd;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
private static final Logger LOGGER
- Mappings:
Namespace Name Mixin selector official cLacd;c:Lorg/apache/logging/log4j/Logger;intermediary field_14166Lnet/minecraft/class_3248;field_14166:Lorg/apache/logging/log4j/Logger;named LOGGERLnet/minecraft/server/network/ServerLoginNetworkHandler;LOGGER:Lorg/apache/logging/log4j/Logger;
-
field_29779
private static final int field_29779
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official dLacd;d:Iintermediary field_29779Lnet/minecraft/class_3248;field_29779:Inamed field_29779Lnet/minecraft/server/network/ServerLoginNetworkHandler;field_29779:I
-
RANDOM
private static final Random RANDOM
- Mappings:
Namespace Name Mixin selector official eLacd;e:Ljava/util/Random;intermediary field_14164Lnet/minecraft/class_3248;field_14164:Ljava/util/Random;named RANDOMLnet/minecraft/server/network/ServerLoginNetworkHandler;RANDOM:Ljava/util/Random;
-
nonce
private final byte[] nonce
- Mappings:
Namespace Name Mixin selector official fLacd;f:[Bintermediary field_14167Lnet/minecraft/class_3248;field_14167:[Bnamed nonceLnet/minecraft/server/network/ServerLoginNetworkHandler;nonce:[B
-
server
private final MinecraftServer server
- Mappings:
Namespace Name Mixin selector official gLacd;g: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
public final ClientConnection connection
- Mappings:
Namespace Name Mixin selector official aLacd;a:Lnz;intermediary field_14158Lnet/minecraft/class_3248;field_14158:Lnet/minecraft/class_2535;named connectionLnet/minecraft/server/network/ServerLoginNetworkHandler;connection:Lnet/minecraft/network/ClientConnection;
-
state
private ServerLoginNetworkHandler.State state
- Mappings:
Namespace Name Mixin selector official hLacd;h:Lacd$a;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 iLacd;i:Iintermediary field_14156Lnet/minecraft/class_3248;field_14156:Inamed loginTicksLnet/minecraft/server/network/ServerLoginNetworkHandler;loginTicks:I
-
profile
@Nullable private @Nullable com.mojang.authlib.GameProfile profile
- Mappings:
Namespace Name Mixin selector official jLacd;j: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
private final String serverId
- 另请参阅:
- 常量字段值
- Mappings:
Namespace Name Mixin selector official kLacd;k: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
@Nullable private @Nullable ServerPlayerEntity 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 lLacd;l:Labk;intermediary field_14161Lnet/minecraft/class_3248;field_14161:Lnet/minecraft/class_3222;named delayedPlayerLnet/minecraft/server/network/ServerLoginNetworkHandler;delayedPlayer:Lnet/minecraft/server/network/ServerPlayerEntity;
-
-
构造器详细资料
-
ServerLoginNetworkHandler
public ServerLoginNetworkHandler(MinecraftServer server, ClientConnection connection)
- Mappings:
Namespace Name Mixin selector official <init>Lacd;<init>(Lnet/minecraft/server/MinecraftServer;Lnz;)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
-
-
方法详细资料
-
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 bLacd;b()Vintermediary method_18785Lnet/minecraft/class_3248;method_18785()Vnamed tickLnet/minecraft/server/network/ServerLoginNetworkHandler;tick()V
-
getConnection
public ClientConnection getConnection()
Returns the connection this packet listener intends to listen to.- 指定者:
getConnection在接口中PacketListener- 另请参阅:
ClientConnection.getPacketListener()- Mappings:
Namespace Name Mixin selector official aLoe;a()Lnz;intermediary method_2872Lnet/minecraft/class_2547;method_2872()Lnet/minecraft/class_2535;named getConnectionLnet/minecraft/network/listener/PacketListener;getConnection()Lnet/minecraft/network/ClientConnection;
-
disconnect
public void disconnect(Text reason)
- Mappings:
Namespace Name Mixin selector official bLacd;b(Lon;)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 cLacd;c()Vintermediary method_14384Lnet/minecraft/class_3248;method_14384()Vnamed acceptPlayerLnet/minecraft/server/network/ServerLoginNetworkHandler;acceptPlayer()V
-
addToServer
private void addToServer(ServerPlayerEntity player)
- Mappings:
Namespace Name Mixin selector official aLacd;a(Labk;)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
public void onDisconnected(Text reason)
Called when the connection this listener listens to has disconnected. Can be used to display the disconnection reason.- 指定者:
onDisconnected在接口中PacketListener- 参数:
reason- the reason of disconnection; may be a generic message- Mappings:
Namespace Name Mixin selector official aLoe;a(Lon;)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
public String getConnectionInfo()
- Mappings:
Namespace Name Mixin selector official dLacd;d()Ljava/lang/String;intermediary method_14383Lnet/minecraft/class_3248;method_14383()Ljava/lang/String;named getConnectionInfoLnet/minecraft/server/network/ServerLoginNetworkHandler;getConnectionInfo()Ljava/lang/String;
-
onHello
public void onHello(LoginHelloC2SPacket packet)
- 指定者:
onHello在接口中ServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLvk;a(Lvm;)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
-
onKey
public void onKey(LoginKeyC2SPacket packet)
- 指定者:
onKey在接口中ServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLvk;a(Lvn;)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
public void onQueryResponse(LoginQueryResponseC2SPacket packet)
- 指定者:
onQueryResponse在接口中ServerLoginPacketListener- Mappings:
Namespace Name Mixin selector official aLvk;a(Lvl;)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 aLacd;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;
-
-