Class PacketHandler
java.lang.Object
com.hypixel.hytale.server.core.io.PacketHandler
- All Implemented Interfaces:
IPacketReceiver
- Direct Known Subclasses:
GenericConnectionPacketHandler,GenericPacketHandler,InitialPacketHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PlayerAuthenticationprotected final io.netty.channel.Channelprotected CompletableFuture<Void> protected Throwableprotected final PacketHandler.DisconnectReasonprivate static final io.netty.util.AttributeKey<Long> private static final com.hypixel.hytale.logger.HytaleLoggerstatic final intprotected final SecureRandomprotected final PacketHandler.PingInfo[]private floatprotected final ProtocolVersionprotected final AtomicIntegerprotected booleanprotected booleanprivate ScheduledFuture<?> -
Constructor Summary
ConstructorsConstructorDescriptionPacketHandler(io.netty.channel.Channel channel, ProtocolVersion protocolVersion) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidprotected voidvoidclosed(io.netty.channel.ChannelHandlerContext ctx) voiddisconnect(String message) protected voiddisconnect0(String message) getAuth()io.netty.channel.Channelabstract StringlonggetPingInfo(PongType pongType) intvoidprivate PackethandleOutboundAndCachePacket(Packet packet) private voidhandleOutboundAndCachePackets(Packet[] packets, Packet[] cachedPackets) voidhandlePong(Pong packet) booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanbooleanvoidstatic voidlogConnectionTimings(io.netty.channel.Channel channel, String message, Level level) final voidregistered(PacketHandler oldHandler) protected voidregistered0(PacketHandler oldHandler) voidsendPing()voidsetClientReadyForChunksFuture(CompletableFuture<Void> clientReadyFuture) voidsetCompressionEnabled(boolean compressionEnabled) Deprecated, for removal: This API element is subject to removal in a future version.voidsetQueuePackets(boolean queuePackets) protected voidsetTimeout(String stageId, BooleanSupplier meets, long def, TimeUnit timeUnit) booleanvoidtickPing(float dt) voidtryFlush()final voidunregistered(PacketHandler newHandler) protected voidunregistered0(PacketHandler newHandler) voidvoidvoidvoidwriteNoCache(Packet packet) voidwritePacket(Packet packet, boolean cache)
-
Field Details
-
MAX_PACKET_ID
public static final int MAX_PACKET_ID- See Also:
-
LOGIN_TIMING_LOGGER
private static final com.hypixel.hytale.logger.HytaleLogger LOGIN_TIMING_LOGGER -
LOGIN_START_ATTRIBUTE_KEY
-
channel
@Nonnull protected final io.netty.channel.Channel channel -
protocolVersion
-
auth
-
queuePackets
protected boolean queuePackets -
queuedPackets
-
pingIdRandom
-
pingInfo
-
pingTimer
private float pingTimer -
registered
protected boolean registered -
timeoutTask
-
clientReadyForChunksFutureStack
-
clientReadyForChunksFuture
-
disconnectReason
-
-
Constructor Details
-
PacketHandler
public PacketHandler(@Nonnull io.netty.channel.Channel channel, @Nonnull ProtocolVersion protocolVersion)
-
-
Method Details
-
getChannel
@Nonnull public io.netty.channel.Channel getChannel() -
setCompressionEnabled
Deprecated, for removal: This API element is subject to removal in a future version. -
isCompressionEnabled
Deprecated, for removal: This API element is subject to removal in a future version. -
getIdentifier
-
getProtocolVersion
-
registered
-
registered0
-
unregistered
-
unregistered0
-
handle
-
accept
-
logCloseMessage
public void logCloseMessage() -
closed
public void closed(io.netty.channel.ChannelHandlerContext ctx) -
setQueuePackets
public void setQueuePackets(boolean queuePackets) -
tryFlush
public void tryFlush() -
write
-
write
-
write
- Specified by:
writein interfaceIPacketReceiver
-
writeNoCache
- Specified by:
writeNoCachein interfaceIPacketReceiver
-
writePacket
-
handleOutboundAndCachePackets
-
handleOutboundAndCachePacket
-
disconnect
-
disconnect0
-
getPacketStatsRecorder
-
getPingInfo
-
getOperationTimeoutThreshold
public long getOperationTimeoutThreshold() -
tickPing
public void tickPing(float dt) -
sendPing
public void sendPing() -
handlePong
-
setTimeout
protected void setTimeout(@Nonnull String stageId, @Nonnull BooleanSupplier meets, long def, @Nonnull TimeUnit timeUnit) -
clearTimeout
protected void clearTimeout() -
getAuth
-
stillActive
public boolean stillActive() -
getQueuedPacketsCount
public int getQueuedPacketsCount() -
isLocalConnection
public boolean isLocalConnection() -
isLANConnection
public boolean isLANConnection() -
getDisconnectReason
-
setClientReadyForChunksFuture
-
getClientReadyForChunksFuture
-
logConnectionTimings
-