refactor(app): key live projections by runtime identity

Move materialized live-object sidecars and presentation worksets to exact RuntimeEntityKey ownership. Runtime remains the only GUID/incarnation/local-ID authority while hydration, animation, effects, lights, equipped children, renderer resources, visibility, liveness, and teardown resolve exact projection identities. Preserve synchronous callbacks, local-ID allocation order, and current rendering behavior.
This commit is contained in:
Erik 2026-07-25 21:50:58 +02:00
parent e18df84437
commit 420e5eea70
73 changed files with 2939 additions and 1715 deletions

View file

@ -20,7 +20,7 @@ public sealed class LiveAppearanceAnimationTests
var runtime = new AcDream.App.World.LiveEntityRuntime(
new AcDream.App.Streaming.GpuWorldState(),
new AcDream.App.World.DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
var record = runtime.RegisterLiveEntity(new AcDream.Core.Net.WorldSession.EntitySpawn(
var spawn = new AcDream.Core.Net.WorldSession.EntitySpawn(
guid,
Position: null,
SetupTableId: null,
@ -33,8 +33,11 @@ public sealed class LiveAppearanceAnimationTests
ItemType: null,
MotionState: null,
MotionTableId: null,
InstanceSequence: 1)).Record!;
WorldEntity entity = Entity(0x70000002u, 0x01000001u);
InstanceSequence: 1);
LiveEntityRecord record = runtime.RegisterAndMaterializeProjection(
spawn,
id => Entity(id, 0x01000001u, guid));
WorldEntity entity = Assert.IsType<WorldEntity>(record.WorldEntity);
var state = new LiveEntityAnimationState
{
Entity = entity,
@ -47,7 +50,6 @@ public sealed class LiveAppearanceAnimationTests
PartTemplate = Array.Empty<LiveAnimationPartTemplate>(),
PartAvailability = Array.Empty<bool>(),
};
record.WorldEntity = entity;
record.AnimationRuntime = state;
LiveEntityAppearanceUpdateState captured = Assert.IsType<LiveEntityAppearanceUpdateState>(
@ -188,10 +190,13 @@ public sealed class LiveAppearanceAnimationTests
MotionTableId: null,
InstanceSequence: instance);
private static WorldEntity Entity(uint id, uint gfxObjId) => new()
private static WorldEntity Entity(
uint id,
uint gfxObjId,
uint serverGuid = 0x50000001u) => new()
{
Id = id,
ServerGuid = 0x50000001u,
ServerGuid = serverGuid,
SourceGfxObjOrSetupId = 0x02000001u,
Position = Vector3.Zero,
Rotation = Quaternion.Identity,