Commit Graph
11 Commits
Author SHA1 Message Date
dingo aed40398b8 Bind public gateway port explicitly 2026-02-28 10:46:48 -05:00
dingo 13402c8551 Split auth gRPC onto internal listener 2026-02-28 10:38:18 -05:00
dingo 62c52dd589 Revert 2026-02-28 09:03:30 -05:00
dingo ec0dcf338a Working on gRPC issue 2026-02-28 08:46:47 -05:00
dingo 0945208e48 gRPC Error 2026-02-28 08:40:05 -05:00
2058a47a92 Add matchmaking + gameplay services (SOR.Matchmaking + SOR.Game)
DB layer:
- Account.RankScore (int, default 1000) — ELO rank for matchmaking
- GameEnums: MatchmakingStatus, GameSessionStatus, GamePhase
- Entities: MatchmakingEntry, GameSession, GameActionLog
- GameDbContext (schema: game) + AddGameDatabase() registration
- Migrations: AddRankScore (Identity), InitialCreate (Game)

SOR.Matchmaking:
- MatchmakerService (BackgroundService) — 5s poll, ELO ±100→±500 range
- Handlers: matchmaking.join, matchmaking.leave, matchmaking.status
- Pushes MatchFoundPush to both players via IClientPush on match

SOR.Game:
- GameState / PlayerState / CardInstance / FieldCard JSONB model
- GameEngine (pure static): Init, Draw, PlayCard, Attack, EndTurn, Concede
- ELO delta (K=32) computed and applied on game end
- Handlers: game.ready, game.get_state, game.draw, game.play_card,
            game.attack, game.end_turn, game.concede
- State filtered per-viewer (opponent hand/deck hidden)
- GameOverPush with rank deltas to both players

Admin pages:
- /game/matchmaking — live queue stats, active entries, recent activity
- /game/sessions   — session stats, filterable by status/account

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-26 06:57:13 -05:00
4663003dd7 Add versioning, content, and chat presence/notifications services
- SOR.Versioning: version.check handler, ClientRelease entity + admin UI
- SOR.Content: incremental card sync (DefinitionVersion cursor via Postgres trigger),
  content.sync / content.sets / content.card handlers
- Chat: presence (account_presence) + notifications with unread count and mark-read
- CardDefinition: DefinitionVersion bigint (trigger-assigned) + IsRetired soft-delete
- 3 migrations applied to pg-forge-01 (Identity, Chat, Catalog)

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-25 20:35:35 -05:00
348c37b9b5 Add SOR.Bazaar service — store, P2P marketplace, auction house, cosmetics
New project: SOR.Bazaar (12 message handlers)
  Store:       get_store, buy_booster_pack, buy_prebuilt_deck, buy_cosmetic, get_my_balance
  Marketplace: get_listings, get_my_listings, list_card, cancel_listing,
               buy_listing (shared-tx atomicity), place_bid (shared-tx + refund),
               get_transactions

New DB entities:
  BazaarDb:    Cosmetic, PurchaseRecord, BoosterPackCardGrant, AuctionBid
  CollectionDb: PlayerCosmetic
  IdentityDb:  Account.OriginPoints

BoosterPack gets CardSetId for set-scoped card pool draws.
BazaarEnums: PurchaseProductType, CosmeticType.

3 EF migrations applied to pg-forge-01:
  AddOriginPoints, AddBazaarCosmetics, AddPlayerCosmetics

Admin pages: CosmeticsPage, CosmeticEditor, PurchaseRecordsPage (with
  expandable booster pack card grant rows), NavMenu Bazaar submenu updates.

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-25 19:02:59 -05:00
c6dc56a350 Add chat service, collection clone/tier rules, social graph
SOR.Chat (new project):
- 10 WebSocket message handlers: send, get_channels, get_messages,
  dm_open, friend_request, friend_respond, friend_remove, block,
  unblock, get_social
- Cursor-based pagination for message history
- Block checks on DM send and dm_open
- Social graph: friends / pending requests (in+out) / blocked list
- Batch identity DB lookups for display names

Collection updates:
- clone_deck handler (copy deck + re-validate)
- Tier-chain validation: deck ArchSpirit must be Tier 1 (hard rule);
  warn on Tier 2+ card without previous tier present (soft warning)
- Tier 2+ ArchSpirits now allowed in card list as ascension targets
- ValidationWarnings field added to DeckSummaryDto + DeckDetailDto

Database:
- CardDefinition.PreviousTierId self-reference FK for ascension chains
- FriendRequest + BlockedUser entities in chat schema
- ChatChannelType.System + FriendRequestStatus enum values
- Migrations: AddArchSpiritTierChain (catalog), AddSocialGraph (chat)

Admin portal:
- ChatOverview (/chat) — stats + channel list with type filter
- ChatChannelViewer (/chat/channel/{id}) — message history + system
  message compose for admins
- SocialModerationPage (/chat/social) — friend/block lookup + actions
- NavMenu: Chat section with Social Graph sub-item

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-25 13:16:43 -05:00
0198aec9e5 Add collection service — deck management + card inventory
SOR.Collection project (new):
- 8 message handlers over WebSocket: get_cards, get_decks, get_deck,
  create_deck, rename_deck, delete_deck, add_card, remove_card
- Deck construction rules (DeckRules.cs): min 20 / max 40 cards,
  max 4 copies per definition, max 20 decks per player
- add_card validates ownership (player must own enough physical copies),
  copy limit, deck size limit, and rejects ArchSpirits from the card list
- RefreshValidityAsync recalculates Deck.IsValid after every mutation
- Cross-context lookups (CollectionDbContext + CatalogDbContext) with
  batch queries — never N+1

Admin portal pages (new):
- /collection — overview stats (total cards, total decks, valid decks,
  unique players) + account ID lookup
- /collection/player/{accountId} — full player collection viewer:
  paginated card grid with name/type/affinity/rarity/foil/serial filters,
  deck list with expanded card tables, Grant Card modal (search + foil
  toggle, grants 1–100 copies), revoke individual card instances

Wiring:
- SOR.slnx + SOR.Host.csproj: added SOR.Collection project reference
- Program.cs: uncommented collection service registration
- NavMenu: added Collection item

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-25 12:28:17 -05:00
d21adbc8d0 Add networking foundation — 9-project C# solution (compiles clean)
Implements the modular networking layer for SOR Server:
- SOR.Networking.Abstractions: pure interfaces (ITransport, IClientConnection,
  IMessageSerializer, IMessageDispatcher, IMessageHandler, IEventBus, IClientPush)
- SOR.Networking.WebSocket: ITransport + IClientConnection over System.Net.WebSockets
- SOR.Networking.Nats: IEventBus over NATS.Net (INatsConnection)
- SOR.Networking.Redis: IClientPush over Redis Pub/Sub
- SOR.Shared: ServiceResult<T>, RedisKeys, NatsSubjects, ServerMessage, JSON serializer
- SOR.Shared.Proto: auth.proto with gRPC AuthService contract
- SOR.Gateway: accept loop, auth handshake, dispatcher, Redis push subscriber
- SOR.Auth: stub gRPC handler (placeholder responses)
- SOR.Host: multi-service runner via ENABLED_SERVICES env var; wires all DI

All concrete implementations are wired exclusively in SOR.Host — every transport,
broker, and push implementation can be swapped by changing only Program.cs.

dotnet build SOR.slnx → 0 errors, 0 warnings

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-24 21:01:38 -05:00