feat(web): add multiplayer lobby, game, and score screen routes

- lobby.$code.tsx: waiting room with live player list via lobby:state,
  copyable lobby code, host Start Game button (disabled until 2+ players),
  sends lobby:join on connect, lobby:leave on unmount
- game.$code.tsx: in-game view, sends game:ready on mount to get current
  question, handles game:question/answer_result/finished messages,
  reuses QuestionCard component, shows round results after each answer
- MultiplayerScoreScreen: final score screen sorted by score, highlights
  winner(s) with crown, handles ties via winnerIds array, Play Again
  navigates back to lobby, Leave goes to multiplayer landing
- GameRouteSearchSchema added to shared for typed lobbyId search param
  without requiring Zod in apps/web
This commit is contained in:
lila 2026-04-18 10:33:48 +02:00
parent d064338145
commit f2eb6ce17f
5 changed files with 340 additions and 11 deletions

View file

@ -9,6 +9,7 @@ export const Route = createFileRoute("/multiplayer")({
if (!session) {
throw redirect({ to: "/login" });
}
return { session };
},
});