Skip to content
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

Unable to cancel packet send events in Velocity and BungeeCord #788

Closed
MemencioPerez opened this issue May 18, 2024 · 0 comments · Fixed by #789
Closed

Unable to cancel packet send events in Velocity and BungeeCord #788

MemencioPerez opened this issue May 18, 2024 · 0 comments · Fixed by #789
Labels
bug Something isn't working

Comments

@MemencioPerez
Copy link
Contributor

MemencioPerez commented May 18, 2024

Describe the bug
Trying to cancel a packet send event in Velocity or BungeeCord causes a disconnect.

Software brand
Velocity 3.3.0-SNAPSHOT build 390 and BungeeCord 1.20-R0.3-SNAPSHOT build 1842.

Plugins
Plugins: chatsentinel, packetevents, unsignedvelocity, cleanstaffchat, easycommandblocker, epicguard, execute, librelogin, litebans, luckperms, mysqlandconfigurateforvelocity, partyandfriends, max-friends, minimotd-velocity, multilobby, rewhitelist, skinsrestorer, spark, tab, tradeproxy, velocityplus

How To Reproduce
Steps to reproduce the behavior:

  1. Create a PacketSendEvent listener in Velocity or BungeeCord
  2. Listen for any packet and set the event as canceled
  3. Join your proxy and test your listener
  4. See the disconnect

Expected behavior
Canceling the event should prevent the packet from being sent to the client.

Screenshots
image

Additional context
It seems that with some packages that are not registered in Velocity, the acceptOutboundMessage check that is called from the write method within the MessageToByteEncoder class returns false because it expects a com.velocitypowered.proxy.protocol.MinecraftPacket but ''msg'' is an instance of PooledSlicedByteBuf, and in that case the write method of the ChannelHandlerContext class is called directly.

Anyway, canceling the packet "works" after passing the buffer through the clear method of the ByteBufHelper class, but I guess calling a direct write because the acceptOutboundMessage check returns false isn't the best option, right?

@MemencioPerez MemencioPerez added the bug Something isn't working label May 18, 2024
@MemencioPerez MemencioPerez changed the title Unable to cancel packet send events in Velocity Unable to cancel packet send events in Velocity and BungeeCord May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant