Wire client SignalrService to the live .NET backend

- @microsoft/signalr client implementing OnlineService: REST auth, hub
  matchmaking, server-driven game state (onState), play/trump, reactions;
  delegates not-yet-server-backed features (profile/friends/shop/chat/rooms)
  to the mock. Selected via NEXT_PUBLIC_USE_SERVER=1 (NEXT_PUBLIC_SERVER_URL)
- game-store live mode: enterServerMatch + applyServerState (maps server DTO,
  hides opponent hands, tally + SFX), inputs route to the hub; no local engine
- MatchmakingScreen auto-enters the live match when the server signals ready
- Verified end-to-end via scripts/live-test.mjs (auth -> hub -> match -> state)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 13:13:48 +03:30
parent a3b797c8a3
commit ceccf70de7
11 changed files with 707 additions and 5 deletions
+6
View File
@@ -463,6 +463,12 @@ export class MockOnlineService implements OnlineService {
for (const cb of this.reactionCbs) cb(0, reaction);
}
// The mock drives the game locally (game-store), so these are no-ops.
readonly live = false;
onState(): Unsubscribe { return () => {}; }
playCard(): void {}
chooseTrump(): void {}
onReaction(cb: (seat: number, reaction: string) => void): Unsubscribe {
this.reactionCbs.add(cb);
if (this.reactionTimer == null) {