fix(portal): synchronize destination presentation state

This commit is contained in:
Erik 2026-07-16 21:17:13 +02:00
parent 4b1bceefbb
commit e95f55f25b
42 changed files with 2815 additions and 288 deletions

View file

@ -171,6 +171,25 @@ public sealed class StreamingRegion
internal static uint EncodeLandblockIdForTest(int lbX, int lbY)
=> EncodeLandblockId(lbX, lbY);
/// <summary>
/// Returns the tier currently owned by this region after bootstrap/recenter
/// hysteresis has been applied. Late worker completions use this to avoid
/// resurrecting a Near layer after the region has demoted it to Far.
/// </summary>
internal bool TryGetDesiredTier(uint landblockId, out LandblockStreamTier tier)
{
if (_tierResidence.TryGetValue(landblockId, out var residence))
{
tier = residence == TierResidence.Near
? LandblockStreamTier.Near
: LandblockStreamTier.Far;
return true;
}
tier = default;
return false;
}
/// <summary>
/// Two-tier recenter: computes the 5-list diff per Phase A.5 spec §4.2.
/// Hysteresis: NearRadius+2 for Near→Far demote; FarRadius+2 for Far→null