mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 15:38:45 -07:00
Import december-2020-12-18 from private repo (scrubbed 2026-05-27)
Targets Rec Room 2020.12.18 client.
Re-import after adding:
- DorkNet.ClientMod/dorknet-clientmod.json.template — config schema
the launcher's manifest-driven patcher renders into UserData/.
- tools/build-patcher-zip.ps1 — produces the dorknet-clientpatch-{key}.zip
Release asset the launcher fetches.
- .github/workflows/release.yml — auto-publishes both Release assets
on v1-december-* tag push.
Scrubbed via maintainer-side scrub-for-public.ps1: same drop rules as
the prior import, plus build-patcher-zip.ps1 added to the tools/
allow-list so it survives the scrub.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DorkNet.Server.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// One per (player, deviceId) — recorded on
|
||||
/// <c>POST /api/deviceid/v1/register</c>. Lets admins flag
|
||||
/// duplicate-account abuse: when a banned player creates a new
|
||||
/// account on the same device, the new account inherits the device
|
||||
/// ban automatically.
|
||||
/// </summary>
|
||||
public class PlayerDeviceEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
[MaxLength(128)]
|
||||
public string DeviceId { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(32)]
|
||||
public string Platform { get; set; } = string.Empty;
|
||||
|
||||
public DateTime FirstSeen { get; set; } = DateTime.UtcNow;
|
||||
public DateTime LastSeen { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>Set by admin tooling — if true, every account using
|
||||
/// this device is auto-banned at login.</summary>
|
||||
public bool IsBanned { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>Per-player notification preferences. iOS-style toggle
|
||||
/// page; Android / Quest just persist the same shape.</summary>
|
||||
public class NotificationPrefsEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
[MaxLength(32)]
|
||||
public string Platform { get; set; } = string.Empty;
|
||||
|
||||
public bool AllowAll { get; set; } = true;
|
||||
public bool AllowFriendRequest { get; set; } = true;
|
||||
public bool AllowMessage { get; set; } = true;
|
||||
public bool AllowEventInvite { get; set; } = true;
|
||||
public bool AllowAnnouncements { get; set; } = true;
|
||||
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>Sticky cohort assignment — one row per (player, cohort
|
||||
/// key). Created on first hit to <c>GET /api/cohort/v1/{key}</c> with
|
||||
/// a randomly selected variant; remains stable for the lifetime of
|
||||
/// the player so A/B tests don't flicker between sessions.</summary>
|
||||
public class CohortAssignmentEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string CohortKey { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(32)]
|
||||
public string Variant { get; set; } = string.Empty;
|
||||
|
||||
public DateTime AssignedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user