Trik: zmetanie po kazdom stichu, ovalne meno, dohrata hra mizne z lobby
Zmetacia animacia doteraz dobehla len na konci kola/serie (dlha pauza) -- mid-round ju hned prerusila dalsia zahrata karta, lebo `finishing` zavisela na activeCards === 0. Teraz drzi kopku v strede az do konca animacie a zablokuje hranie karty, kym sa nezmetie; boot-guard zabrani falosnej animacii pri reconnecte na uz rozohratu hru. PlayerCircle: ovalne oramovanie mena teraz rastie s dlzkou mena (fit-content + strop + ellipsis) namiesto pevnej sirky. api: hra dohrata do konca (4 serie) sa hned vytrati z lobby zoznamu, namiesto toho aby visela navzdy ako "Začatá"/"Pokračovať" aj ked uz ma v DB ended_at. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+13
-1
@@ -214,7 +214,13 @@ class CardStatusEncoder(JSONEncoder):
|
||||
|
||||
|
||||
def public_games() -> list:
|
||||
"""Public lobby view — no sids, no reconnect tokens."""
|
||||
"""Public lobby view — no sids, no reconnect tokens.
|
||||
|
||||
A game that finished naturally (all 4 series played out) stays in the
|
||||
`games` dict for reconnect purposes (e.g. a reload while still on the
|
||||
GameOver screen), but it has nothing left to offer the lobby — drop it
|
||||
here rather than have it linger forever as a "started"/resumable entry.
|
||||
"""
|
||||
return [
|
||||
{
|
||||
"gid": g.gid,
|
||||
@@ -231,6 +237,7 @@ def public_games() -> list:
|
||||
],
|
||||
}
|
||||
for g in games.values()
|
||||
if g.bridzik_core is None or not g.bridzik_core.is_completed()
|
||||
]
|
||||
|
||||
|
||||
@@ -704,6 +711,11 @@ async def play_card(sid, card_key):
|
||||
await send_game_status(game.gid)
|
||||
for player in game.players:
|
||||
await send_player_cards(game.gid, player.order, player.sid)
|
||||
# A naturally-finished game (all 4 series played out) has nothing left to
|
||||
# offer the lobby -- refresh the list so it drops out immediately instead
|
||||
# of lingering as "started"/resumable until someone happens to leave it.
|
||||
if core.is_completed():
|
||||
await broadcast_lobby()
|
||||
|
||||
|
||||
# --- history (read-only) --------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user