Skip to content

Fix Vulcan compatibility: withhold pings until JOIN_GAME is sent - #138

Open
devamyst wants to merge 1 commit into
Axionize:lightningfrom
devamyst:fix/vulcan-join-game-ping-order
Open

Fix Vulcan compatibility: withhold pings until JOIN_GAME is sent#138
devamyst wants to merge 1 commit into
Axionize:lightningfrom
devamyst:fix/vulcan-join-game-ping-order

Conversation

@devamyst

Copy link
Copy Markdown

Summary

  • Fixes Vulcan compatibility (Fixing compatibility with Vulcan #127). Grim could send a ping/transaction packet before JOIN_GAME was actually written to the client (e.g. from the PLAYER_ABILITIES send handler during the join sequence). Vulcan treats JOIN_GAME as the first PLAY packet it expects, so an early ping showed up as an out-of-order confirmation and got the player kicked.
  • GrimPlayer now tracks whether JOIN_GAME has actually been sent (hasSentJoinGamePacket), set via event.getTasksAfterSend() in PacketPlayerRespawn's existing JOIN_GAME handler, and sendTransaction() withholds until that flag is true.

Important: disable-pong-cancelling must stay false

This PR does not replace the disable-pong-cancelling config option, and does not require enabling it. Server admins running Vulcan alongside Grim should leave disable-pong-cancelling: false (the default).

We confirmed this directly: a separate, ongoing mid-session kick (out-of-order packet (Received X ≠ Expected Y), unrelated to join timing) was traced to disable-pong-cancelling being set to true on a test server — a workaround suggested elsewhere in #127 that turned out to make things worse. With it true, Grim stops cancelling its own transaction/pong responses, so Vulcan's own listener sees confirmation IDs it never sent and kicks for the mismatch. Setting it back to false (default LOWEST-priority cancellation in PacketPingListener) resolved that kick. Both fixes (this PR + correct config) were needed together to fully resolve Vulcan compatibility in our testing.

Test plan

  • Compiles (./gradlew build)
  • Verified on a live server running Grim + Vulcan together (leafmc.one, 1.21.11) — join-time and mid-session out-of-order kicks both resolved with this change + disable-pong-cancelling: false
  • Would appreciate a maintainer/Vulcan-side sanity check given the cross-plugin nature of this issue

… is sent

Vulcan expects JOIN_GAME to be the first PLAY packet it sees. Grim could
send a ping/transaction packet before JOIN_GAME actually went out (e.g.
in the PLAYER_ABILITIES send handler during the join sequence), which
Vulcan then flagged as an out-of-order confirmation packet and kicked
for. GrimPlayer now tracks whether JOIN_GAME has been written to the
client and sendTransaction() withholds until that's true.

Fixes Axionize#127

Note: this does not replace disable-pong-cancelling. That setting must
stay false (the default) for Vulcan compatibility — enabling it stops
Grim from cancelling its own transaction/pong responses, so Vulcan's
own listener ends up seeing IDs it didn't send and kicks for a mismatch
mid-session. Server admins running Vulcan alongside Grim should leave
disable-pong-cancelling: false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant