public class SourceRconPacketDecoder
extends io.netty.handler.codec.ByteToMessageDecoder
Decodes a raw ByteBuf message into a SourceRconPacket type. This decoder will read and collect decoded packets until everything has been received from the server.
When the server receives an auth request, it will respond with an emptySERVERDATA_RESPONSE_VALUE, followed immediately by aSERVERDATA_AUTH_RESPONSEindicating whether authentication succeeded or failed. Note that the status code is returned in the packet id field, so when pairing the response with the original auth request, you may need to look at the packet id of the preceedingSERVERDATA_RESPONSE_VALUE.
| Constructor and Description |
|---|
SourceRconPacketDecoder()
Constructor for SourceRconPacketDecoder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(@NotNull io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
actualReadableBytes, callDecode, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecodechannelRegistered, channelUnregistered, channelWritabilityChangedensureNotSharable, handlerAdded, isSharablepublic SourceRconPacketDecoder()
Constructor for SourceRconPacketDecoder.
public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelReadComplete in interface io.netty.channel.ChannelInboundHandlerchannelReadComplete in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
throws Exception
userEventTriggered in interface io.netty.channel.ChannelInboundHandleruserEventTriggered in class io.netty.handler.codec.ByteToMessageDecoderExceptionprotected void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic void channelActive(@NotNull
@NotNull io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2016–2024. All rights reserved.