public class RakServerRateLimiter
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.socket.DatagramPacket>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Constructor and Description |
|---|
RakServerRateLimiter(RakServerChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
addException(java.net.InetAddress address) |
boolean |
blockAddress(java.net.InetAddress address,
long time,
java.util.concurrent.TimeUnit unit) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.socket.DatagramPacket datagram) |
protected int |
getAddressMaxPacketCount(java.net.InetAddress address) |
java.util.Collection<java.net.InetAddress> |
getExceptions() |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
boolean |
isAddressBlocked(java.net.InetAddress address) |
protected void |
onBlockedTick() |
protected void |
onRakTick() |
void |
removeException(java.net.InetAddress address) |
void |
unblockAddress(java.net.InetAddress address) |
acceptInboundMessage, channelReadpublic static final java.lang.String NAME
public RakServerRateLimiter(RakServerChannel channel)
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterjava.lang.Exceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterjava.lang.Exceptionprotected void onRakTick()
protected void onBlockedTick()
public boolean blockAddress(java.net.InetAddress address,
long time,
java.util.concurrent.TimeUnit unit)
public void unblockAddress(java.net.InetAddress address)
public boolean isAddressBlocked(java.net.InetAddress address)
public void addException(java.net.InetAddress address)
public void removeException(java.net.InetAddress address)
public java.util.Collection<java.net.InetAddress> getExceptions()
protected int getAddressMaxPacketCount(java.net.InetAddress address)
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.socket.DatagramPacket datagram)
throws java.lang.Exception
channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.socket.DatagramPacket>java.lang.Exception