Commit Graph
480 Commits
Author SHA1 Message Date
dingo d28d02428d Merge pull request 'Revert BoardTemplateBuilderPage hex polygon changes' (#1) from claude/nifty-galileo into main
Reviewed-on: dingo/SOR#1
2026-04-06 00:28:35 +00:00
dingoandClaude Sonnet 4.6 aa0b893bb5 Revert BoardTemplateBuilderPage hex polygon changes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 20:26:56 -04:00
dingo 5b9970fe4b template hex builder fix2 2026-04-05 15:52:27 -04:00
dingo 323de3982d template hex builder fix 2026-04-05 14:30:00 -04:00
58c5778bfb Remove stale per-page Authorize(Roles) attributes
All 26 pages had @attribute [Authorize(Roles = "Admin,SuperAdmin")] which
conflicts with the Keycloak role sor-admin. The fallback policy in Program.cs
already enforces RequireRole("sor-admin") globally, making these attributes
redundant. Removing them fixes Access Denied for all admin pages.

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-04 14:00:03 -04:00
e4ddd801e3 Store DataProtection keys in Redis to fix cross-pod cookie decryption
Without shared key storage, pod A's cookies were unreadable by pod B, causing
an infinite OIDC redirect loop that appeared as access denied. Keys are now
persisted under SOR.Admin:DataProtection-Keys in the existing Redis instance.

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-04 13:34:44 -04:00
f9ec834a7a Add role-extraction diagnostic log to OnTicketReceived
Logs extracted Keycloak roles at login time to diagnose access-denied failures.

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-04 13:16:52 -04:00
33b544a404 Pin static OIDC config at startup to fix per-request discovery failures
Replaces the default ConfigurationManager with a FixedConfigurationManager
that returns the pre-fetched OpenIdConnectConfiguration synchronously, so
per-request GetConfigurationAsync can never fail due to network errors or
cancellation-token / lock-contention issues in the dynamic manager.

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-04 12:54:27 -04:00
63f25a3764 Log actual OIDC discovery failure at startup (SOR.Admin)
Eagerly fetch the Keycloak discovery document after app.Build() so any
network/DNS/SSL failure appears in startup logs with the real exception and
the exact URL being fetched, rather than surfacing later as the cryptic
"Cannot redirect to the authorization endpoint" 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-04-04 12:28:05 -04:00
d6b99a9fe5 Add anonymous /health endpoint for k8s probes (SOR.Admin)
Without it, liveness/readiness probe requests hit the fallback auth policy,
trigger an OIDC challenge, fail with 500, and restart the pod in a loop —
which is the root cause of the repeated auth instability.

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-04 12:16:39 -04:00
6fc711323b Add Keycloak:MetadataAddress override for in-cluster OIDC discovery (SOR.Admin)
The pod cannot reach auth.aeternalisgames.com from inside the cluster (DNS/
network policy), so the OIDC middleware fails to fetch the discovery document
and throws "Cannot redirect to the authorization endpoint".

Add optional Keycloak__MetadataAddress env var. When set, the middleware
fetches the discovery doc from that URL (internal k8s service, HTTP allowed)
while still validating JWT issuer against the public Authority URL.

Set in sor-config:
  Keycloak__MetadataAddress=http://<keycloak-service>.<ns>.svc.cluster.local:<port>/realms/aeternalis

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-04 12:07:41 -04:00
bea1de3eb8 Fail fast on missing Keycloak config; remove UseHttpsRedirection (SOR.Admin)
- Validate Keycloak:Authority and Keycloak:ClientId at startup with a clear
  InvalidOperationException. Previously a missing env var produced the cryptic
  "Cannot redirect to the authorization endpoint" error on every request.

- Remove app.UseHttpsRedirection(). The pod runs plain HTTP on :8080; TLS is
  terminated at the ingress. The middleware had no HTTPS port to redirect to,
  generating a warning on every request and potentially interfering with the
  OIDC flow.

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-04 11:32:13 -04:00
20e5f5f212 Fix role claim mapping: OnTicketReceived + JsonWebTokenHandler (SOR.Admin)
ctx.TokenEndpointResponse?.AccessToken in OnTokenValidated is not reliably
populated; if null the silent catch left the principal with no role claims,
causing 403 on every request despite successful Keycloak auth.

Switch to OnTicketReceived which fires after SaveTokens — access token is
guaranteed present via ctx.Properties.GetTokenValue("access_token").
Use JsonWebTokenHandler.ReadJsonWebToken() instead of manual base64 decode
to eliminate silent parse failures. Extracts both realm_access.roles and
groups claims so either Keycloak assignment style works.

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-04 11:26:24 -04:00
1b4a652e28 Extract Keycloak group membership as role claims (SOR.Admin)
realm_access.roles only contains directly-assigned realm roles. When the user
is a member of a Keycloak group (e.g. "sor-admin"), the group appears under
the groups claim as "/sor-admin". Parse both sources so group membership
satisfies RequireRole("sor-admin") the same way a realm role would.

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-04 11:02:30 -04:00
Shard 53f71db7ab fix(admin): require sor-admin Keycloak realm role 2026-04-04 14:40:05 +00:00
Shard c1c0908903 fix(admin): require air-admin Keycloak realm role 2026-04-04 14:38:23 +00:00
9f5bcf4d21 Fix Keycloak auth redirect loop in SOR.Admin (3 bugs)
1. Remove GetClaimsFromUserInfoEndpoint=true — the extra pod→Keycloak HTTPS
   call was throwing (SSL/network error from within the cluster), which hit the
   exception handler and triggered a protected /Error redirect, starting the loop.
   Roles are extracted from the access token payload instead (no HTTP call needed).

2. Set AccessDeniedPath=PathString.Empty on the cookie handler — the default
   /Account/AccessDenied path doesn't exist in this app, causing the cookie
   middleware to redirect there infinitely. Empty path returns 403 directly.

3. Replace UseExceptionHandler("/Error") with an inline handler — /Error is a
   protected Blazor route; redirecting to it while unauthenticated re-triggered
   the auth challenge, feeding the redirect loop. Inline handler returns 500
   without any redirect.

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-04 10:16:42 -04:00
Shard 2ec14ebbe2 fix(admin): inject Keycloak client secret into sor-admin deployment 2026-04-04 13:51:51 +00:00
6f4c729582 Fix Keycloak role extraction: use UserInfo endpoint (SOR.Admin)
OnTokenValidated + manual access-token base64 decode was unreliable.
Switch to GetClaimsFromUserInfoEndpoint=true and extract realm_access.roles
in OnUserInformationReceived where the UserInfo JSON is already parsed into
ctx.User (JsonDocument) — no manual JWT decoding needed.

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-04 09:36:33 -04:00
b8cf526022 Fix OIDC redirect_uri mismatch behind k8s ingress (SOR.Admin)
The admin pod runs plain HTTP; the ingress terminates TLS. Without forwarded
headers, ASP.NET Core built the redirect_uri as "http://control.aeternalisgames.com/signin-oidc"
but Keycloak only accepts the https:// variant, causing "invalid_redirect_uri".

Add UseForwardedHeaders() with XForwardedProto/Host/For before UseAuthentication
so the OIDC middleware sees the correct public https scheme and hostname when
constructing the callback URL.

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-04 09:20:37 -04:00
fa695649f6 Replace SOR.Admin email/password login with Keycloak OIDC
Admin panel now delegates authentication entirely to Keycloak using the
Authorization Code flow. The local Identity password form and
IdentityRevalidatingAuthenticationStateProvider are removed. Access requires
the "admin" Keycloak realm role, mirroring the game's role-based auth model.

- Program.cs: AddOpenIdConnect("Keycloak") with cookie session; /auth/challenge
  triggers the OIDC flow; /auth/logout signs out of both cookie and Keycloak SSO
- Login.razor: replaced HTML form with an immediate redirect to /auth/challenge
- IdentityRevalidatingAuthenticationStateProvider.cs: deleted (no longer needed)
- appsettings.json: Keycloak:Authority / ClientId / ClientSecret section added
- Directory.Packages.props: pinned Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.0
- SOR.Admin.csproj: added OpenIdConnect package reference

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-04 08:46:27 -04:00
cfb10ae4d0 Fix Keycloak auth failures: audience validation + packet drain race
Server — JWT audience validation failing:
  Keycloak does not include the client ID in the `aud` claim by default
  (uses "account"). ValidateAudience=true with ValidAudience="sor-game"
  rejected every token. Disabled audience validation — issuer + signature
  + realm role check is sufficient for a single-realm deployment.
  Bumped JWT validation failure log to Information so it appears in default logs.

Client — DISCONNECTED instead of AUTH_FAILED on rejected auth:
  When the server sends an error packet immediately followed by a close frame,
  the socket transitions to STATE_CLOSING before the next _process frame.
  Network.gd returned early during STATE_CLOSING without draining packets,
  leaving the pending request unresolved. _on_ws_closed then failed it as
  DISCONNECTED. Now drains packets during STATE_CLOSING so the error packet
  is resolved with the correct error code before the close is processed.

  Also added "invalid_token", "role_required", "invalid_payload",
  "auth_service_unavailable", "account_creation_failed" to the close reason
  → error code mapping so they surface as AUTH_FAILED / AUTH_SERVICE_UNAVAILABLE
  rather than DISCONNECTED even in the fallback path.

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-02 19:36:09 -04:00
79fa08e192 Fix Keycloak: scene reload on error, web signal missed, redirect URI
PC — scene reloading on auth error:
  Auth.gd's keycloak error handler called change_scene_to_file(LoginScreen)
  after emitting auth_failed, which reloaded the scene and wiped the error
  message before the user could see it. Removed the scene change — the
  login screen is already active and handles auth_failed itself.

Web — token_received signal never handled after page redirect:
  login_screen._ready() returned early when Keycloak.auth_in_progress was
  true, before connecting Keycloak.token_received. When the exchange
  completed nobody was listening, so the game sat frozen. Signals are now
  connected before the early-return check.

Web — fragile redirect URI and sessionStorage injection:
  JavaScriptBridge.eval return value could stringify as "<null>". Now uses
  separate origin + pathname evals with a null check. sessionStorage items
  and the final navigation use uri_encode() + decodeURIComponent() instead
  of manual quote-escaping, preventing injection from PKCE values.

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-02 19:20:04 -04:00
1c6064e157 Fix Keycloak auth: DISCONNECTED retry + web export support
PC native — connection lost, retrying:
  _send_keycloak_auth's DISCONNECTED handler was clearing _pending_keycloak_token
  (taken at top of function) without restoring it, so the next _on_network_connected
  had no token to retry with. Restore it: _pending_keycloak_token = token.

Web export — could not bind a local redirect port:
  Godot's HTML5 export cannot create TCP server sockets. Add a separate web
  code path in Keycloak.gd:
  - start_auth_flow() detects OS.get_name() == "Web" and navigates the page
    to Keycloak, persisting PKCE state (verifier, state, redirect_uri) in
    sessionStorage before the page leaves.
  - _check_web_callback() (called in _ready()) detects the ?code= params on
    return, recovers state from sessionStorage, cleans the URL via
    history.replaceState, then calls _exchange_code().
  - auth_in_progress flag lets login_screen show "Completing sign-in..."
    while the token exchange is in flight after page reload.
  Requires the web game's origin to be registered as a valid redirect URI
  in the Keycloak sor-game client.

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-02 16:39:13 -04:00
60d6098c11 Fix Keycloak login: force fresh WebSocket before auth.keycloak
The server closes idle unauthenticated connections after AuthTimeoutMs
(10 s). A user authenticating in the browser takes longer than that, so
the socket the client held while the browser was open is already dead
when token_received fires. Sending auth.keycloak on that stale
connection produces no reply and the scene never changes.

Fix: login_with_keycloak() now calls Network.force_reconnect() instead
of sending immediately. _on_network_connected() then sends auth.keycloak
as the guaranteed-first message on the fresh connection.

Also: DISCONNECTED errors in the auth.keycloak error callback no longer
clear keycloak_refresh_token, preserving silent re-auth on transient drops.

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-02 16:20:45 -04:00
39253716ad Replace login/register forms with Keycloak sign-in flow
- LoginScreen: single "Sign in with Aeternalis" button replaces two-tab
  email/password/register layout; all credential encryption removed
- login_screen.gd: wires Keycloak.token_received → Auth.login_with_keycloak,
  handles auth_error and auth_failed signals
- Auth.gd: rewritten to use Keycloak session tokens; stores Keycloak refresh
  token for silent re-auth; calls Keycloak.revoke on logout
- Keycloak.gd: new autoload implementing Authorization Code + PKCE with
  loopback redirect, silent refresh, and fire-and-forget revocation
- project.godot: register Keycloak as autoload singleton

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-02 15:04:43 -04:00
d5363fa014 Add Keycloak authentication via Authorization Code + PKCE
- auth.proto: add ExchangeKeycloakToken RPC + request/response messages
- KeycloakOptions: binds Keycloak:Authority + Keycloak:ClientId from config
- KeycloakTokenValidator: validates Keycloak JWTs via OIDC discovery/JWKS;
  extracts sub, email, preferred_username, realm_access.roles
- AuthGrpcHandler.ExchangeKeycloakToken:
  - validates JWT and requires "player" realm role
  - lazy-migrates existing accounts by email on first Keycloak login
  - creates new passwordless accounts from Keycloak claims
  - syncs preferred_username → DisplayName on every login
  - single-session policy: revokes prior sessions before issuing SOR token
- AuthGrpcHandler.Register: assign "player" role to all new registrations
- ServiceRegistration: wire KeycloakOptions + KeycloakTokenValidator as singleton
- Admin SeedAsync: seed player, moderator, card_builder roles alongside Admin/SuperAdmin
- IGatewayAuthValidator / GatewayAuthValidator: add ExchangeKeycloakTokenAsync
- ConnectionLoop: handle auth.keycloak message type → auth.keycloak.ack
- appsettings.json: add Keycloak section (Authority + ClientId, overridable via env)

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-02 14:27:32 -04:00
78f55930a0 Fix team play: correct team indices, team-aware unit colors and ownership
Server:
- Add TeamCount, PlayerOneTeamIndex, PlayerTwoTeamIndex to GameSession so
  team assignments survive the lobby→game transition without recomputation
- GameLobbyReadyHandler.StartGameAsync: apply TeamAssignmentsJson (host custom
  reassignments) for all seats; store P1/P2 team indices on the session
- GameReadyHandler N-player path: use session.PlayerOneTeamIndex /
  PlayerTwoTeamIndex instead of hardcoded teamCount=1 (which put both P1 and
  P2 on team 0 in every non-FFA game)
- EF migration: AddGameSessionTeamFields

Client (game_screen.gd):
- _rebuild_ownership: treat same-team allies as friendly instead of enemy
- Unit color loop: use state.teamColors palette per team instead of hardcoded
  blue (self) / red (everyone else)
- _on_game_over: derive i_won from player_outcomes[me].outcome == "Winner" so
  a teammate's final kill correctly shows "Victory!" for the whole team

Also: skip absent hex tiles in BoardTemplateBuilder SVG render

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-02 08:40:43 -04:00
f33fd4f367 Make cards and ArchSpirit in prebuilt deck editor link to their card page
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-01 22:40:22 -04:00
dingo 3418724042 Remove accidentally staged worktree submodule 2026-04-01 22:37:02 -04:00
a46f251ef2 Separate polygon sides from board radius for hex templates; fix template IsInBounds
- HexSides now stores radius+1 (for hex coordinate math); HexPolygonSides stores the corner count (3–10)
- Board.IsTemplateBased: template boards use tile existence for IsInBounds/GetNeighbors instead of the hexagonal formula, so N-gon and other custom shapes work correctly
- HexGrid.AllNeighbors: unfiltered 6-neighbor generator for template board use
- ApplyHexConfig: generates a regular N-gon on the hex canvas — tiles outside the polygon are marked absent; N corner zones auto-generated for each player count 2..N
- Admin builder UI: separate "Polygon Sides" (3–10 corners) and "Radius (tiles)" inputs
- BoardTemplate entity and migration: HexPolygonSides column added to board_templates
- BoardTemplateDto exposes HexPolygonSides to client

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-01 22:36:57 -04:00
0572aea4d2 Extend board template builder with hex SVG canvas + filter client by grid type
- Admin builder: SVG hex canvas renders when GridType=Hexagon (pointy-top hexagons, correct axial layout); square CSS grid otherwise
- Admin builder: ApplyHexSides / OnGridTypeChanged handle dimension/tile pruning; canvas header shows N/diameter for hex
- BoardTemplateDto now includes GridType and HexSides so clients can filter
- rules_editor_dialog: Board Width/Height/Shape hidden when hex selected; Hex Sides hidden when square; template picker filtered to matching grid type with live toggle

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-01 21:22:07 -04:00
a4badc276b Unit models face nearest enemy rather than fixed north/south
_idle_rotation now:
- Finds the nearest enemy body in _unit_bodies by XZ distance
- Returns atan2 toward that position minus the model's base angle
- Falls back to the original north/south heuristic when no enemy exists yet

Also refreshes idle rotation for all units on every state rebuild (step 4 in
_rebuild_units), skipping any unit currently in a move tween, so rotations
stay correct as units reposition across turns.

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-01 20:30:39 -04:00
f9832d1a1f Hex board: corner starting zones, half tile spacing
Server - MakeHexagon starting zones:
- Zones are now corner-based instead of full-edge: each zone is the corner
  tile plus (N-1)/2 tiles along each of the two edges meeting at that corner
- 2 players → opposite corners (0, 3 = right/left); 3 → every-other corner
  (0,2,4); 4 → (0,1,3,4); 5 → (0-4); 6 → all 6 corners

Client - game_screen.gd:
- Add HEX_TILE_SPACING = TILE_SPACING * 0.5 constant
- _coord_to_world: use HEX_TILE_SPACING for hex world positions
- _add_tile: tile cylinder radius scaled by HEX_TILE_SPACING
- _add_highlight: highlight cylinder radius scaled by HEX_TILE_SPACING

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-01 18:44:20 -04:00
97e7698000 Wire HexSides through custom lobby; fix boardTemplateIdOverride empty-string crash
Server:
- CustomRulesOverride: add HexSides (int?) field
- CustomLobby entity: add HexSidesOverride (int?) column
- GameUpdateLobbyRulesHandler: save HexSidesOverride, include HexSides in
  effective rules preview
- GameLobbyReadyHandler: set rules.HexSides from lobby.HexSidesOverride on
  game start
- GameSavePresetHandler: capture BoardShape + HexSides in saved presets
- Migration 20260401222603_AddCustomLobbyHexSides: adds HexSidesOverride to
  custom_lobbies; applied to pg-forge-01 via dotnet ef database update

Client:
- rules_editor_dialog: send null (not "") for boardTemplateIdOverride when no
  template selected — empty string crashed Guid? deserialisation on the server

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-01 18:28:08 -04:00
aa76ac9994 Add Grid Type toggle (Square/Hexagon) to lobby rules editor
Replaces burying "Hexagon" in the Board Shape list with a dedicated
Grid Type dropdown at the top of the BOARD section. When "Hexagon" is
selected, boardShape is forced to "Hexagon" on confirm; square boards
use the Board Shape field as before. Hex Sides remains visible for
the sides setting.

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-01 18:18:21 -04:00
8a20e56cb3 Hex tiles: use affinity-coloured cylinder placeholder, no Square fallback
When no Hex CDN model exists for an affinity, hex tiles now keep their
coloured CylinderMesh (radial_segments=6) placeholder rather than loading
a Square model or texture. Square boards are unchanged.

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-01 17:38:49 -04:00
1bd26f11be Add hex grid to lobby rules editor; fix hex model/texture CDN loading
- rules_editor_dialog: add "Hexagon" to Board Shape picker and a Hex Sides
  spinner (3–10, default 5) so custom lobbies can configure hex boards
- game_screen _add_tile: has_model check now looks for Hex-shape CDN models
  (falls back to Square), so hex tiles get height variance when a Hex model is
  registered on the CDN instead of always using the flat placeholder height
- game_screen _try_load_tile_model: texture fallback now checks shape_key
  ("Hex") first, then falls back to "Square" — consistent with model loading

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-01 17:16:22 -04:00
f85894bd81 Fix hex migration column names to PascalCase (match existing DB convention)
DB columns are PascalCase (e.g. BoardWidth, not board_width). The previous
migration used snake_case names — renamed grid_type→GridType and hex_sides→HexSides
on pg-forge-01, and updated the migration file to match so future re-runs are correct.

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-01 17:01:36 -04:00
2cfa60c7dd Add hex grid support (sides 3–10) for boards, pathfinding, LOS, and client rendering
- New HexGrid.cs: axial coord helpers, BFS neighbors, cube-lerp LOS, jump-range
- Board: HexSides property, GetNeighbors() dispatches hex/square, IsInBounds() hex-aware
- BoardShapeGenerator: MakeHexagon() with edge-based starting zones (2–6 players);
  FromTemplate() now carries HexSides through to the Board
- Pathfinding: Walk/Flight BFS uses board.GetNeighbors() (hex+square unified)
- LineOfSight: delegates to HexGrid.HasLos when hexSides > 0
- GameRules/GameRuleSet/BoardTemplate/BoardTemplateSnapshot: GridType + HexSides fields
- GameMessages BoardDto: GridType + HexSides sent to client
- GameEngine: PlaceArchSpirit range uses HexGrid.Distance on hex boards;
  Teleport LOS passes board.HexSides; ToBoardDto emits GridType/HexSides
- EF migration 20260401000000_AddHexGridSupport: grid_type + hex_sides columns on
  game_rule_sets and board_templates; applied to pg-forge-01
- Client game_screen.gd: hex coord→world (pointy-top flat layout), CylinderMesh
  tiles (radial_segments=6), _board_distance cube metric, _bfs_reachable 6-dir,
  _client_has_los cube-lerp, highlight mesh for hex tiles; reads gridType/hexSides
  from BoardDto

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-01 16:44:17 -04:00
c756b9cffa Fix highlight accuracy: BFS movement, LOS attack filtering
Movement tiles (_valid_move_tiles):
- Walk: BFS blocked by all occupied tiles (can't walk through units)
- Flight: BFS blocked only by other Flight units (flies over Walk units)
- Jump: Manhattan range, unoccupied only (was already correct)
- Teleport: Manhattan range + LOS to destination

Attack highlights (_attack_range_tiles, _valid_attack_target_coords,
_valid_attack_target_ids):
- Added AttackRequiresLos field to CardInstanceDto / ToCardInstanceDto
- Client now checks _client_has_los() for LOS-required attackers
- Tiles/units blocked by occupants are no longer highlighted as targets

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-01 11:19:24 -04:00
1d53f1046a Merge Sacrifice/Ascend/Transition into the unit ability panel
Previously, clicking an ArchSpirit showed the abilities panel AND a
separate OS-level PopupMenu for arch-spirit actions. Now everything
lives in one floating panel:

  [Abilities]        ← shown only if unit has active abilities
  ──────────
  <ability buttons>

  [ArchSpirit]       ← shown only for friendly ArchSpirit
  ──────────
  Sacrifice a Spirit  (only when valid candidates adjacent)
  Ascend              (only when tier+1 card in hand)
  Transition          (only when tier-1 card in hand)

Removed the _show_arch_spirit_menu() PopupMenu call from _select_unit().
_show_ability_panel() now builds both sections and returns early only
when both would be empty.

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 14:13:22 -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
waterss 9d0714b490 Merge branch 'main' of https://git.aeternalisgames.com/dingo/SOR 2026-03-31 11:51:28 -04:00
waterss dccdb8a4f8 SP now in Icon on bottom left of game screen, just above cards.
- Added SP and ST images in icons/
2026-03-31 11:51:15 -04:00
chase 2abfbaec3e Update README.md 2026-03-31 15:17:56 +00:00
waterss 98822819dc Add Image showing Deployment 2026-03-31 11:12:02 -04:00
waterss 318c50c2a6 Update LoginScreen 2026-03-31 10:57:43 -04:00
waterss 65d6b7f3ff Add default README.md 2026-03-31 10:38:11 -04:00
95841b724a Disable all multi-finger gestures in buttons camera mode
2-finger pinch/pan, 3-finger pan, MagnifyGesture, and PanGesture are
now gated behind gesture mode. In buttons mode only single-finger drag
(controlled by the active toggle button) affects the camera.

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 09:44:58 -04:00