abstract class PacketHandler implements IPacketReceiver
Class PacketHandler. Provides packethandler functionality for the Hytale server.
java.lang.Object > PacketHandler
Field Summary
auth
Field auth.
queuePackets
Field queuePackets.
pingTimer
Field pingTimer.
registered
Field registered.
timeoutTask
Field timeoutTask.
clientReadyForChunksFutureStack
Field clientReadyForChunksFutureStack.
clientReadyForChunksFuture
Field clientReadyForChunksFuture.
cachedPackets
Field cachedPackets.
packet
Field packet.
average
Field average.
id
Field id.
nowInstant
Field nowInstant.
nowTimestamp
Field nowTimestamp.
channel
Field channel.
address
Field address.
loginStartAttribute
Field loginStartAttribute.
now
Field now.
before
Field before.
nanoTime
Field nanoTime.
pingValue
Field pingValue.
serverDisconnectReason
Field serverDisconnectReason.
clientDisconnectType
Field clientDisconnectType.
Method Detail
PacketHandler
public
PacketHandler
(@Nonnull final Channel channel, @Nonnull final ProtocolVersion protocolVersion)
Method PacketHandler.
- Parameters:
@Nonnull final Channelchannel@Nonnull final ProtocolVersionprotocolVersion
getChannel
Channel
getChannel
()
Method getChannel.
setCompressionEnabled
void
setCompressionEnabled
(final boolean compressionEnabled)
Method setCompressionEnabled.
- Parameters:
final booleancompressionEnabled
isCompressionEnabled
boolean
isCompressionEnabled
()
Method isCompressionEnabled.
logCloseMessage
void
logCloseMessage
()
Method logCloseMessage.
closed
void
closed
(final ChannelHandlerContext ctx)
Method closed.
- Parameters:
final ChannelHandlerContextctx
setQueuePackets
void
setQueuePackets
(final boolean queuePackets)
Method setQueuePackets.
- Parameters:
final booleanqueuePackets
tryFlush
void
tryFlush
()
Method tryFlush.
write
void
write
(@Nonnull final Packet... packets)
Method write.
- Parameters:
@Nonnull final Packet...packets
handleOutboundAndCachePackets
void
handleOutboundAndCachePackets
(@Nonnull final Packet[] packets, @Nonnull final Packet[] cachedPackets)
Method handleOutboundAndCachePackets.
- Parameters:
@Nonnull final Packet[]packets@Nonnull final Packet[]cachedPackets
handleOutboundAndCachePacket
Method handleOutboundAndCachePacket.
- Parameters:
@Nonnull final Packetpacket
disconnect
void
disconnect
(@Nonnull final String message)
Method disconnect.
- Parameters:
@Nonnull final Stringmessage
disconnect0
void
disconnect0
(@Nonnull final String message)
Method disconnect0.
- Parameters:
@Nonnull final Stringmessage
Disconnect
new
Disconnect
(message, DisconnectType.Disconnect)
Method Disconnect.
- Parameters:
messagemessageDisconnectType.DisconnectDisconnectType.Disconnect
getPacketStatsRecorder
Method getPacketStatsRecorder.
getOperationTimeoutThreshold
long
getOperationTimeoutThreshold
()
Method getOperationTimeoutThreshold.
tickPing
void
tickPing
(final float dt)
Method tickPing.
- Parameters:
final floatdt
sendPing
void
sendPing
()
Method sendPing.
Ping
new
Ping
(id, WorldTimeResource.instantToInstantData(nowInstant)
Method Ping.
- Parameters:
ididWorldTimeResource.instantToInstantData(nowInstantWorldTimeResource.instantToInstantData(nowInstant
setTimeout
void
setTimeout
(@Nonnull final String stageId, @Nonnull final BooleanSupplier meets, final long def, @Nonnull final TimeUnit timeUnit)
Method setTimeout.
- Parameters:
@Nonnull final StringstageId@Nonnull final BooleanSuppliermeetsfinal longdef@Nonnull final TimeUnittimeUnit
clearTimeout
void
clearTimeout
()
Method clearTimeout.
stillActive
boolean
stillActive
()
Method stillActive.
getQueuedPacketsCount
int
getQueuedPacketsCount
()
Method getQueuedPacketsCount.
isLocalConnection
boolean
isLocalConnection
()
Method isLocalConnection.
isLANConnection
boolean
isLANConnection
()
Method isLANConnection.
getDisconnectReason
DisconnectReason
getDisconnectReason
()
Method getDisconnectReason.
setClientReadyForChunksFuture
void
setClientReadyForChunksFuture
(@Nonnull final CompletableFuture clientReadyFuture)
Method setClientReadyForChunksFuture.
- Parameters:
@Nonnull final CompletableFutureclientReadyFuture
getClientReadyForChunksFuture
CompletableFuture
getClientReadyForChunksFuture
()
Method getClientReadyForChunksFuture.
logConnectionTimings
void
logConnectionTimings
(@Nonnull final Channel channel, @Nonnull final String message, @Nonnull final Level level)
Method logConnectionTimings.
- Parameters:
@Nonnull final Channelchannel@Nonnull final Stringmessage@Nonnull final Levellevel
recordSent
void
recordSent
(final int id, final long timestamp)
Method recordSent.
- Parameters:
final intidfinal longtimestamp
IllegalArgumentException
new
IllegalArgumentException
("Got packet for " + String.valueOf(packet.type)
Method IllegalArgumentException.
- Parameters:
"Got packet for " +String.valueOf(packet.type
clear
void
clear
()
Method clear.
getServerDisconnectReason
String
getServerDisconnectReason
()
Method getServerDisconnectReason.
setServerDisconnectReason
void
setServerDisconnectReason
(final String serverDisconnectReason)
Method setServerDisconnectReason.
- Parameters:
final StringserverDisconnectReason
getClientDisconnectType
Method getClientDisconnectType.
setClientDisconnectType
Method setClientDisconnectType.
- Parameters:
final DisconnectTypeclientDisconnectType
toString
String
toString
()
Method toString.