mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28: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,39 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DorkNet.Server.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// In-game text-chat message. Sent to the chat.rec.net/thread
|
||||
/// endpoint family; backed by a flat per-thread row table where the
|
||||
/// thread id is just the canonical (lower, higher) pair of player ids
|
||||
/// for DMs, or the room id for room-wide chats.
|
||||
///
|
||||
/// We keep a separate table from <see cref="MessageEntity"/> because
|
||||
/// the wire shape and history-fetch semantics differ — chat is
|
||||
/// append-and-read-recent, messages are inbox-style with read
|
||||
/// receipts.
|
||||
/// </summary>
|
||||
public class ChatMessageEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>String thread key. Format: <c>dm:<low>:<high></c> for
|
||||
/// direct messages between two players (lower id first), or
|
||||
/// <c>room:<roomId></c> for room-wide chats.</summary>
|
||||
[MaxLength(64)]
|
||||
public string ThreadKey { get; set; } = string.Empty;
|
||||
|
||||
public long SenderPlayerId { get; set; }
|
||||
|
||||
[MaxLength(2000)]
|
||||
public string Body { get; set; } = string.Empty;
|
||||
|
||||
public DateTime SentAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>Build the canonical DM thread key for two players.
|
||||
/// Order-independent so both sides hit the same row.</summary>
|
||||
public static string DmKey(long a, long b) =>
|
||||
a < b ? $"dm:{a}:{b}" : $"dm:{b}:{a}";
|
||||
|
||||
public static string RoomKey(long roomId) => $"room:{roomId}";
|
||||
}
|
||||
Reference in New Issue
Block a user