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
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    decode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out)
     
    protected void
    encode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out)
     
    void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    injectClientPacket(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, write

    Methods inherited from class io.netty.channel.ChannelDuplexHandler

    bind, close, connect, deregister, disconnect, flush, read

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BoarHandlerAdaptor

      public BoarHandlerAdaptor()
  • Method Details

    • handlerAdded

      public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerAdded in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerAdded in class io.netty.channel.ChannelHandlerAdapter
    • handlerRemoved

      public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerRemoved in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerRemoved in class io.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 the PacketListener chain 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:
      injectClientPacket in interface PacketInjector
    • encode

      protected void encode(io.netty.channel.ChannelHandlerContext ctx, org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper msg, List<Object> out)
      Specified by:
      encode in class io.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:
      decode in class io.netty.handler.codec.MessageToMessageCodec<org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper,org.cloudburstmc.protocol.bedrock.netty.BedrockPacketWrapper>