14 Commits
Author SHA1 Message Date
dingo 41c18da1ed Update client screens and deck editor 2026-05-19 17:16:19 -04:00
7884051cad fix(init): prevent stale sync timeout from firing after reset
SceneTreeTimer callbacks captured _sync_timeout by reference rather
than by identity, so a replaced timer's closure still passed the
null-check and called _on_sync_failed even though progress was
actively arriving. Fix by capturing the timer instance in the closure
and bailing out if _sync_timeout no longer points to it.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-28 17:19:26 -04:00
dingo c3a39fd7a1 hmmm 2026-04-12 14:44:37 -04:00
dingo 4302a0f048 UI improvement start 2026-04-10 11:14:10 -04:00
2a37f90746 Add 20-second sync watchdog to fix random hung init screen
If sync_complete or sync_failed never fires (e.g. background refresh
_is_syncing guard eats the start_sync call and signals were already
emitted before init_screen connected them, or a server request is
in-flight with no reply), the player was silently stranded with no
retry path and had to relaunch.

Adds a SYNC_TIMEOUT_SEC = 20 watchdog timer started in _do_sync() and
reset on each sync_progress page. If it fires, surfaces the retry
button with a "Timed out" message.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-31 13:25:27 -04:00
3517ee30b5 Fix affinity logic and wire BoardTemplateCache init fetch
Builder (BoardTemplateBuilderPage):
- ComputeDisplayAffinity: rewritten to exactly mirror AffinitySystem.Resolve.
  Was reversed on gateway direction ((Void,Basic)→Gateway, (Basic,Void)→Basic)
  and silently returned Void for (Void,Aether) instead of UnstableAether.
- PaintMap: corrected B1/B2 slot assignments to match AffinitySystem.Decompose:
  basics now use (Void,Basic), gateways use (Basic,Void), UnstableAether and
  Aether both use canonical (Void,Aether).

Client (init_screen):
- Fire BoardTemplateCache.fetch() in parallel with ContentCache.start_sync()
  so the template list is populated before the player reaches a lobby screen.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-27 21:23:23 -04:00
Shard 8736217241 Harden multiplayer rejoin and eliminate-concede cleanup semantics 2026-03-27 14:06:50 +00:00
843660dfce Implement cubemap skybox, multi-active skyboxes, and 2D scene backgrounds
- Server: Add SkyboxType + 6 CubeUrl fields to SkyboxDefinition entity
- Server: EF migration AddSkyboxCubemapType
- Server: GetSkyboxConfigResponse now returns array of all active skyboxes
- Admin: SkyboxManagerPage supports Panoramic/AnimatedPanorama/Cubemap types,
  6 face URL fields for cubemap, and independent per-skybox active toggle
- Client: ContentCache fetches + caches skyboxes; adds get_random_skybox,
  get_skybox_bg_url, load_texture_async, apply_scene_background helpers
- Client: game_screen replaces _fetch_skybox with ContentCache-based approach;
  adds _load_cubemap_skybox / _apply_cubemap_images / _apply_cubemap_material
- Client: 12 2D scene scripts call ContentCache.apply_scene_background(self)
  in _ready() to replace solid-color backgrounds with CDN skybox images

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-25 16:11:02 -04:00
dingo f679fd3828 UI + Chat fix 2026-03-25 14:14:20 -04:00
a46be8e06c Init screen: loading bar + version check hang fix
Replace the sync card count with a ProgressBar that pulses
indeterminately during version check, then fills 5→85% during
content sync, 90% during active-session check, 100% on done.

Add an 8-second timeout on version.check so a silent server-side
hang (server receives packet but never replies) auto-proceeds to
sync instead of freezing the init screen indefinitely.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-23 12:14:42 -04:00
efcd693d60 Fix null-session prompt, stale ready state, spectator UI, and admin cancel
- init_screen.gd: handle null sessionId from game.get_active_session.ack
  properly — str(null)="<null>" which passed the is_empty() check causing
  every player to see "active game in progress (null phase)" on login
- CustomLobby.gd: call clear_state() at the start of create() and join() so
  that i_am_ready/partner_ready are reset between lobbies — fixes players
  appearing instantly ready when entering a new lobby after a previous game
