namespace DorkNet.Server.Data.Entities; /// /// Single-row table holding server-wide runtime toggles that admins can /// flip from the SPA without a redeploy. Modelled after /// : is pinned to 1 /// so EF Core has a key to track changes against, and reads/writes /// touch one row. /// /// Add new boolean (or scalar) columns directly to this entity as more /// toggles appear — keeping them strongly typed beats a generic /// key/value table for the dozen-or-so global switches we'll ever have. /// public class ServerSettingsEntity { public int Id { get; set; } = 1; /// When true, the watch's account-creation endpoints /// (POST /account/create and POST /api/account/v1/create) /// short-circuit with Success=false and the watch surfaces /// the error to the player. Existing logins are unaffected; only /// brand-new account requests are blocked. public bool SignupsDisabled { get; set; } /// When true, every account on the server is treated as a /// friend of every other account — the relationships list, friend /// online-status HUD, and room-move fan-out all behave as if everyone /// is mutually friended. Built for small private servers where /// searching + manually friend-requesting each other is friction; no /// rows are written, so flipping it off instantly reverts to the real /// relationship graph. Blocked relationships still suppress the pairing, /// and the system/coach account (Id=1) is excluded. public bool GlobalFriendsEnabled { get; set; } /// When true, the challenge map tells the 2020 watch that /// weekly challenge completion is required for the weekly reward flow. /// Individual player challenge rows still default to incomplete until /// the client reports progress. public bool WeeklyChallengesCompletedRequired { get; set; } = true; /// Admin-managed weekly challenge templates as JSON. Challenge /// ids are generated per weekly map so old progress rows stay scoped to /// that week's map id. public string WeeklyChallengesJson { get; set; } = string.Empty; /// Admin-managed weekly reward JSON. The progression API uses /// this for both the watch's ChallengeGift payload and the once-per-week /// server-side XP/token grant. public string WeeklyChallengeRewardJson { get; set; } = string.Empty; /// Admin-managed Play menu room filter chips as JSON. Stores /// separate pinned and popular tag lists; wire endpoints serve them to /// the watch without leading # characters. public string PlayMenuTagsJson { get; set; } = string.Empty; /// Admin-managed Rec Center category-door config. The /// 2020.12 client reads this through api/gameconfigs/v1/all as /// Door.{Category}.Title and Door.{Category}.Query entries. public string RecCenterDoorsJson { get; set; } = string.Empty; /// Admin-managed values for GameConfig keys confirmed in /// the 2020.12 decomp. Kept typed in the admin API; stored as JSON /// here so newly discovered built-in keys do not require a table /// migration each time. public string DiscoveredGameConfigsJson { get; set; } = string.Empty; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; }