delay teardown ownership until duplicate login check passes#1744
delay teardown ownership until duplicate login check passes#1744ZECHEESELORD wants to merge 3 commits intoPaperMC:dev/3.0.0from
Conversation
|
I think this can be fixed even better by only ever instantiating
Edit: Edit # 2: The canonical solution is to use |
this is definitely cleaner than my version- #1744 does add regression coverage. If you feel that it is necessary, feel free to cherrypick the test commit from here, or I can adapt the tests to #1748’s shape. happy to defer to #1748 if that’s the preferred direction. |
|
I'll leave it up to the maintainers whether or not we need unit tests in the second PR, or @ZECHEESELORD if you have the time feel free to cherry pick my commits into this PR and adapt the tests that you already have in place. |
Thanks- I’ll fold your commits into #1744 when I get a chance (and then adapt the tests, so we have regression coverage) |
916fff9 to
af601c2
Compare
|
The problem with this is that disconnections caused by a duplicate login are represented in the API, specifically in the DisconnectEvent (https://jd.papermc.io/velocity/3.5.0/com/velocitypowered/api/event/connection/DisconnectEvent.LoginStatus.html#CONFLICTING_LOGIN), so by preventing the creation of the player object and its teardown, the event would not be triggered |
|
That’s a fair point. I think I got a bit too focused on the internal cleanup path and not enough on the API surface. |
c1105e8 to
ff55c8a
Compare
The problem is now that we are already exposing the Player object to plugins through this event. Plugins can do whatever they want with the Player, including registering bossbars. Currently Also, it's interesting that a |
Fixes #1740.
Prevents
ConnectedPlayerteardown from running for a rejected duplicate login attempt by only taking teardown ownership after the duplicate login gate passes.Tests: