- All Implemented Interfaces:
- io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
public class PacketBlocker
extends io.netty.channel.ChannelInboundHandlerAdapter
In Floodgate the PacketBlocker is used to temporarily prevent packets from being decoded. A
similar system is used to prevent packets from being handled while Floodgate is processing the
login. The old system blocked the thread which was processing the Floodgate login, but that
doesn't only block the packets for that specific user, it's shared between multiple users causing
them to lag or sometimes timeout.
The reason why we prevent packets from being handled is because keeping the packet order is
important. That is also the reason why we prevent packets from being decoded during that time.
The 'login start' packet for example can only be decoded after the handshake packet has been
handled, because the server can only successfully decode the packet after the handshake packet
caused the server to switch to the login state.