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

Expand listener priorities #911

Open
SamB440 opened this issue Aug 7, 2024 · 4 comments
Open

Expand listener priorities #911

SamB440 opened this issue Aug 7, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@SamB440
Copy link
Contributor

SamB440 commented Aug 7, 2024

Is your feature request related to a problem? Please describe.
Packet listeners are currently limited by an enum: https://github.com/retrooper/packetevents/blob/2.0/api/src/main/java/com/github/retrooper/packetevents/event/PacketListenerPriority.java

When not shading and multiple plugins are using packetevents, this can become problematic, if two plugins listen on a priority then the order in which they execute is unknown, and plugins such as anticheats would like to be after any packet changes made by plugins.

Describe the solution you'd like
The addition of priority integers instead of an enum.

Describe alternatives you've considered to solve your solution without
us adding this as a feature?

Shading to stay ahead of plugins using the packetevents plugin instance.

Additional context
Add any other context or screenshots about the feature request here.

@SamB440 SamB440 added the enhancement New feature or request label Aug 7, 2024
@retrooper
Copy link
Owner

retrooper commented Aug 7, 2024

You mention that AntiCheats, such as yours, would like to be after packet changes by other plugins. Then at the end you mention that you currently "shade" to stay ahead of all plugins. (implying before) Which is it now?

@SamB440
Copy link
Contributor Author

SamB440 commented Aug 7, 2024

Currently shading to be after the packet changes by other plugins.

@retrooper
Copy link
Owner

You're aware that this does not solve the packet-modification of other plugins that shade PacketEvents, right? If two plugins just shade PacketEvents, the order in which the netty handlers are invoked is not predictable and depends on whichever plugin loads first.
Moreover, you could just opt for a later priority in Grim to avoid packet changes. Reputable plugins shouldn't be modifying packets without allowing others to account for it.

@SamB440
Copy link
Contributor Author

SamB440 commented Aug 7, 2024

You're aware that this does not solve the packet-modification of other plugins that shade PacketEvents, right? If two plugins just shade PacketEvents, the order in which the netty handlers are invoked is not predictable and depends on whichever plugin loads first.

Yes, this is why I have all my other plugins use the plugin packetevents, but the anticheat shaded.

Moreover, you could just opt for a later priority in Grim to avoid packet changes.

Grim already uses all packet priorities in the enum, I can't just simply make them all later, but I can with int priorities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants