Files
DorkNet/DorkNet.Server/Data/Entities/MessageEntity.cs
T
Alexa 4edf25b2d5 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.
2026-05-27 01:04:12 +03:00

43 lines
1.6 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
/// <summary>
/// Direct message between two players. Backs the watch's
/// <c>api/messages/v2</c> endpoints (inbox + send + mark-read).
///
/// One row per message. Threading happens at read time — the inbox
/// query groups by (Sender, Recipient) pair to surface the most
/// recent message per conversation.
/// </summary>
public class MessageEntity
{
public long Id { get; set; }
public long SenderPlayerId { get; set; }
public long RecipientPlayerId { get; set; }
[MaxLength(2000)]
public string Body { get; set; } = string.Empty;
/// <summary>RecNet <c>Message.MessageType</c> wire value (see
/// <c>Cpp2IL_CS/.../RecNet/Message.cs</c>). Default 30 =
/// TextMessage. Other values used by the 2020 client: 0/6 =
/// GameInvite[V2], 3/7 = PartyActivitySwitch[V2], 10 =
/// RequestGameInvite (the "ask to join" flow), 1 =
/// GameInviteDeclined, 11 = RequestGameInviteDeclined, 20 =
/// FriendStatusOnline.</summary>
public int Type { get; set; } = 30;
/// <summary>Optional RecNet room id carried by invite and party
/// activity messages. The client uses this to render room-aware
/// cards and passes it back when accepting V2 invites.</summary>
public long? RoomId { get; set; }
public DateTime SentAt { get; set; } = DateTime.UtcNow;
/// <summary>Null until the recipient hits the message in the
/// watch UI; set to the read timestamp at that point.</summary>
public DateTime? ReadAt { get; set; }
}