Commit graph

11 commits

Author SHA1 Message Date
danny
f22007003a Herden/Gang-System + Online-Praesenz
- V11-Tabellen genutzt: Gruppen gruenden/beitreten/verlassen (group_create/join/leave)
- Praesenz: last_seen + current_room werden bei state-Polls gesetzt, heartbeat fuer Landing
- groups_my liefert Mitglieder mit Online-Status und aktueller Lobby
- index.html: 'Deine Herde'-Sektion (nur eingeloggt) mit Live-Uebersicht + 20s-Polling

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:39:27 +02:00
danny
6b21658a70 In-Game-Soundboard (einklappbar, Broadcast an alle)
- send_sound (api.php): whitelisted Sounds via active_emojis an alle Clients broadcasten
- play.html: einklappbares Soundboard-Panel unten links (Maeh/Buzzer/Drumroll/Airhorn)
- renderEmojis spielt Sound-Events via HTML5 Audio() ab (kein visuelles Element)
- sounds/README.txt erklaert, welche MP3-Dateien noch abgelegt werden muessen

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:37:19 +02:00
danny
1d3feeb2fe Fake-Werbung (Admin-Joke): Skyscraper-Banner
- API: fake_ads (public), fake_ads_all/create/toggle/delete (admin-only via requireAdminApi)
- admin.php: Karte zum Anlegen/Aktivieren/Loeschen von Fake-Anzeigen
- play.html: linke/rechte Skyscraper-Platzhalter, pollen aktive Ads und rotieren (nur Desktop)
- Reiner Joke, keine echten Werbenetzwerke

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:35:43 +02:00
danny
997ab41afd Live-Katzen-Emoji + Custom-Profil-Sticker
- 🐱 als 5. Standard-Live-Emoji (Sidebar + send_emoji allow-list)
- upload_sticker (auth.php): PNG/GIF max 500KB -> uploads/sticker/<user_id>
- Sticker-Upload-UI inkl. Vorschau in profile.php
- send_sticker (api.php): broadcastet eigenen Sticker via active_emojis (validiert Besitz)
- play.html: Sticker-Button in der Reaktions-Sidebar, fliegt animiert wie Emojis

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:32:16 +02:00
danny
182e3bfb2e Mid-Game-Join + DB-Upgrade (Migration V11, Foreign Keys)
- V11: late_join-Flag, sticker-Spalte, gtl_groups(+members), gtl_fake_ads, last_seen/current_room
- FK-Re-Engineering: user_id -> gtl_users.id ON DELETE CASCADE fuer gtl_players & gtl_round_players
  (defensiv: Orphan-Cleanup + try/catch, blockiert Migrationen nie)
- Nachzuegler: player_join bei laufender Runde -> Zuschauer (answer/vote_locked/late_join gesetzt)
- Nachzuegler aus Voting-/Reveal-Zaehlung, Auswertung, Verlauf und Statistik exkludiert
- new_round/assign_questions setzen late_join zurueck; Host-Liste zeigt Zuschauer-Icon

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:29:04 +02:00
danny
cb3e15ef85 Relaunch: Navy/Weiß-Design, Landingpage, Regeln, Chat-Overlay (Baseline)
Sichert den bisherigen Relaunch-Stand vor dem Gameplay/Community-Update:
- Neues helles Design auf allen Seiten (Landing, Spiel, Login, Profil, Admin, Setup)
- index.html = Landingpage, play.html = Spiel, regeln/datenschutz/impressum
- Chat-Overlay mit Emoji + Giphy-GIF, Lobby Teilnehmen/Starten, App-Shell

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 06:20:27 +02:00
danny
11b2b4bf4d Fix targeted reveal, live vote tally, and ghost nobody-vote display
1. Targeted reveal (Bug 1): renderPlayer now uses revealedKeys array
   instead of the old sequential revealIndex slice — so only the
   specifically clicked player's answer becomes visible to others.
   renderHost anyRevealed/round-state also switched to revealedKeys.

2. Live vote tally for players (Bug 2): after locking their own vote
   players see a live per-player tally (locked votes only) so they
   can follow the voting while waiting for others to submit.

3. Ghost nobody-vote (Bug 3): host and player tallies now filter to
   p.voteLocked before counting, so unlocked/pre-vote players no
   longer generate a phantom "Niemand" vote in the display.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 13:33:42 +02:00
danny
e3ef770c81 Compact layout, multi-vote, step reveal, imposter weights + resolve bug fix
BUG FIX: resolve_round now reads liar_keys directly from DB via
performResolveRound() helper, bypassing loadRoom()'s redaction
(liarKeys=[] when roundOutcome is null) — fixes 0 points + no_liar bug.

resolve logic extracted into performResolveRound() used by both
manual resolve_round and auto-resolve in lock_vote.

Migration V7:
- gtl_rooms: reveal_index INT DEFAULT -1, imposter_weights VARCHAR(500)
- gtl_players: vote_locked TINYINT, vote_request TINYINT

API:
- lock_vote: stores JSON votes array, locks player, auto-resolves when all locked
- request_voting: democratic vote-start; opens voting when all players request
- reveal_next: increments reveal_index one answer at a time
- reveal/reveal_all: sets reveal_index=9999 (show all)
- update_weights: saves imposter_weights JSON per room
- resolveVotes(): handles votes[] array instead of single voteFor string
- new_round: resets vote_locked, vote_request, reveal_index, active_emojis
- assign_questions: resets vote state + reveal_index on each new question set

Layout:
- wrap max-width 640→960px for grid layout
- Player view: 3-col grid (sidebar scores | gameplay | emoji reactions)
- Host view: 2-col grid (sidebar players+tally+scores | main content)
- Compact sb-row sidebar rows with avatar + name + score

Voting:
- Multi-select checkboxes (client-side) + "Stimme abschicken" lock button
- Niemand exclusive: checking it clears other selections and vice versa
- Once locked: checkboxes hidden, confirmation shown
- Auto-resolve triggers when last player locks vote

Reveal:
- "Nächste aufdecken" reveals one answer at a time via reveal_index
- "Alle aufdecken" reveals everything at once
- Host sees which answers are still hidden vs revealed
- Players only see answers up to current reveal_index

Imposter weights:
- JSON field in host UI e.g. {"3-5":1,"6-9":2,"10+":3}
- randomImposters() reads weights to pick appropriate count
- Saved per-room via update_weights API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 13:01:41 +02:00
danny
758001597c Auto-fill username + live emoji reactions
- initAuth() now sets joinName.value to logged-in username (no more hardcoded "Danny")
- Migration V6: active_emojis TEXT column on gtl_rooms
- api.php send_emoji action: appends emoji+timestamp to room, prunes entries >4s old, max 20
- loadRoom() returns activeEmojis filtered to last 4 seconds
- render() skips emoji list when diffing state (prevents poll thrash)
- Floating emoji stage: new emojis animate upward from bottom, deduplicated by ID
- Emoji bar (4 buttons: sheep/fire/laugh/thumbs) shown in player waiting card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:35:13 +02:00
danny
01cd98aaf4 Rebrand to Black Sheep Bluff + bug fixes + F5 reconnect
- Rename identity/ folder (was idetity typo), update all references
- Page title: "Black Sheep Bluff – Wer ist das schwarze Schaf?"
- Fix gtl_rooms.updated_at not updated on submit_answer and vote actions
- Implement F5 reconnect: save role/room/pkey to sessionStorage on join,
  restore on page reload via tryRestoreSession()
- Clear sessionStorage on leave()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:31:51 +02:00
danny
44e5b48c3c chore: snapshot before branding & feature pass 2026-06-14 12:25:44 +02:00