Skip to content

fix: Align lockstep player IDs with command player IDs in multiplayer#1175

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-multiplayer-player-ids-ym3Jh
Jan 31, 2026
Merged

fix: Align lockstep player IDs with command player IDs in multiplayer#1175
braedonsaunders merged 1 commit into
mainfrom
claude/fix-multiplayer-player-ids-ym3Jh

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

Fixes two critical multiplayer issues:

  1. Lockstep barrier used network peer IDs (pubkeys) but commands used slot IDs (player1, player2), causing lockstep to wait indefinitely.

  2. Command validation only checked against the first remotePeerId, rejecting valid commands from other peers in 3+ player games.

Changes:

  • Add peer-to-slot ID mapping (peerToSlotId) to multiplayerStore
  • Set up mapping when peers connect (host: guest.pubkey -> guest.slotId, guest: hostPeerId -> host's slot)
  • Update getExpectedPlayerIds() to return slot IDs via getAllRemoteSlotIds()
  • Update command validation to accept commands from any mapped remote slot

https://claude.ai/code/session_01PqaegjhvDFuLUVK3bDmsgr

Fixes two critical multiplayer issues:

1. Lockstep barrier used network peer IDs (pubkeys) but commands used
   slot IDs (player1, player2), causing lockstep to wait indefinitely.

2. Command validation only checked against the first remotePeerId,
   rejecting valid commands from other peers in 3+ player games.

Changes:
- Add peer-to-slot ID mapping (peerToSlotId) to multiplayerStore
- Set up mapping when peers connect (host: guest.pubkey -> guest.slotId,
  guest: hostPeerId -> host's slot)
- Update getExpectedPlayerIds() to return slot IDs via getAllRemoteSlotIds()
- Update command validation to accept commands from any mapped remote slot

https://claude.ai/code/session_01PqaegjhvDFuLUVK3bDmsgr
@braedonsaunders braedonsaunders merged commit 8475d48 into main Jan 31, 2026
3 of 4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-multiplayer-player-ids-ym3Jh branch January 31, 2026 05:18
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.

2 participants