mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 15:38:45 -07:00
955246c6e4
- Updated PlayerLogs, Players, Reports, Rooms, Settings, SignupCodes, and other pages to accept an optional `embedded` prop for better integration in various contexts. - Introduced a new Activity page consolidating audit logs and player request logs with tab navigation. - Added Content page for community board and loading tips with tab navigation. - Created Moderation page to unify player directory, bans, and reports under a single interface. - Implemented SettingsHome page to manage server settings and signup codes with tab navigation. - Enhanced the Join page to include password creation for new accounts. - Added global friends feature in Settings to allow all accounts to be friends without database entries. - Introduced RelationshipQueries service to manage effective friend resolution based on global friends toggle. - Added WireDates for consistent date handling in serialized data. - Created reusable Tabs component for consistent tab navigation across various pages.
56 lines
2.8 KiB
C#
56 lines
2.8 KiB
C#
namespace DorkNet.Server.Data.Entities;
|
|
|
|
/// <summary>
|
|
/// Single-row table holding server-wide runtime toggles that admins can
|
|
/// flip from the SPA without a redeploy. Modelled after
|
|
/// <see cref="CommunityBoardEntity"/>: <see cref="Id"/> 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.
|
|
/// </summary>
|
|
public class ServerSettingsEntity
|
|
{
|
|
public int Id { get; set; } = 1;
|
|
|
|
/// <summary>When true, the watch's account-creation endpoints
|
|
/// (<c>POST /account/create</c> and <c>POST /api/account/v1/create</c>)
|
|
/// short-circuit with <c>Success=false</c> and the watch surfaces
|
|
/// the error to the player. Existing logins are unaffected; only
|
|
/// brand-new account requests are blocked.</summary>
|
|
public bool SignupsDisabled { get; set; }
|
|
|
|
/// <summary>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.</summary>
|
|
public bool GlobalFriendsEnabled { get; set; }
|
|
|
|
/// <summary>When true, the watch's weekly-challenge map reports
|
|
/// <c>CompletedRequired</c> — the player must finish every listed
|
|
/// challenge before the gift unlocks. Mirrors
|
|
/// <c>ChallengeMap.CompletedRequired</c> on the 2020.03 client.</summary>
|
|
public bool WeeklyChallengesCompletedRequired { get; set; } = true;
|
|
|
|
/// <summary>JSON-serialised <c>List<WeeklyChallengeTemplate></c>
|
|
/// (see <c>ServerSettingsService</c>). Empty string falls back to
|
|
/// <c>ServerSettingsService.DefaultWeeklyChallenges()</c>. Admin-
|
|
/// editable from the SPA Settings page so the weekly slate can change
|
|
/// without a redeploy.</summary>
|
|
public string WeeklyChallengesJson { get; set; } = string.Empty;
|
|
|
|
/// <summary>JSON-serialised <c>WeeklyChallengeReward</c> — the gift
|
|
/// granted when the week's challenges complete (XP + tokens, plus an
|
|
/// optional store skin identified by <c>Slug</c>). Empty string falls
|
|
/// back to <c>ServerSettingsService.DefaultWeeklyReward()</c>.</summary>
|
|
public string WeeklyChallengeRewardJson { get; set; } = string.Empty;
|
|
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|