You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a PacketSendEvent listener in Velocity or BungeeCord
Listen for any packet and set the event as canceled
Join your proxy and test your listener
See the disconnect
Expected behavior
Canceling the event should prevent the packet from being sent to the client.
Screenshots
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?
The text was updated successfully, but these errors were encountered:
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
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:
Expected behavior
Canceling the event should prevent the packet from being sent to the client.
Screenshots
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?
The text was updated successfully, but these errors were encountered: