Repository navigation
fix: honour Paper's login-phase refusal in the fake login cycle; record both debug directions - #180
Merged
minekube-ai-engineer[bot] merged 2 commits intoOct 28, 2026
Conversation
added 2 commits
October 28, 2026 06:01
… encoder `debug: true` produced a one-sided dump on Paper 26.3: 25 `Player -> Spigot` lines and zero `Spigot -> Player`, which read as "the backend sent nothing" for three support rounds of the 26.3 configuration-stall case. Two causes, both measured on Paper 26.3 (connect-spot 0.15.17, protocol-777 probe through a production endpoint): * Paper names the outbound packet encoder `outbound_config` on the injected, configuration-capable connection and only uses `encoder` on the player-side path (net.minecraft.network.Connection#outboundHandlerName), so the recorder was never installed. The skip was logged at debug level, i.e. invisible. * Both recorders shared one packet counter, so whichever direction spoke first consumed MAX_DEBUG_PACKET_COUNT and silenced the other one entirely. The outbound recorder now locates the encoder in the pipeline itself (configured name, then the installed packet encoder by class name, then any Netty message encoder), falls back to a pre-encoding object recorder at the pipeline tail so the direction is visible even from a degraded position, and reports every non-obvious placement at WARN. Each direction gets its own budget. Verified on the same Paper 26.3 pod: a whitelist-refused join now records `Spigot -> Player 1` - Paper's 44-byte login disconnect carrying "You are not whitelisted on this server!" - and a normal join records both directions (20 inbound / 25 outbound lines).
…fusal The post-1.20.4 fake login cycle called `callPlayerPreLoginEvents` and then `startClientVerification` unconditionally, even when Paper had already ended the connection inside the first call (a refused `AsyncPlayerPreLoginEvent`, a velocity-forwarding refusal). Invoking verification on a connection Paper has closed is a race the connector should not enter: its result is either a no-op or a `LoginSuccess` written onto a refused login, and it contradicts the reason the player is being kicked for. The cycle now reports whether the login was handed over and stops before `startClientVerification` when the pre-login call returned no profile or the connection is no longer open. Paper's own disconnect packet is untouched. Measured with a deny plugin on Paper 26.3 through a production endpoint: * before: `callPlayerPreLoginEvents returned a profile` -> `startClientVerification completed` logged 6 ms *after* the channel had already been closed by Paper's refusal; * after: `Paper ended the login during the pre-login events; not continuing the injection`, with the same single 61-byte disconnect on the wire. Note for the record: a whitelist/ban refusal is *not* decided in the pre-login call on Paper 26.3 - it happens in `PlayerList#canPlayerLogin` after `startClientVerification` - so this change cannot move that kick to the client; the connector forwards that disconnect unchanged either way (verified: exactly one 44-byte `Spigot -> Player` packet carrying the whitelist message).
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 this changes
Two defects in
connect-spot's support-facing behaviour, both found while working the Paper 26.3configuration-phase stall (internal case t_dc27dadd).
1.
debug: truecaptured one direction only (fix(core)). On Paper 26.3 a successful joinproduced exactly 25
Player -> Spigotlines and zeroSpigot -> Player, which read as "the backendsent nothing" for three support rounds. Two causes:
outbound_configon the injected, configuration-capableconnection and only uses
encoderon the player-side path(
net.minecraft.network.Connection#outboundHandlerName), soaddBefore("encoder")never matched andthe skip was logged at debug level only.
MAX_DEBUG_PACKET_COUNTand silenced the other one.The outbound recorder now locates the encoder in the pipeline (configured name -> installed packet
encoder by class name -> any Netty message encoder), falls back to a pre-encoding object recorder at
the pipeline tail so a direction is never silently missing, and logs every non-obvious placement at
WARN. Each direction gets its own budget.
2. The fake login cycle kept driving Paper after Paper had refused the login (
fix(spigot)). Thepost-1.20.4 flow called
callPlayerPreLoginEventsand thenstartClientVerificationunconditionally.When the pre-login call ends the connection (a refused
AsyncPlayerPreLoginEvent, avelocity-forwarding refusal), the connector was invoking verification on a dead connection. It now
stops before
startClientVerificationwhen the pre-login call returned no profile or the connection isno longer open. Paper's own disconnect packet is not touched or rewritten.
Scope note (please read before reviewing the second commit)
A whitelist/ban kick is not decided inside
callPlayerPreLoginEventson Paper 26.3 - it is decidedin
PlayerList#canPlayerLoginafterstartClientVerification,disconnectAsync'd from the loginlistener's tick. So commit 2 cannot move that kick to the client, and it does not claim to: the
connector forwards that disconnect unchanged either way (measured below: exactly one 44-byte
Spigot -> Playerpacket carrying the whitelist message; no backendLoginSuccess). Commit 2 closesthe narrower connector-side race (verification invoked on a connection Paper already ended).
RED -> GREEN
Per-direction unit tests, run on the release-under-test code before the fixes (both files kept in the
PR):
Lab verification (disposable pod, Paper 26.3 build 227, protocol-777 probe, production endpoint)
Player -> Spigot, 0Spigot -> Player(the reported defect)Spigot -> Player 1= Paper's 44-byte login disconnect, hex2b 00 29 22 "You are not whitelisted on this server!"; backend sent noLoginSuccessjoin_gameat +1.25 s, both directions recorded (20 inbound / 25 outbound lines)AsyncPlayerPreLoginEventdenialstartClientVerification completedlogged 6 ms after the channel was already closed by Paper's refusalAsyncPlayerPreLoginEventdenialPaper ended the login during the pre-login events; not continuing the injection; same single 61-byte disconnect on the wireCaveat carried forward (not fixed here)
On an endpoint that has a fallback (the Minekube browser hub), a backend refusal during login ends up
as a fallback redirect: the player is placed in the hub instead of being shown Paper's kick. That is
edge/fallback policy, not this plugin - the connector demonstrably forwards the refusal packet
unmodified. Tracked separately.