feat(app): project canonical runtime placements

This commit is contained in:
Erik 2026-08-01 15:00:49 +02:00
parent ef43667872
commit 74c9b155bd
5 changed files with 1395 additions and 0 deletions

View file

@ -1,4 +1,5 @@
using System.Globalization;
using AcDream.Runtime.Physics;
namespace AcDream.Runtime.World;
@ -247,6 +248,32 @@ public sealed class RuntimeWorldTransitState
return false;
}
/// <summary>
/// Validates the portal suffix carried by a canonical SetPosition
/// projection receipt against this instance's live transit ownership.
/// Shape equality alone is insufficient: a superseded, cancelled, or
/// completed host token can remain structurally valid after it has lost
/// authority to reveal the destination.
/// </summary>
public bool IsCurrentPlacementAuthority(
in RuntimePortalPlacementAuthority authority,
uint exactCellId)
{
if (!authority.Present)
return authority.IsEmpty;
return authority.IsValid
&& authority.Projection.DestinationCell == exactCellId
&& IsCurrentPortalDestination(
authority.RevealGeneration,
authority.TeleportSequence,
exactCellId)
&& TryGetHostProjection(
authority.Projection,
out RuntimeWorldHostProjectionSnapshot host)
&& !host.IsSuperseding;
}
/// <summary>
/// Marks the graphical reservation-release callback as due before the
/// host executes it. A thrown callback therefore leaves an exact pending