Files
DorkNet/DorkNet.Server/Data/Entities/RelationshipEntity.cs
T
Alexa d471b418b9 Import march-2020-03-10 from private repo (scrubbed 2026-05-27)
Targets Rec Room 2020.03.10 client (also serves 2020.03.06).

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 dorknet-clientpatch-{key}.zip
  for v1-march-* Release uploads.
- .github/workflows/release.yml — on tag push publishes both
  dorknet-server-march_2020_03_10-win-x64.zip and
  dorknet-clientpatch-march_2020_03_10.zip as Release assets.

Same scrub rules as december; tools/build-patcher-zip.ps1 added to
the maintainer-side allow-list so it survives.
2026-05-27 01:06:12 +03:00

59 lines
2.4 KiB
C#

namespace DorkNet.Server.Data.Entities;
/// <summary>
/// Storage-side enum mirroring the int values previously hard-coded in
/// <see cref="RelationshipEntity"/>. Stays separate from the on-the-wire
/// <c>DorkNet.Models.Relationships.RelationshipStatus</c> so the contract
/// can evolve without touching the DB representation. Underlying int
/// values match — no migration data fixup needed.
/// </summary>
public enum RelationshipStatus
{
/// <summary>Mutual friend (both directions accepted).</summary>
Friend = 1,
/// <summary>Outgoing request from <see cref="RelationshipEntity.RequesterId"/>
/// awaiting accept/decline by <see cref="RelationshipEntity.TargetId"/>.</summary>
PendingSent = 2,
/// <summary>
/// Reserved for the receiving-side view if we later denormalise. The
/// backing column is still 1-2-4 in practice; PendingReceived is what
/// the wire DTO computes from the caller's perspective when the row's
/// PendingSent direction is "into" them.
/// </summary>
PendingReceived = 3,
/// <summary>Block held by <see cref="RelationshipEntity.RequesterId"/>
/// against <see cref="RelationshipEntity.TargetId"/>. Hides the target
/// from the requester's friend list and prevents new requests both ways.</summary>
Blocked = 4,
}
public class RelationshipEntity
{
public long Id { get; set; }
public long RequesterId { get; set; }
public long TargetId { get; set; }
public RelationshipStatus Status { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
/// <summary>True when <see cref="RequesterId"/> favorited
/// <see cref="TargetId"/>. Favorited shows up first in the friend
/// list and triggers an extra notification on "online".</summary>
public bool Favorited { get; set; }
/// <summary>True when <see cref="RequesterId"/> muted text from
/// <see cref="TargetId"/>. Drops chat-message notifications but
/// keeps the friendship intact.</summary>
public bool Muted { get; set; }
/// <summary>True when <see cref="RequesterId"/> ignored
/// <see cref="TargetId"/> (a soft block — hides the player from
/// the room browser without breaking the relationship row).</summary>
public bool Ignored { get; set; }
public PlayerEntity? Requester { get; set; }
}