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 ClassesNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PacketBlockerprotected final FloodgateConfigprotected final io.netty.util.AttributeKey<org.geysermc.api.connection.Connection>protected io.netty.channel.ChannelHandlerContextprotected final DataSeekerprotected final FloodgateDataHandlerprotected Objectprotected final io.netty.util.AttributeKey<String>protected final FloodgateLogger -
Constructor Summary
ConstructorsConstructorDescriptionCommonNettyDataHandler(DataSeeker dataSeeker, FloodgateDataHandler handshakeHandler, FloodgateConfig config, FloodgateLogger logger, io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute, io.netty.util.AttributeKey<String> kickMessageAttribute, PacketBlocker blocker) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object packet) protected abstract booleanchannelRead(Object packet) protected voiddisablePacketQueue(boolean removeSelf) protected voidvoidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) protected final Stringprotected voidvoidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) protected voidprotected abstract ObjectsetHostname(Object handshakePacket, String hostname) protected final voidsetKickMessage(@NonNull String message) protected abstract voidsetNewIp(io.netty.channel.Channel channel, InetSocketAddress newIp) protected booleanshouldCallFireRead(Object queuedPacket) protected booleanMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
dataSeeker
-
handshakeHandler
-
config
-
logger
-
connectionAttribute
protected final io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute -
kickMessageAttribute
-
blocker
-
packetQueue
-
handshakePacket
-
ctx
protected io.netty.channel.ChannelHandlerContext ctx
-
-
Constructor Details
-
CommonNettyDataHandler
public CommonNettyDataHandler(DataSeeker dataSeeker, FloodgateDataHandler handshakeHandler, FloodgateConfig config, FloodgateLogger logger, io.netty.util.AttributeKey<org.geysermc.api.connection.Connection> connectionAttribute, io.netty.util.AttributeKey<String> kickMessageAttribute, PacketBlocker blocker)
-
-
Method Details
-
setNewIp
-
setHostname
-
channelRead
- Throws:
Exception
-
shouldRemoveHandler
-
shouldCallFireRead
-
handle
-
disablePacketQueue
-
disablePacketQueue
protected void disablePacketQueue(boolean removeSelf) -
removeSelf
protected void removeSelf() -
setKickMessage
-
getKickMessage
-
handlerAdded
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception - Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-