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_RESPONSE
indicating 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, setSingleDecode
channelRegistered, channelUnregistered, channelWritabilityChanged
ensureNotSharable, handlerAdded, isSharable
public SourceRconPacketDecoder()
Constructor for SourceRconPacketDecoder.
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.handler.codec.ByteToMessageDecoder
Exception
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelReadComplete
in interface io.netty.channel.ChannelInboundHandler
channelReadComplete
in class io.netty.handler.codec.ByteToMessageDecoder
Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.handler.codec.ByteToMessageDecoder
Exception
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
userEventTriggered
in interface io.netty.channel.ChannelInboundHandler
userEventTriggered
in class io.netty.handler.codec.ByteToMessageDecoder
Exception
protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out) throws Exception
decode
in class io.netty.handler.codec.ByteToMessageDecoder
Exception
public void channelActive(@NotNull @NotNull io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
Copyright © 2016–2024. All rights reserved.