Files
Stargate/stargate-paper/src/main
Michael Burgess 8a8faf8ffe Fix double-dialing race and cross-server landing race
Double-dial: isOpen() only becomes true once the chevron animation
finishes, so a second click during that animation (another player,
or the same player double-clicking) passed the existing guard and
started an overlapping dial. RuntimeGate now has a separate
isDialing() flag set the instant dial() starts and cleared only when
closeGate() runs, so a gate stays blocked for its entire
dialing-through-open lifecycle, not just while fully open.
GateManager.dial() also defensively re-checks this itself and returns
false if either gate is busy, in case two calls race in before the
caller's own guard catches it.

Cross-server landing: the proxy only sends its "deliver" message
after confirming the server switch succeeded, so there's no
guaranteed ordering between that message arriving and this backend
finishing its own join processing for the player. A single
Bukkit.getPlayer() null-check at message-receipt time could lose that
race and silently drop the landing teleport, leaving the player at
the server's normal spawn instead of the gate - which is what was
being reported. CrossServerBridge now stashes the pending delivery
and retries on PlayerJoinEvent as well, so it lands regardless of
which order the message and the join actually resolve in.
2026-08-09 14:22:13 -04:00
..