feat(phase6): Add sounds, team chat, reactions, monitor, settings, and CSV import/export

Sound System:
- Add soundStore with volume/mute persistence
- Add useSound hook with Web Audio API fallback
- Add SoundControl component for in-game volume adjustment
- Play sounds for correct/incorrect, steal, timer, victory/defeat

Team Chat:
- Add TeamChat component with collapsible panel
- Add team_message WebSocket event (team-only visibility)
- Store up to 50 messages per session

Emoji Reactions:
- Add EmojiReactions bar with 8 emojis
- Add ReactionOverlay with floating animations (Framer Motion)
- Add rate limiting (1 reaction per 3 seconds)
- Broadcast reactions to all players in room

Admin Monitor:
- Add Monitor page showing active rooms from Redis
- Display player counts, team composition, status
- Add ability to close problematic rooms

Admin Settings:
- Add Settings page for game configuration
- Configure points/times by difficulty, steal penalty, max players
- Store config in JSON file with service helpers

CSV Import/Export:
- Add export endpoint with optional filters
- Add import endpoint with validation and error reporting
- Add UI buttons and import result modal in Questions page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-26 08:58:33 +00:00
parent 90fa220890
commit 720432702f
23 changed files with 2753 additions and 51 deletions

View File

@@ -0,0 +1,22 @@
from pydantic import BaseModel
from typing import Dict
class GameSettingsSchema(BaseModel):
"""Schema for game configuration settings."""
points_by_difficulty: Dict[str, int]
times_by_difficulty: Dict[str, int]
steal_penalty_percent: int
max_players_per_team: int
steal_time_percent: int
class Config:
json_schema_extra = {
"example": {
"points_by_difficulty": {"1": 100, "2": 200, "3": 300, "4": 400, "5": 500},
"times_by_difficulty": {"1": 15, "2": 20, "3": 25, "4": 35, "5": 45},
"steal_penalty_percent": 50,
"max_players_per_team": 4,
"steal_time_percent": 50
}
}