-
-
Notifications
You must be signed in to change notification settings - Fork 274
Preserve the pipeline order when async receiving packets #3351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This will also cause plugin generated packets to be send through the partial netty pipeline I don't know if this could cause problems as some plugins might expect the minecraft packet listener to directly receive the packet without further modification. Other than that lgtm. |
If a packet fails to pass from its own ctx to minecraft's packet handler, then that's an issue in that other plugin not protocollib. |
Fair, was just pointing out possible problems. |
Ah ok. Good you're pointing it out yes. |
thanks for the PR! which minecraft version(s) did you test it with? wondering if there might be issues on older versions here |
Good question, I believe I tested with 1.20.4. |
This fixes one of the oldest open issues in Floodgate GeyserMC/Floodgate#143.
ProtocolLib their async packet handlers currently don't respect the pipeline order and instead always let the Minecraft Connection class handle everything.
The Floodgate issue describes the following scenario:
A packet handler is created for
PacketType.Login.Client.START
, and when it comes time to handle that packet the async handler cancels the packet and keeps a copy for later use. If the packet is not async thenctx#fireChannelRead
is executed. When the plugin is done handling that packetreadServerboundPacket
sends it to the Connection class without considering that there might be other channel handlers between ProtocolLib and Minecraft'spacket_handler
.This PR calls
ctx#fireChannelRead
, fixing the order that was broken.