fix(session): acknowledge login after first placement

ACE intentionally creates the local player Hidden and releases that materialization state on LoginComplete. Sending LoginComplete from raw F746 receipt raced canonical placement and left the login haze visible. Route one one-shot completion callback from Runtime's local first-entry terminal edge to graphical and prepared headless hosts; retain a guarded accepted-Create edge only for content-less headless sessions. Focused Runtime login tests, all 79 Headless tests, the connected user gate, and the Release build pass.
This commit is contained in:
Erik 2026-08-03 12:10:42 +02:00
parent f24532adf3
commit 175ad6b0d0
10 changed files with 107 additions and 48 deletions

View file

@ -165,6 +165,12 @@ public sealed class RuntimeLiveEntitySessionControllerTests
Spawn(playerGuid, incarnation: 1);
sink.Spawned(spawn);
Assert.Single(gameActions);
Assert.Equal(GameActionLoginComplete.Build(), gameActions[0]);
sink.Spawned(spawn);
Assert.Single(gameActions);
gameActions.Clear();
sink.TeleportStarted(1u);
sink.PositionUpdated(new WorldSession.EntityPositionUpdate(
playerGuid,
@ -182,6 +188,7 @@ public sealed class RuntimeLiveEntitySessionControllerTests
ForcePositionSequence: 0));
Assert.Single(gameActions);
Assert.Equal(GameActionLoginComplete.Build(), gameActions[0]);
Assert.True(runtime.TransitOwner.CaptureOwnership().IsSessionIdle);
Assert.True(runtime.Portal.Snapshot.Completed);
Assert.Equal(0x01020001u, runtime.Portal.Snapshot.DestinationCell);
@ -278,6 +285,41 @@ public sealed class RuntimeLiveEntitySessionControllerTests
drive.DetachRoute(routeB);
}
[Fact]
public void FirstEntryDriveSignalsLocalCompletionOnceAfterCanonicalPlacement()
{
using StartedRuntime started = StartRuntime();
GameRuntime runtime = started.Runtime;
const uint playerGuid = 0x50000003u;
runtime.PlayerIdentity.ServerGuid = playerGuid;
CommitLandblockCollision(runtime, 0x01010000u);
RuntimeFirstEntryDriveController drive = CreateDrive(runtime);
var route = new object();
int completed = 0;
drive.AttachRoute(route, record =>
{
Assert.Equal(playerGuid, record.ServerGuid);
completed++;
});
using var session = new WorldSession(
new IPEndPoint(IPAddress.Loopback, 9000),
new FixtureTransport());
var controller = new RuntimeLiveEntitySessionController(
runtime,
session,
worldProjection: new FixtureWorldProjection());
LiveEntitySessionSink sink = controller.CreateSink();
sink.Spawned(Spawn(playerGuid, incarnation: 1));
Assert.Equal(0, completed);
DrainFirstEntry(runtime, drive);
Assert.Equal(1, completed);
Assert.Equal(0, drive.PendingCount);
drive.DetachRoute(route);
}
/// <summary>
/// C3c: initial-residence admission requires a live session generation
/// (RuntimeInitialCreateResidenceState.CanAcceptCreate), so these direct
@ -372,6 +414,18 @@ public sealed class RuntimeLiveEntitySessionControllerTests
Height: 1.835f,
RuntimeLocalPlayerShadowDisposition.ProvenShapeless));
private static void DrainFirstEntry(
GameRuntime runtime,
RuntimeFirstEntryDriveController drive)
{
for (int attempt = 0; attempt < 8 && drive.PendingCount != 0; attempt++)
{
drive.DriveAll();
DrainPlacementFifo(runtime);
}
Assert.Equal(0, drive.PendingCount);
}
/// <summary>
/// Drains/acknowledges every still-pending placement receipt (the
/// ExecutorCompleted correlation is reaped by its acknowledgement) the