Files
DorkNet/DorkNet.Server/Data/Entities/RoomSceneEntity.cs
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

61 lines
2.7 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
/// <summary>
/// One scene within a multi-scene custom room. Most rooms historically
/// had only Scenes[0] (synthesised in <c>BuildRoomDetails</c> from
/// <see cref="RoomEntity.LocationReplicationId"/> +
/// <see cref="RoomEntity.CurrentDataBlobName"/>); rooms imported from a
/// multi-scene archive write one row per chapter here, and the wire-shape
/// builder emits the full <c>Scenes[]</c> array from this table when any
/// rows exist.
///
/// <para>The scene's <see cref="RoomSceneId"/> on the wire is this table's
/// <see cref="OrderIndex"/> — the matchmaking <c>SubRoomId</c> the watch
/// passes to <c>/goto/room/{name}/{subroom}</c> matches against
/// <see cref="Name"/>, then resolves to <see cref="OrderIndex"/> for
/// <c>RoomInstance.SubRoomId</c>.</para>
/// </summary>
public class RoomSceneEntity
{
public long Id { get; set; }
/// <summary>FK to <see cref="RoomEntity"/>. Indexed so the per-room
/// fetch in <c>BuildRoomDetails</c> is one query.</summary>
public long RoomId { get; set; }
/// <summary>0-based index this scene occupies in the wire
/// <c>Scenes[]</c> array. Doubles as the <c>RoomSceneId</c> the
/// matchmaking flow uses for <c>RoomInstance.SubRoomId</c>.</summary>
public int OrderIndex { get; set; }
/// <summary>Display name (e.g. "Lobby", "Ch1_Headfirst"). Matched
/// case-insensitively against the sub-room segment of
/// <c>/goto/room/{name}/{subroom}</c>.</summary>
[MaxLength(128)]
public string Name { get; set; } = string.Empty;
/// <summary>The <c>RoomSceneLocationId</c> GUID the client uses to
/// look up the bundled stage prefab via
/// <c>AGRoomSettings.TryGetRoomSceneLocationById</c>. Defaults to
/// the MakerRoom (Basement) scene GUID — the canonical "blank
/// canvas" stage 2020 custom rooms were built on. Extracted from
/// resources.assets via tools/extract-locations-binary.py: the
/// "Maker Room" Location entry has SceneName=Basement and
/// ReplicationId=a75f7547-79eb-47c6-8986-6767abcb4f92.</summary>
[MaxLength(64)]
public string RoomSceneLocationId { get; set; } = "a75f7547-79eb-47c6-8986-6767abcb4f92";
/// <summary>The <see cref="RoomDataBlobEntity.BlobName"/> the watch
/// downloads as the persisted state for this scene.</summary>
[MaxLength(128)]
public string DataBlobName { get; set; } = string.Empty;
public int MaxPlayers { get; set; } = 8;
public bool IsSandbox { get; set; } = false;
public bool CanMatchmakeInto { get; set; } = true;
public DateTime DataModifiedAt { get; set; } = DateTime.UtcNow;
}