Add game start functionality with automatic player chip generation

Implemented host-controlled game start mechanism that generates unique player chips from user names. Added `started_at` timestamp to games and new `game_chips` table to store player identifiers. Chips are created using first name initial plus first two surname letters (e.g., SNE for Sascha Nesterovic) with automatic conflict resolution. Updated frontend to display start button for hosts, show game status, and populate chip selection modal
This commit is contained in:
2026-08-01 18:29:02 +02:00
parent 3904ba403a
commit a7ac55c598
8 changed files with 160 additions and 10 deletions
+8
View File
@@ -136,6 +136,14 @@ Very small, pragmatic auto-migration (no alembic).
except Exception:
db.rollback()
# started_at: games are open for joining until the host starts them
if not _has_column(db, "games", "started_at"):
try:
db.execute(text("ALTER TABLE games ADD COLUMN started_at DATETIME"))
db.commit()
except Exception:
db.rollback()
# host_user_id (nice to have for "only host can set winner")
if not _has_column(db, "games", "host_user_id"):
try: