mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
40 lines
882 B
C#
40 lines
882 B
C#
namespace RadicadeServer.RecNet.Rooms
|
|
{
|
|
public static class SceneLocations
|
|
{
|
|
public const string MakerRoom = "a75f7547-79eb-47c6-8986-6767abcb4f92";
|
|
|
|
public const string Dorm = "76d98498-60a1-430c-ab76-b54a29b7a163";
|
|
|
|
private static readonly HashSet<string> KnownBadValues = new(StringComparer.OrdinalIgnoreCase)
|
|
{
|
|
"unknown",
|
|
"none",
|
|
"null",
|
|
};
|
|
|
|
public static bool IsValid(string? unitySceneId)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(unitySceneId))
|
|
return false;
|
|
|
|
var trimmed = unitySceneId.Trim();
|
|
if (KnownBadValues.Contains(trimmed))
|
|
return false;
|
|
|
|
return Guid.TryParse(trimmed, out _);
|
|
}
|
|
|
|
public static string ResolveFallback(IEnumerable<string?> candidateUnitySceneIds, bool isDorm)
|
|
{
|
|
foreach (var id in candidateUnitySceneIds)
|
|
{
|
|
if (IsValid(id))
|
|
return id!.Trim();
|
|
}
|
|
|
|
return isDorm ? Dorm : MakerRoom;
|
|
}
|
|
}
|
|
}
|