类 ServerCommonPacketListenerImpl
java.lang.Object
net.minecraft.server.network.ServerCommonPacketListenerImpl
- 所有已实现的接口:
PacketListener
,ServerCommonPacketListener
,ServerCookiePacketListener
,ServerPacketListener
,ServerboundPacketListener
,ICommonPacketListener
,IServerCommonPacketListenerExtension
public abstract class ServerCommonPacketListenerImpl
extends Object
implements ServerCommonPacketListener
-
字段概要
字段修饰符和类型字段说明private boolean
private static final int
private long
protected final Connection
protected ConnectionType
Holds the current connection type, based on the types of payloads that have been received so far.(专用程序包) static final Component
private long
private boolean
private long
private int
static final int
private static final org.slf4j.Logger
protected final MinecraftServer
private boolean
private static final Component
private final boolean
-
构造器概要
构造器构造器说明ServerCommonPacketListenerImpl
(MinecraftServer p_295057_, Connection p_294822_, CommonListenerCookie p_301980_) -
方法概要
修饰符和类型方法说明private boolean
checkIfClosed
(long p_339648_) private void
close()
protected CommonListenerCookie
createCookie
(ClientInformation p_301973_) 已过时。protected CommonListenerCookie
createCookie
(ClientInformation p_301973_, ConnectionType connectionType) Creates a new cookie for this connection.void
disconnect
(Component p_294116_) Triggers a disconnection with the given reason.void
disconnect
(DisconnectionDetails p_350316_) 返回 the connection this listener is attached to。返回 the connection type of this packet listener。返回 the main thread event loop。com.mojang.authlib.GameProfile
getOwner()
void
void
void
void
handleKeepAlive
(ServerboundKeepAlivePacket p_294627_) void
handlePong
(ServerboundPongPacket p_295142_) void
protected boolean
protected void
int
latency()
void
onDisconnect
(DisconnectionDetails p_350605_) void
onPacketError
(Packet p_365354_, Exception p_363385_) protected abstract com.mojang.authlib.GameProfile
void
void
Sends a packet to the target of this listener.void
Sends a packet to the client of this listener.void
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.neoforge.common.extensions.ICommonPacketListener
hasChannel, hasChannel, hasChannel
从接口继承的方法 net.neoforged.neoforge.common.extensions.IServerCommonPacketListenerExtension
send, send
从接口继承的方法 net.minecraft.network.PacketListener
createDisconnectionInfo, fillCrashReport, fillListenerSpecificCrashDetails, isAcceptingMessages, protocol, shouldHandleMessage
从接口继承的方法 net.minecraft.network.ServerboundPacketListener
flow
从接口继承的方法 net.minecraft.network.protocol.common.ServerCommonPacketListener
handleClientInformation
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER -
LATENCY_CHECK_INTERVAL
public static final int LATENCY_CHECK_INTERVAL- 另请参阅:
-
CLOSED_LISTENER_TIMEOUT
private static final int CLOSED_LISTENER_TIMEOUT- 另请参阅:
-
TIMEOUT_DISCONNECTION_MESSAGE
-
DISCONNECT_UNEXPECTED_QUERY
-
server
-
connection
-
transferred
private final boolean transferred -
keepAliveTime
private long keepAliveTime -
keepAlivePending
private boolean keepAlivePending -
keepAliveChallenge
private long keepAliveChallenge -
closedListenerTime
private long closedListenerTime -
closed
private boolean closed -
latency
private int latency -
suspendFlushingOnServerThread
private volatile boolean suspendFlushingOnServerThread -
connectionType
Holds the current connection type, based on the types of payloads that have been received so far.
-
-
构造器详细资料
-
ServerCommonPacketListenerImpl
public ServerCommonPacketListenerImpl(MinecraftServer p_295057_, Connection p_294822_, CommonListenerCookie p_301980_)
-
-
方法详细资料
-
close
private void close() -
onDisconnect
- 指定者:
onDisconnect
在接口中PacketListener
-
onPacketError
- 指定者:
onPacketError
在接口中PacketListener
- 指定者:
onPacketError
在接口中ServerPacketListener
- 抛出:
ReportedException
-
handleKeepAlive
- 指定者:
handleKeepAlive
在接口中ServerCommonPacketListener
-
handlePong
- 指定者:
handlePong
在接口中ServerCommonPacketListener
-
handleCustomPayload
-
handleCustomClickAction
-
handleResourcePackResponse
-
handleCookieResponse
-
keepConnectionAlive
protected void keepConnectionAlive() -
checkIfClosed
private boolean checkIfClosed(long p_339648_) -
suspendFlushing
public void suspendFlushing() -
resumeFlushing
public void resumeFlushing() -
send
从接口复制的说明:ICommonPacketListener
Sends a packet to the target of this listener.- 指定者:
send
在接口中ICommonPacketListener
-
send
从接口复制的说明:IServerCommonPacketListenerExtension
Sends a packet to the client of this listener.- 指定者:
send
在接口中IServerCommonPacketListenerExtension
- 参数:
p_428378_
- An optional callback for when the payload is sent
-
disconnect
从接口复制的说明:ICommonPacketListener
Triggers a disconnection with the given reason.- 指定者:
disconnect
在接口中ICommonPacketListener
- 参数:
p_294116_
- The reason for the disconnection
-
disconnect
-
isSingleplayerOwner
protected boolean isSingleplayerOwner() -
playerProfile
protected abstract com.mojang.authlib.GameProfile playerProfile() -
getOwner
public com.mojang.authlib.GameProfile getOwner() -
latency
public int latency() -
createCookie
已过时。UsecreateCookie(ClientInformation, net.neoforged.neoforge.network.connection.ConnectionType)
instead, keeping the connection type information available.Creates a new cookie for this connection.- 参数:
p_301973_
- The client information.- 返回:
- The cookie.
-
createCookie
protected CommonListenerCookie createCookie(ClientInformation p_301973_, ConnectionType connectionType) Creates a new cookie for this connection.- 参数:
p_301973_
- The client information.connectionType
- Whether the connection is modded.- 返回:
- The cookie.
-
getConnection
从接口复制的说明:ICommonPacketListener
返回 the connection this listener is attached to。- 指定者:
getConnection
在接口中ICommonPacketListener
- 返回:
- the connection this listener is attached to
-
getMainThreadEventLoop
从接口复制的说明:ICommonPacketListener
返回 the main thread event loop。- 指定者:
getMainThreadEventLoop
在接口中ICommonPacketListener
- 返回:
- the main thread event loop
-
getConnectionType
从接口复制的说明:ICommonPacketListener
返回 the connection type of this packet listener。- 指定者:
getConnectionType
在接口中ICommonPacketListener
- 返回:
- the connection type of this packet listener
-
createCookie(ClientInformation, net.neoforged.neoforge.network.connection.ConnectionType)
instead, keeping the connection type information available.