[v3] fix: AuthMe login race, LocalMode port override, and incomplete deop in stand-reset - #56
Merged
Merged
Conversation
Login prompt can arrive during handshake, before player.getMessageBufferIndex() is read. Reading it too late means the poll below scans from after the prompt and never finds it. Fixes part of Drownek#54
spec.port was already threaded into the runner config so bots connect to it, but PaperProvisionTask never wrote it into server.properties, so the locally provisioned server always came up on the Paper default (25565) regardless. Fixes part of Drownek#54
Raw 'minecraft:deop' command removed op server-side but left player.abilities still marking 'op', so later assertions against tracked state stayed wrong even though the server had already deopped the player. Fixes part of Drownek#54
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.
Three independent bugs @Drownek found testing #52 on a real stand. Small enough to land as their own PR rather than wait on the player-reuse rework.
AuthMe login prompt missed during handshake
auth-authme-package/index.tsreadplayer.getMessageBufferIndex()to mark where in the chat buffer to start scanning for the login/register prompt. But the prompt can arrive during the handshake, before that read happens — so the poll below started scanning from a point already past the prompt and hung waiting for something it had already missed.Fixed by hardcoding
joinIndex = 0. This buffer is fresh per player, so scanning from the start doesn't risk picking up a stale prompt from a previous connection.LocalMode ignores the configured port
LocalEnvironmentSpec.portwas already wired into the runner config, so bots connected to whatever port the environment DSL specified. ButPaperProvisionTasknever wrote that port intoserver.properties— the server itself always came up on Paper's default, 25565, no matter what the config said. Anyone setting a custom port got a bot pointed at a port nothing was listening on.Added a
portinput toPaperProvisionTask, wired fromspec.portinLocalMode.registerTasks, and now written asserver-port=alongside the existingonline-mode/connection-throttle/spawn-protectionpatching.stand-reset.tsdeop doesn't clear ability stateThe reset plugin ran the raw
minecraft:deopcommand, which strips operator status server-side but leaves nothing telling the bot's own tracked state that it happened.player.abilitieskept reportingopfor an account the server no longer trusted.Swapped in
player.deOp(), which sends the same command and clears the localopmark to match.Testing
:plugwright-local:compileKotlin— passestsc --noEmitonauth-authme-package— cleanCloses #54