-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Event for exceptions that get caugth #3545
Comments
I wanted to do an event like this
The problem in this case is that some PacketHandler impls can cauth exceptions but are not implementing net.md_5.bungee.api.connection.Connection and dont have a field like UserConnection that is implementing it. I am not sure if we should let all handler implement net.md_5.bungee.api.connection.Connection or if we should make the event use the AbstractPacketHandler like this
|
For my specific case an PendingConnectionException Event would be enoutgh but i am not sure if this is the best for all |
Why not just put your own channel handler to handle the exceptions? Seems strange to add an event that isn't really bound to the API in any way. |
you can't access the pipeline via api and i don't want to do it with reflections |
Also the channelinitilzer Fields are final, and i think in newer java versions you cant do much about it with reflections so i could not inject into initial connection |
Yeah Bungee's taken a strong encapsulation approach like Bukkit sadly. Not sure if that'll ever change, but plugins like Floodgate need to do a lot of hacks to get things working which is a shame. Would be extremely useful to have some API wrapping common pipeline functions You can still modify final's with Unsafe on new java versions |
Yes but i dont like use the Unsafe class |
Feature description
I want an event that is called if a connection caugth an exception,
that would be usefull for layer7 firewalling with iptables or something.
I want to archiv something like this, but with an nice clean event without any fork
In this sample i already added an Event for test reasons, but i am not sure if its valid and how i could provide it for public
As my connection is an AbstractPacketHandler object so i can impl it for all exception() methods in all handler so i can get bassicly every exception
Goal of the feature
Adding an Event for all caugth throwables by the Connection or PacketHandler i dont know how we should implement it
Unfitting alternatives
I have done it with a fork because there is no other good way, but reflections and injecting into the pipeline
Checking
The text was updated successfully, but these errors were encountered: