Skip to content

fix: preserve spectator audio behavior in MainThreadEventHandler#1304

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-event-handler-init-WzsJX
Feb 3, 2026
Merged

fix: preserve spectator audio behavior in MainThreadEventHandler#1304
braedonsaunders merged 1 commit into
mainfrom
claude/fix-event-handler-init-WzsJX

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

Previously, MainThreadEventHandler was updated to take localPlayerId as a constructor parameter with a fallback to 'player1'. This broke spectator mode because spectators (localPlayerId=null) were incorrectly treated as player1, causing them to hear local-only audio/alerts.

Changes:

  • Accept null localPlayerId (spectator mode) instead of defaulting to 'player1'
  • Add setLocalPlayerId() method to update player ID when it changes mid-session
  • Subscribe to store changes to handle spectator mode transitions (e.g., after player defeat via enableSpectatorMode())

This restores the original behavior where spectators stay silent for local-only audio events.

https://claude.ai/code/session_01Uc8iUFPTi7sjC8S94BxAbY

Previously, MainThreadEventHandler was updated to take localPlayerId as a
constructor parameter with a fallback to 'player1'. This broke spectator mode
because spectators (localPlayerId=null) were incorrectly treated as player1,
causing them to hear local-only audio/alerts.

Changes:
- Accept null localPlayerId (spectator mode) instead of defaulting to 'player1'
- Add setLocalPlayerId() method to update player ID when it changes mid-session
- Subscribe to store changes to handle spectator mode transitions (e.g., after
  player defeat via enableSpectatorMode())

This restores the original behavior where spectators stay silent for local-only
audio events.

https://claude.ai/code/session_01Uc8iUFPTi7sjC8S94BxAbY
@braedonsaunders braedonsaunders merged commit 7925c47 into main Feb 3, 2026
@braedonsaunders braedonsaunders deleted the claude/fix-event-handler-init-WzsJX branch February 3, 2026 16:19
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