Class CommonNettyDataHandler

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

public abstract class CommonNettyDataHandler extends io.netty.channel.ChannelInboundHandlerAdapter
  • 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
    protected final PacketBlocker
     
    protected final org.geysermc.floodgate.core.config.FloodgateConfig
     
    protected final io.netty.util.AttributeKey<org.geysermc.api.connection.Connection>
     
    protected io.netty.channel.ChannelHandlerContext
     
    protected final org.geysermc.floodgate.core.connection.DataSeeker
     
    protected final org.geysermc.floodgate.core.connection.FloodgateDataHandler
     
    protected Object
     
    protected final io.netty.util.AttributeKey<String>
     
    protected final org.geysermc.floodgate.core.logger.FloodgateLogger
     
    protected final Queue<Object>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommonNettyDataHandler(org.geysermc.floodgate.core.connection.DataSeeker dataSeeker, org.geysermc.floodgate.core.connection.FloodgateDataHandler handshakeHandler, org.geysermc.floodgate.core.config.FloodgateConfig config, org.geysermc.floodgate.core.logger.FloodgateLogger logger, io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute, io.netty.util.AttributeKey<String> kickMessageAttribute, PacketBlocker blocker)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelRead(io.netty.channel.ChannelHandlerContext ctx, Object packet)
     
    protected abstract boolean
     
    protected void
    disablePacketQueue(boolean removeSelf)
     
    protected void
    disablePacketQueue(org.geysermc.floodgate.core.connection.FloodgateDataHandler.HandleResult result)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    protected final String
     
    protected void
    handle(Object handshakePacket, String hostname)
     
    void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
     
    protected void
     
    protected abstract Object
    setHostname(Object handshakePacket, String hostname)
     
    protected final void
    setKickMessage(@NonNull String message)
     
    protected abstract void
    setNewIp(io.netty.channel.Channel channel, InetSocketAddress newIp)
     
    protected boolean
    shouldCallFireRead(Object queuedPacket)
     
    protected boolean
    shouldRemoveHandler(org.geysermc.floodgate.core.connection.FloodgateDataHandler.HandleResult result)
     

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

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

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerRemoved
  • Field Details

    • dataSeeker

      protected final org.geysermc.floodgate.core.connection.DataSeeker dataSeeker
    • handshakeHandler

      protected final org.geysermc.floodgate.core.connection.FloodgateDataHandler handshakeHandler
    • config

      protected final org.geysermc.floodgate.core.config.FloodgateConfig config
    • logger

      protected final org.geysermc.floodgate.core.logger.FloodgateLogger logger
    • connectionAttribute

      protected final io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute
    • 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

    • CommonNettyDataHandler

      public CommonNettyDataHandler(org.geysermc.floodgate.core.connection.DataSeeker dataSeeker, org.geysermc.floodgate.core.connection.FloodgateDataHandler handshakeHandler, org.geysermc.floodgate.core.config.FloodgateConfig config, org.geysermc.floodgate.core.logger.FloodgateLogger logger, io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute, io.netty.util.AttributeKey<String> kickMessageAttribute, PacketBlocker blocker)
  • 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(org.geysermc.floodgate.core.connection.FloodgateDataHandler.HandleResult result)
    • shouldCallFireRead

      protected boolean shouldCallFireRead(Object queuedPacket)
    • handle

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

      protected void disablePacketQueue(org.geysermc.floodgate.core.connection.FloodgateDataHandler.HandleResult result)
    • disablePacketQueue

      protected void disablePacketQueue(boolean removeSelf)
    • removeSelf

      protected void removeSelf()
    • setKickMessage

      protected final void setKickMessage(@NonNull @NonNull 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