- ChatChannel: add ArchivedAt (nullable DateTimeOffset)
- ChatChannelMembership.EndMatchMembershipsAsync: set channel.ArchivedAt
so match channels are archived when games end
- GameHandlerBase.FinalizeGameAsync: add IEventBus param; compute
OriginPoints rewards scaled by rank diff; publish GameEndedEvent so
ChatLifecycleHostedService triggers archival
- GameRuleSet: add WinnerOpReward (50), LoserOpReward (10),
RankDiffOpMultiplierPct (0) with NOT NULL + defaults
- GameMessages.GameOverPush: add WinnerOpDelta / LoserOpDelta fields
- GameConcedeHandler + GameAttackHandler: inject IEventBus, pass to
FinalizeGameAsync
- Migrations: 20260309200000_AddArchivedAtToChatChannel (ChatDbContext),
20260309210000_AddOpRewardFields (GameDbContext)
- Admin GameSessionsPage: inject ChatDbContext; purge Match channels
before deleting sessions in PurgeAllAsync
- Admin RankedRulesPage: new "Origin Points Rewards" card with three
number inputs (WinnerOpReward, LoserOpReward, RankDiffOpMultiplierPct)
- Admin AccountDetail: display RankScore + OriginPoints in Profile card;
new "Award OP" card that credits OP directly to the account balance
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>
- ModelCache: switch GLTFDocument.append_from_buffer (was append_from_file
which returned ERR_BUSY/43); validate GLB magic bytes; explicit signal
disconnect before queue_free to avoid freed-lambda errors
- ContentCache: add tile model fetch (content.tile_models), disk cache at
user://content/tile_models.json, get_tile_model_url() API
- game_screen: _add_tile now loads tile CDN model via ModelCache when bound
- Server: ContentGetTileModelsHandler (content.tile_models msg), registered
in ServiceRegistration; TileModelDto / GetTileModelsResponse added to
ContentMessages
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>
DB / Server:
- Added ResultJson (jsonb, nullable) to GameActionLog entity + EF migration
- Updated SaveStateAsync to accept resultJson (optional, default null)
- All 11 action handlers now serialize GameEngine.ToDto() result into the log
Admin — GameSessionsPage:
- Session IDs are now clickable links → /game/sessions/{id}
- "Abandon All Active" bulk button (previous)
- "Purge All" button (SuperAdmin only, JS confirm) — hard-deletes all sessions
and action logs via cascade
Admin — GameSessionDetailPage (/game/sessions/{id}):
- Session header: status badge, P1/P2 display names (click to copy GUID)
- Info cards: Player 1, Player 2, Created timestamp, Duration/WinCondition
- Action log table: seq#, time, actor name (click to copy GUID), action type
- Expandable Payload (JSON) and Result (JSON) per row
- Actor display names resolved from SorIdentityDbContext
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>
Client (game_screen.gd):
- Scroll wheel no longer zooms camera when mouse is over the hand panel
- Clicking a friendly unit smoothly tweens camera pivot to that unit
(EASE_OUT CUBIC, 0.4s) — respects Settings.camera_follow_unit toggle
- Chat overlay instantiated from game screen and removed on exit
Client (Settings.gd + SettingsScreen):
- Added camera_follow_unit bool (default: on) to gameplay settings section
- Persisted to user://settings.cfg under [gameplay]
- Toggle visible in Settings screen under new GAMEPLAY section
Server Admin (MatchmakingQueuePage):
- "Clear History" button deletes all non-Searching matchmaking entries
Server Admin (GameSessionsPage):
- Per-row "Abandon" button for Active/Initializing sessions
- "Abandon All Active" bulk button marks all live sessions as Abandoned
with EndedAt=now and WinCondition="admin"
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>
`ExactSelf` was accepted by the admin builder dropdown but crashed on
deserialization because the TargetOwnership enum was missing the value.
- Added `ExactSelf` to `TargetOwnership` enum in Action.cs
- BuildCandidates treats ExactSelf like Self/Owner (actor's player pool)
- ResolveTargets post-filters to ctx.Source.InstanceId when ExactSelf
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>
TargetOwnerships: add "ExactSelf" so action target selectors can restrict to
the specific unit instance that owns the ability (rather than any allied unit).
Target Filter dropdown (new): exposes the TargetSelector.Filters[] field that
previously had no UI. Supports no-param filter types:
• (none)
• IsSelf — any unit with the same card definition
• IsExactSelf — only this specific instance (InstanceId match)
• IsAdjacentToSource
Filter compiles to Target.Filters[0] in the JSON and round-trips correctly
when loading existing ability JSON back into the builder.
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>
Client (game_screen.gd):
- Fix crash when clicking a unit with null abilitiesJson: server sends the key
with a null value, so dict.get(key,default) returns null — guard both uses
(_show_ability_panel and _on_hold_timer_fired) with explicit null check.
- Add double-click on battlefield units to open a full CardDetailPopup showing
name, affinity, stats, and ability descriptions. Popup is instantiated once
in _ready() and reused; aliases movementPoints/abilities keys as expected.
Server (Filters.cs / AbilitySystem.cs):
- IsSelf filter now matches by CardDefinitionId (definition-level: any copy of
the same card). This is the appropriate semantic for "self" as a type scope.
- IsExactSelf filter added: matches by InstanceId (instance-level: only this
specific unit on the battlefield). Use this to prevent duplicate-instance
trigger bleed where two copies of a card both fire when only one acted.
- TriggerMatches now accepts the evaluating FieldCard and forwards its
InstanceId to Own() for all ownership checks.
- Own() gains "ExactSelf" scope: fires only when occ.Data.SourceId matches the
evaluating unit's InstanceId — eliminating the definition-level bleed bug.
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>
- Input bug: CardWidget only consumed mouse PRESS via accept_event(), not RELEASE.
This caused _unhandled_input to fire _handle_board_click on release of a card
click, hitting the tile physically behind the hand area in 3D — accidentally
sending play_card to the wrong tile (Spirit/Ruin) or picking the first tile for
Terramorpha. Fixed by tracking _press_was_on_board: board clicks only fire when
the originating PRESS also reached _unhandled_input (i.e., was not consumed by
a UI card widget).
- Server: added SpCost, StCost, Genus, MinChannelRange, MaxChannelRange,
MinAttackRange, MaxAttackRange, CanMove, CanAttack, ExtraAttacksRemaining,
CanBeAttacked, AbilitiesJson to CardInstanceDto and ToCardDto mapping.
All fields were already on CardInstance; they were simply not exposed to clients.
- Client: build def dict in _make_hand_card with maxMp → movementPoints alias
so CardWidget displays movement points correctly.
- Client: show MetaRow (genus + type) in compact hand card; only StatsGrid is
hidden. HandArea / RightPanel height raised 190 → 220px for better visibility.
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>
SaveStateAsync was serializing GameState BEFORE incrementing NextActionSequence,
so the written StateJson always had the pre-increment value. Every subsequent
request read the same NextActionSequence and computed the same SequenceNumber,
causing duplicate key violations on IX_action_logs_GameSessionId_SequenceNumber
even in purely sequential scenarios (e.g. P2 places then P1 places).
Fix: increment NextActionSequence first, then serialize, so the persisted JSON
always reflects the sequence number that was just consumed.
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>
NatsUtf8PrimitivesSerializer (the default) can only handle primitives and
strings, causing "Can't serialize GameStartedEvent" at runtime.
Add NatsJsonSerializer<T> implementing INatsSerialize<T>/INatsDeserialize<T>
using System.Text.Json, and pass it explicitly to PublishAsync/SubscribeAsync
in NatsEventBus so all custom NATS event payloads serialize as JSON.
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>
- LoadActiveSessionAsync: begin explicit transaction + lock session row
with SELECT FOR UPDATE so concurrent handlers for the same session
queue up instead of racing
- SaveStateAsync: commit (and release) the transaction after EF SaveChanges
fixes duplicate key on IX_action_logs_GameSessionId_SequenceNumber
when both players act simultaneously (e.g. both placing ArchSpirits)
- GameRules: default board size 9x9 (was 8x8)
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>
Client had no way to know if it was P1 or P2, so _valid_placement_tiles
always chose row bh-1. Now the DTO exposes playerOneAccountId so the
client can correctly pick row 0 (P1) or row bh-1 (P2).
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>
- ChatGetChannelsHandler: for Direct channels, look up the other
member's display name from identity DB and return it as the channel
name (per-caller, no DB schema change)
- ChatDmOpenHandler: same — returns recipient display name in the DTO
for both new and existing DM channels
- New ChatPartyRenameHandler (chat.party.rename): updates the party
channel name, returns updated DTO
- Chat.gd: rename_party() calls the new handler and upserts locally
- chat_overlay.gd: "Rename" button in party action bar opens a dialog
to set a new party name
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>
- Fix social response key mismatch (incomingRequests, blocked)
- Fix DmOpenResponse to return full ChatChannelDto so client can
add the channel without a separate fetch
- Add Party channel type to ChatChannelType enum
- Add PartyInviteHandler, PartyInviteRespondHandler, PartyLeaveHandler
with IClientPush invite notification to the invitee
- Add party tab to chat overlay (action bar, messages, Leave button)
- Wire Invite to Party in both player and friend context menus
- Show accept/decline popup dialog on incoming party invite push
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>
SerializePayload was using default JsonSerializerOptions, so record properties
like GetStarterDecksResponse.Decks were serialized as "Decks" (PascalCase).
That JsonElement travels through the NATS reply back to the gateway, which
forwards it verbatim. The client reads p.get("decks", []) and finds nothing
→ "No starter decks available."
Fix: use the same PropertyNamingPolicy=CamelCase that SystemTextJsonSerializer
uses, so all payload field names arrive at the client in camelCase.
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>
Same two classes of bug as PrebuiltDeckEditor:
1. AddAsset / AddAnimation — ValueGeneratedOnAdd sentinel mismatch:
New entities with Id = Guid.NewGuid() added to a tracked ObservableHashSet
are classified as Modified by EF, causing a 0-rows-affected UPDATE.
Fix: Db.Entry(entry).State = EntityState.Added when !_isNew.
2. RemoveAsset / RemoveAnimation — redundant Db.Remove on detached entity:
Id != Guid.Empty is always true (Guid.NewGuid() default). Removing an
Added entity from the collection detaches it; calling Db.Remove re-attaches
it as Deleted → DELETE on a non-existent row → DbUpdateConcurrencyException.
Fix: removed the explicit Db.Remove calls; EF handles orphan deletion.
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>
PrebuiltDeckCard.Id is configured as ValueGeneratedOnAdd; EF's sentinel for
Guid is Guid.Empty. When a new entity with Id = Guid.NewGuid() is added to
the tracked ObservableHashSet (_deck.Cards), EF interprets the non-empty Guid
as an existing row and tracks the entity as Modified instead of Added.
SaveChangesAsync then issues an UPDATE that finds 0 rows →
DbUpdateConcurrencyException.
Fix: call Db.Entry(entry).State = EntityState.Added immediately after adding
to the collection for existing (tracked) decks. For new decks the plain
List<> is not yet tracked so graph traversal in SaveAsync handles 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>
PrebuiltDeckCard.Id is always a NewGuid() (never Guid.Empty), so the
old `if (entry.Id != Guid.Empty) Db.PrebuiltDeckCards.Remove(entry)`
guard was always true. When a user added a card then removed it before
saving, EF detached the Added entity from the collection, then the
explicit Db.Remove re-attached it as Deleted. SaveChangesAsync then
tried to DELETE a row that was never inserted → DbUpdateConcurrencyException.
Drop the explicit remove call entirely. EF Core automatically marks
Unchanged orphans as Deleted when removed from a required relationship
collection, and simply detaches Added orphans — both are the correct
outcomes without any extra Db.Remove.
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>
PrebuiltDeckEditor.razor:
- Add Db.ChangeTracker.Clear() at OnInitializedAsync start to prevent
stale Deleted/Modified entities from prior circuit pages causing
DbUpdateConcurrencyException on save
- Replace @bind + button-only search with @oninput + 300ms debounce for
both card and arch-spirit search inputs (results appear as you type;
search button retained as manual fallback)
- Clearing the input immediately clears previous results
LoginScreen.tscn:
- Set virtual_keyboard_type = 5 (EMAIL_ADDRESS) on EmailInput and
RegEmailInput so Godot's experimental virtual keyboard creates
<input type="email"> instead of type="text" on mobile/web
export_presets.cfg:
- Extend head_include with a MutationObserver that watches for virtual
keyboard INPUT elements and sets autocomplete="username" on email
inputs and autocomplete="current-password" on password inputs,
enabling iOS Face ID / Touch ID password vault autofill
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>
Auth (single-session policy):
- AuthGrpcHandler.Login now calls RevokeAllSessionsForUserAsync before
CreateSessionAsync. When a user logs in on a new device, all existing
sessions are revoked in Redis (token keys deleted) and marked RevokedAt
in Postgres. The old device will fail auth.hello on its next reconnect
and return to the login screen automatically.
Admin (PrebuiltDeckEditor):
- SearchCardsAsync and SearchArchSpiritsAsync were using .Contains() which
compiles to a case-sensitive PostgreSQL LIKE. Changed to EF.Functions.ILike
so card names can be found regardless of capitalisation.
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>
- Add .AsSplitQuery() to ContentSyncHandler to prevent the cartesian
product join caused by two collection .Include()s (Assets + AnimationBindings).
EF was executing a single JOIN that multiplied result rows per card,
causing replies to arrive 10+ seconds late and gateway timeouts.
- Bump Gateway__RemoteDispatchTimeoutMs from 10000 → 15000ms in configmap
to give worker pods headroom on cold starts (EF model compilation +
first DB query can take 3-5 seconds on a fresh pod).
NOTE: restart gateway pods after deploying to pick up the new timeout value:
kubectl rollout restart deployment/sor-gateway -n stone-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>
Search card definitions by name (ILike, top 20), click a row to select,
set quantity (1–99), toggle Tradeable + Foil, then Grant.
Creates PlayerCard rows directly in CollectionDbContext.
Injects CatalogDbContext + CollectionDbContext (both already registered).
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>
Shows all key-value properties for an account in a table with
inline editing (pencil → edit field → save/cancel) and delete per row.
Add-new form below the table: key + value → Add button.
Duplicate-key guard prevents adding an existing key; existing entries
must be edited rather than added again.
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>
Server:
- ConnectionLoop: accept auth.login and auth.register as valid first messages
(not just auth.hello); all ack payloads now include sessionToken for client
persistence
- IGatewayAuthValidator: add LoginAsync and RegisterAsync
- GatewayAuthValidator: implement both via auth gRPC; fetch displayName from
ValidateAsync after login/register succeeds
- Admin hamburger: custom .sor-admin-hamburger CSS (hardcoded white, no Bootstrap
btn-link theme fighting); topbar z-index 1050 with position:sticky
Client (Godot 4.5, GDScript):
- autoloads/Network.gd: WebSocketPeer state machine (CONNECTING / CONNECTED /
RECONNECTING), exponential backoff (1→30s), app-level keepalive ping every
30s of idle, 30s ping timeout → reconnect, request/reply correlation by
sequence number, debug_log_packets export flag for full packet dumps
- autoloads/Auth.gd: drives auth.hello / auth.login / auth.register as first
WS message; persists sessionToken + userId + displayName to user://auth.cfg;
auto-resumes saved session on reconnect; auth_success / auth_failed signals
- scenes/login/LoginScreen.tscn + login_screen.gd: Login + Register tabs,
touch-friendly inputs (44px height), status label, Enter key submits, handles
reconnect/resume states
- scenes/main/MainScreen.tscn + main_screen.gd: top bar with live connection
dot, welcome label, placeholder nav buttons, sign-out, redirects to login on
session expiry
- project.godot: Network and Auth autoloads registered; LoginScreen as main scene
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>
app.css:
- New .sor-admin-outer wrapper (flex column, 100vh) so topbar + shell stack vertically
- .sor-admin-shell changed from height:100vh to flex:1 (fills remaining space)
- .sor-admin-topbar: hidden on desktop (display:none), shown at <992px as a 56px
dark strip hosting the hamburger button and brand
- .sor-admin-sidebar: at <992px becomes a fixed overlay drawer (position:fixed,
translateX(-100%)), slides in with .open class (0.25s ease-in-out transition)
- .sor-admin-backdrop: full-screen dim overlay (z-index 1040), hidden on desktop
- Minor: tighter container-fluid padding on small screens
MainLayout.razor:
- Wrapped authorized shell in .sor-admin-outer
- Added mobile topbar with hamburger (<i class="bi bi-list">) + brand
- Added backdrop div rendered conditionally when _drawerOpen
- Drawer state (_drawerOpen bool) managed here; toggled by hamburger, closed
by backdrop click and automatically on any NavigationManager.LocationChanged
- Implements IDisposable to unsubscribe LocationChanged event handler
- Passes IsOpen parameter to NavMenu
NavMenu.razor:
- Added [Parameter] public bool IsOpen { get; set; }
- Applies "open" CSS class to <nav> when IsOpen is true
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>