- game_screen.gd: in _setup_spectator_ui(), hide _settings_btn (prevents
  accessing the Concede button) and add a programmatic "Leave" button that
  calls Game.stop_spectating() and navigates back to FreePlayScreen
- CustomLobbiesPage.razor: add Cancel button (admin) for Open/Full lobbies;
  directly sets Status=Cancelled and refreshes the list

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-19 10:49:46 -04:00
3ba33275e3 Feature: model retry + rejoin on login + 5-min inactivity detection
**Feature 1 — Model retry (client)**
- `ModelCache.gd`: add `evict(url)` to remove failed entries so re-download is possible
- `game_screen.gd`: when GLB load fails, `_schedule_model_retry` queues a 60-second
  retry (up to 10 attempts); `_do_model_retry` evicts + re-downloads and swaps the
  placeholder mesh for the real model if/when it succeeds

**Feature 2 — Rejoin on login (server + client)**
- Server: `GameGetActiveSessionHandler` (`game.get_active_session`) — returns the
  caller's active session ID + phase, or null when no session exists
- Client: `init_screen.gd` checks for an active session after content sync; shows
  a "Rejoin / Concede" dialog when one is found; rejoin navigates to GameScreen with
  the session ID already set so `send_ready` → `AlreadyStarted` → `_fetch_state`

**Feature 3 — 5-minute inactivity detection (server + client)**
- `GameSession`: add `LastActionAt` column + EF migration
  (`20260317000001_AddLastActionAt`)
- `GameHandlerBase.SaveStateAsync`: sets `session.LastActionAt` on every action
- `GameInactivityMonitorService`: background poll every 60 s; when a session hasn't
  had an action in ≥ 5 min, pushes `game.inactive_warning` to the stalled player and
  `game.opponent_inactive` to their opponent (once per session per server lifetime)
- `GameForceConcedeHandler` (`game.force_concede`): lets the waiting player claim
  the win; validates caller is not the active player and `LastActionAt` is stale
- `Game.gd`: new `opponent_inactive` / `inactive_warning` signals + push handlers +
  `send_force_concede()` helper
- `game_screen.gd`: handles `opponent_inactive` with Accept/Wait dialog;
  handles `inactive_warning` with informational popup

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-17 09:05:05 -04:00
dingo 0945208e48 gRPC Error 2026-02-28 08:40:05 -05:00
2d6b20f3cb Godot client: version check + content sync + caching architecture
Client flow after auth is now:
  LoginScreen → auth_success → InitScreen → MainScreen

autoloads/ContentCache.gd
  - Cursor-based incremental sync via content.sync (PageSize=200)
  - Merges definition DTOs in-memory (id → Dictionary)
  - Persists to user://content/defs.json on sync completion
  - Incremental on repeat launches: 0 round trips when nothing changed
  - Signals: sync_progress(fetched_total), sync_complete(total), sync_failed(error)

scenes/init/InitScreen.tscn + init_screen.gd
  - Step 1: version.check (clientVersion="0.1.0", platform="web")
      UpdateRequired  → show "please refresh" panel, block
      UpdateAvailable → soft banner, continue
      Ok              → continue
      DISCONNECTED    → wait for Network.connected (one-shot), retry
      other error     → warn + proceed (don't block player on non-critical check)
  - Step 2: ContentCache.start_sync()
      Shows running card count while pages arrive
      On sync_complete: transition to MainScreen
      On sync_failed: show error + Retry button

scenes/login/login_screen.gd
  - _go_to_main() now routes to InitScreen instead of MainScreen directly

project.godot
  - ContentCache registered as autoload (loads before Auth)
  - pointing/emulate_touch_from_mouse=true for desktop browser testing

Caching architecture decision (see plan):
  - Layer 1 (definitions/text): always sync all eagerly — no privacy concern
  - Layer 2 (2D art): lazy by definition ID, CDN fetch on demand
  - Layer 3 (3D models/animations): set-bundle granularity + server-injected
    noise during match pre-warm to prevent cache oracle attack
    (Layer 2/3 implementation is future work)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-02-27 21:31:47 -05:00