Class CommonDataHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.geysermc.floodgate.core.addon.data.CommonDataHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public abstract class CommonDataHandler extends io.netty.channel.ChannelInboundHandlerAdapter
  • Field Details

    • handshakeHandler

      protected final FloodgateHandshakeHandler handshakeHandler
    • config

      protected final FloodgateConfig config
    • kickMessageAttribute

      protected final io.netty.util.AttributeKey<String> kickMessageAttribute
    • blocker

      protected final PacketBlocker blocker
    • packetQueue

      protected final Queue<Object> packetQueue
    • handshakePacket

      protected Object handshakePacket
    • ctx

      protected io.netty.channel.ChannelHandlerContext ctx
  • Constructor Details

  • Method Details

    • setNewIp

      protected abstract void setNewIp(io.netty.channel.Channel channel, InetSocketAddress newIp)
    • setHostname

      protected abstract Object setHostname(Object handshakePacket, String hostname)
    • channelRead

      protected abstract boolean channelRead(Object packet) throws Exception
      Throws:
      Exception
    • shouldRemoveHandler

      protected boolean shouldRemoveHandler(FloodgateHandshakeHandler.HandshakeResult result)
    • shouldCallFireRead

      protected boolean shouldCallFireRead(Object queuedPacket)
    • handle

      protected void handle(Object handshakePacket, String hostname)
    • disablePacketQueue

      protected void disablePacketQueue(boolean removeSelf)
    • removeSelf

      protected void removeSelf()
    • setKickMessage

      protected final void setKickMessage(String message)
    • getKickMessage

      protected final String getKickMessage()
    • handlerAdded

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

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object packet)
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception