fix(runtime,ui): Campaign LA gate round 2 — world name reads durably; dialogs center on the canvas
Two live-integration gaps the ef96c554 unit tests could not see:
1. World box stayed empty against ACE: ServerName (0xF7E1) arrives in the
SAME connect batch as CharacterList, so ServerNameReceived fires during
the handshake pump BEFORE the controller binding subscribes - the
event-only wiring proved the state and controller but never the live
ordering. StartCore now reads the durable WorldSession.ServerInfo after
connect exactly like the roster (ILiveSessionOperations.GetServerInfo,
default interface method so no fake breaks); the event remains for
post-connect updates. Pinned by a Start-level test.
2. The exit confirmation rendered far right of the screen: all three
retail dialog views centered against the raw window size while the
active screen lays out in the fixed 800x600 canvas - center-of-1920
is canvas-760, which the stretch pushes off-center. Views now center
against UiRoot.EffectiveCanvasSize (canvas while a pre-world screen is
active, window otherwise). Pinned by growing the window over the fixed
canvas in the exit-dialog test and asserting the scrim spans the canvas
with the popup centered at 400.
Runtime 1666, App 5100+6 skips, green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
2e6d69ddc7
commit
0a7dc7d626
7 changed files with 97 additions and 6 deletions
|
|
@ -386,6 +386,13 @@ public sealed class CharacterManagementUiControllerTests
|
|||
UiButton exit = environment.Button(
|
||||
CharacterManagementUiController.ExitElementId);
|
||||
|
||||
// Gate round 2 follow-up: the window is BIGGER than the fixed canvas
|
||||
// (the live shape — 1920×1080 window over the 800×600 authored
|
||||
// screen). The exit dialog centered against the raw window width and
|
||||
// landed far right of the visible canvas center.
|
||||
environment.Host.Width = 1920f;
|
||||
environment.Host.Height = 1080f;
|
||||
|
||||
exit.OnClick!();
|
||||
|
||||
Assert.NotEqual(0u, controller.ConfirmExitDialogContext);
|
||||
|
|
@ -393,6 +400,14 @@ public sealed class CharacterManagementUiControllerTests
|
|||
Assert.Equal(
|
||||
"Are you sure you want to leave?",
|
||||
Message(dialog));
|
||||
// The dialog's scrim + popup must live in CANVAS space: scrim spans
|
||||
// exactly the canvas, popup centers within it.
|
||||
Assert.Equal(800f, dialog.Root.Width);
|
||||
Assert.Equal(600f, dialog.Root.Height);
|
||||
UiElement popup = Assert.Single(
|
||||
dialog.Root.Children,
|
||||
static child => child.Visible && child.Width > 0f);
|
||||
Assert.InRange(popup.Left + popup.Width * 0.5f, 399f, 401f);
|
||||
DialogButton(dialog, RetailConfirmationDialogView.RejectButtonId).OnClick!();
|
||||
|
||||
Assert.Equal(0, environment.Runtime.RequestExitCalls);
|
||||
|
|
|
|||
|
|
@ -113,6 +113,13 @@ public sealed class LiveSessionControllerTests
|
|||
return Characters;
|
||||
}
|
||||
|
||||
/// <summary>Gate-round-2 world-name live fix: mirrors the durable
|
||||
/// post-connect read the production path performs (the wire event
|
||||
/// fires during the handshake, before any subscriber exists).</summary>
|
||||
public ServerName.Parsed? ServerInfo { get; set; }
|
||||
|
||||
public ServerName.Parsed? GetServerInfo(WorldSession session) => ServerInfo;
|
||||
|
||||
public void StartCharacterSelectionReceive(WorldSession session) =>
|
||||
calls.Add("start-character-selection-receive");
|
||||
|
||||
|
|
@ -349,6 +356,33 @@ public sealed class LiveSessionControllerTests
|
|||
Assert.True(host.CommandBuses[0].Active);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gate-round-2 live fix: ACE sends ServerName (0xF7E1) in the SAME
|
||||
/// connect batch as CharacterList, so the event fires during the
|
||||
/// handshake pump before the binding subscribes — the World box stayed
|
||||
/// empty against a live server while the event-only unit tests passed.
|
||||
/// Start must read the durable ServerInfo after connect, exactly like
|
||||
/// the roster.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Start_AppliesWorldNameFromDurableServerInfoAfterConnect()
|
||||
{
|
||||
var calls = new List<string>();
|
||||
var operations = new TestOperations(calls)
|
||||
{
|
||||
ServerInfo = new ServerName.Parsed(1, 128, "sawato"),
|
||||
};
|
||||
var host = new TestHost(calls);
|
||||
var controller = new LiveSessionController(operations);
|
||||
|
||||
LiveSessionStartResult result = controller.Start(LiveOptions(), host);
|
||||
|
||||
Assert.Equal(LiveSessionStartStatus.Connected, result.Status);
|
||||
Assert.Equal(
|
||||
"sawato",
|
||||
controller.CharacterSelectionState.View.Snapshot.WorldName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Start_ReportsRosterFromCharacterListBeforeSelection()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue