Fix pre-limbo profile request plugins (e.g. Floodgate) being lost after /velocity reload - #274
Open
bhanu20-00 wants to merge 1 commit into
Open
Fix pre-limbo profile request plugins (e.g. Floodgate) being lost after /velocity reload#274bhanu20-00 wants to merge 1 commit into
bhanu20-00 wants to merge 1 commit into
Conversation
… reload reload() replaces eventManagerHook with a brand new instance and calls eventManager.unregisterListeners(this) to drop the old one, but only postProxyInitialization() ever calls reloadHandlers() to re-hoist pre-limbo profile request plugins (e.g. Floodgate) ahead of LimboAPI's own listener. Since that hook only runs once at boot, every /velocity reload permanently loses Floodgate's GameProfileRequestEvent handler: it was already pulled out of Velocity's normal dispatch list by the old hook and never gets put back, and the freshly constructed hook never re-discovers it. Net effect: after any /velocity reload, Bedrock/Floodgate players stop being recognized as such by downstream plugins (e.g. LimboAuth), and get treated as regular offline-mode players until the proxy is fully restarted. Fix: call reloadHandlers() again after re-registering the new eventManagerHook inside reload(), same as postProxyInitialization() already does at boot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-invoke
EventManagerHook#reloadHandlers()at the end ofLimboAPI#reload().Why
/velocity reloadcallsunregisterListeners()and then re-registers listeners on a newEventManagerHook. Plugins that hoist aGameProfileRequestEventhandler at proxy boot viapostProxyInitialization()(e.g. Floodgate, to detect Bedrock players before they reach limbo) had that handler attached to the old hook, which reload throws away. The new hook starts with empty handler state, so those handlers are never re-attached — Bedrock/Floodgate players silently stop being auto-authenticated and get forced through the normal register/login flow, until the proxy is fully restarted.Fix
After
reload()creates the newEventManagerHookand re-registersReloadListener, calleventManagerHook.reloadHandlers()so pre-limbo profile-request plugin handlers get re-hoisted onto the new hook — matching the state at proxy boot.