Package ac.boar.protocol
Class BoarHandlerAdaptor
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.MessageToMessageCodec<org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper,org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper>
ac.boar.protocol.BoarHandlerAdaptor
- All Implemented Interfaces:
PacketInjector,io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public class BoarHandlerAdaptor
extends io.netty.handler.codec.MessageToMessageCodec<org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper,org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper>
implements PacketInjector
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out) protected voidencode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out) voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx) voidinjectClientPacket(org.cloudburstmc.protocol.bedrock.packet.BedrockPacket packet) Push a synthetic Bedrock packet downstream as if the client had just sent it.Methods inherited from class io.netty.handler.codec.MessageToMessageCodec
acceptInboundMessage, acceptOutboundMessage, channelRead, writeMethods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
BoarHandlerAdaptor
public BoarHandlerAdaptor()
-
-
Method Details
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
injectClientPacket
public void injectClientPacket(org.cloudburstmc.protocol.bedrock.packet.BedrockPacket packet) Push a synthetic Bedrock packet downstream as if the client had just sent it. The packet is fired from this handler's context, so it skips thePacketListenerchain on its way to the next handler. Callers that buffer a packet for replay must retain any reference-counted payload before caching — the wrapper built here releases the packet when its own refcount drops to zero.- Specified by:
injectClientPacketin interfacePacketInjector
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out) - Specified by:
encodein classio.netty.handler.codec.MessageToMessageCodec<org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper,org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper>
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out) - Specified by:
decodein classio.netty.handler.codec.MessageToMessageCodec<org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper,org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper>
-