PacketHandler

class PacketHandler : ChannelDuplexHandler

The packet channel handler that is responsible for firing packet events and intercepting packets. Use injectIncoming or injectOutgoing to inject packets into the netty pipeline starting at this handler.

Properties

Link copied to clipboard
val channel: Channel
Link copied to clipboard
Link copied to clipboard
var player: Player?

The player associated with this packet handler, or null if no player object exists yet (e.g., during the login or configuration phase).

Functions

Link copied to clipboard
open fun bind(ctx: ChannelHandlerContext?, localAddress: SocketAddress?, promise: ChannelPromise?)
Link copied to clipboard
open fun channelActive(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun channelInactive(ctx: ChannelHandlerContext?)
Link copied to clipboard
open override fun channelRead(ctx: ChannelHandlerContext, msg: Any)
Link copied to clipboard
open fun channelReadComplete(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun channelRegistered(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun channelUnregistered(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun channelWritabilityChanged(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun close(ctx: ChannelHandlerContext?, promise: ChannelPromise?)
Link copied to clipboard
open fun connect(ctx: ChannelHandlerContext?, remoteAddress: SocketAddress?, localAddress: SocketAddress?, promise: ChannelPromise?)
Link copied to clipboard
open fun deregister(ctx: ChannelHandlerContext?, promise: ChannelPromise?)
Link copied to clipboard
open fun disconnect(ctx: ChannelHandlerContext?, promise: ChannelPromise?)
Link copied to clipboard
open fun exceptionCaught(ctx: ChannelHandlerContext?, cause: Throwable?)
Link copied to clipboard
open override fun flush(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun handlerAdded(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun handlerRemoved(ctx: ChannelHandlerContext?)
Link copied to clipboard
fun injectIncoming(msg: Any, callEventHandlers: Boolean = false)

Injects an incoming packet into the netty pipeline starting at this handler.

Link copied to clipboard
fun injectOutgoing(msg: Any, promise: ChannelPromise?)

Injects an outgoing packet into the netty pipeline starting at this handler.

Link copied to clipboard
fun queueByteBuf(buf: FriendlyByteBuf)

Queues a raw byte buffer representing an encoded outgoing packet that will be flushed later this tick.

Link copied to clipboard
open fun read(ctx: ChannelHandlerContext?)
Link copied to clipboard
open fun userEventTriggered(ctx: ChannelHandlerContext?, evt: Any?)
Link copied to clipboard
open override fun write(ctx: ChannelHandlerContext?, msg: Any?, promise: ChannelPromise?)