public abstract class CommonDataHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
| Modifier and Type | Field and Description |
|---|---|
protected PacketBlocker |
blocker |
protected FloodgateConfig |
config |
protected io.netty.channel.ChannelHandlerContext |
ctx |
protected FloodgateHandshakeHandler |
handshakeHandler |
protected Object |
handshakePacket |
protected io.netty.util.AttributeKey<String> |
kickMessageAttribute |
protected Queue<Object> |
packetQueue |
| Constructor and Description |
|---|
CommonDataHandler(FloodgateHandshakeHandler handshakeHandler,
FloodgateConfig config,
io.netty.util.AttributeKey<String> kickMessageAttribute,
PacketBlocker blocker) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object packet) |
protected abstract boolean |
channelRead(Object packet) |
protected void |
disablePacketQueue(boolean removeSelf) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
protected String |
getKickMessage() |
protected void |
handle(Object handshakePacket,
String hostname) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
removeSelf() |
protected abstract Object |
setHostname(Object handshakePacket,
String hostname) |
protected void |
setKickMessage(String message) |
protected abstract void |
setNewIp(io.netty.channel.Channel channel,
InetSocketAddress newIp) |
protected boolean |
shouldCallFireRead(Object queuedPacket) |
protected boolean |
shouldRemoveHandler(FloodgateHandshakeHandler.HandshakeResult result) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerRemoved, isSharableprotected final FloodgateHandshakeHandler handshakeHandler
protected final FloodgateConfig config
protected final io.netty.util.AttributeKey<String> kickMessageAttribute
protected final PacketBlocker blocker
protected Object handshakePacket
protected io.netty.channel.ChannelHandlerContext ctx
public CommonDataHandler(FloodgateHandshakeHandler handshakeHandler, FloodgateConfig config, io.netty.util.AttributeKey<String> kickMessageAttribute, PacketBlocker blocker)
protected abstract void setNewIp(io.netty.channel.Channel channel,
InetSocketAddress newIp)
protected abstract boolean channelRead(Object packet) throws Exception
Exceptionprotected boolean shouldRemoveHandler(FloodgateHandshakeHandler.HandshakeResult result)
protected boolean shouldCallFireRead(Object queuedPacket)
protected void disablePacketQueue(boolean removeSelf)
protected void removeSelf()
protected final void setKickMessage(String message)
protected final String getKickMessage()
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object packet)
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterException