fix(ui,net): Campaign LA gate round 2 — char-select exit confirmation, authored row justify, world name

Finding 1 (Exit button dead): retail's gmCharacterManagementUI Exit
button (element 0x100003A4, offset 7 from the listbox base in
ListenToElementMessage@0x004ed5a0) opens MakeConfirmExitDialog
(0x004ed250), whose exact ID_CharacterManagement_ConfirmExit text
(table 0x23000002) and m_confirmExitDialogContext re-entry guard are
now ported. On confirm (matching RecvNotice_CloseDialog@0x004ed760
case 1's ConfirmationResult check) the client exits through the
EXISTING graceful window-close seam (CharacterSelectionRuntimeBindings
.RequestExit -> d.Window.Close, the same delegate
GameplayInputCommandController's Escape fallback already uses) so
disconnected/exited status events still fire via GameWindow.OnClosing
-> CompleteShutdown. Retail's real post-confirm destination is
QueueUIMode(0x10000009) -> gmEpilogueUI, an epilogue screen this round
does not port — recorded as AD-99. Credits (element 0x100003A3,
QueueUIMode(0x10000005) -> gmCreditsUI) stays visibly ghosted like
Create, same treatment, out of scope this round.

Finding 2 (row names center-aligned, retail is left): the character
row template (LayoutDesc 0x21000004, element 0x100003A5, live-DAT
confirmed HJustify=Left with three stateful Type-3 highlight-art
children and no Type-12 caption child) authors its OWN justify
directly, with no separate text child to lift a label from.
DatWidgetFactory.BuildButton's Left-justify branch required
!ReferenceEquals(labelInfo, info) — true only when a label was LIFTED
from a distinct child — so a button's own direct HJustify=Left was
silently dropped to UiButton's Center default. Widened the branch to
also honor the direct case, preserving the existing lifted-child
LabelOffsetX behavior and leaving genuinely-centered buttons
(CREATE/ENTER/DELETE/RESTORE) untouched.

Finding 3 (World box empty): parsed ACE's GameMessageServerName
(opcode 0xF7E1, ACE.Server/Network/GameMessages/Messages/
GameMessageServerName.cs; retail CM_Login::DispatchUI_WorldInfo
@0x006ad860 -> ClientUISystem::Handle_Login__WorldInfo@0x005641a0 ->
ECM_Login::SendNotice_WorldName@0x00692b10, notice 0x186a2, consumed
by gmCharacterManagementUI::UpdateWorldName@0x004ec120 /
RecvNotice_WorldName@0x004ec360 onto element 0x1000039B) as
src/AcDream.Core.Net/Messages/ServerName.cs, cross-checked against
holtburger's ServerNameData. WorldSession.ServerNameReceived fires
alongside CharacterListReceived (ACE sends both in one
SendConnectResponse batch); RuntimeCharacterSelectionState.
ApplyWorldName is the new J-owner field (ungated by lifecycle, since
either message can arrive first); CharacterManagementUiController
binds it onto the WorldTextElementId UiText. Per the LA1 status
vocabulary, the characterList STATUS event's worldName field is
intentionally NOT added this round (kept bounded to the client-side
fix) — a follow-up if the launcher UI wants it.

Also corrects AD-44, discovered stale while filing AD-99: its opening
claim ("acdream has no retained character-management screen") was
false as of this session — LA7/LA8 shipped the screen in earlier
commits without updating this row.

Tests: exit-confirm open/cancel/confirm/re-entry-guard flow;
DatWidgetFactory own-HJustify-Left/Center regression tests plus the
live-DAT pinned row-justify assertion; ServerName parse round-trip
(byte-exact vs ACE's AceWireWriter fixture, truncation/wrong-opcode
cases); WorldSession dispatch test (roster+world in one wire batch);
RuntimeCharacterSelectionState.ApplyWorldName tests (order-independent
of ApplyRoster, unchanged-value no-op, Reset clears); controller test
binding the World text element to the live snapshot. Extended the
shared RetailDialogFactoryTests.BuildDialogLayout test fixture with a
Confirmation-type branch (Accept/Reject buttons) since this is its
first RetailDialogType.Confirmation consumer.

Suites: full solution Release build green; AcDream.App.Tests 5100/6
skips, AcDream.Core.Net.Tests 965/0, AcDream.Runtime.Tests 1665/0, all
Release, 0 failures; live-DAT probes (ACDREAM_PROBE_LIVE_MOUNT=1)
green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-15 11:50:45 +02:00
parent 308f40a3fb
commit ef96c55489
18 changed files with 724 additions and 13 deletions

View file

@ -246,23 +246,27 @@ public sealed class LiveSessionController
private readonly Action _delete;
private readonly Action<CharacterRestore.Parsed> _restore;
private readonly Action<CharacterError.Parsed> _error;
private readonly Action<ServerName.Parsed> _worldName;
public CharacterSelectionWireBinding(
WorldSession session,
Action<CharacterList.Parsed> roster,
Action delete,
Action<CharacterRestore.Parsed> restore,
Action<CharacterError.Parsed> error)
Action<CharacterError.Parsed> error,
Action<ServerName.Parsed> worldName)
{
_session = session;
_roster = roster;
_delete = delete;
_restore = restore;
_error = error;
_worldName = worldName;
session.CharacterListReceived += roster;
session.CharacterDeleteAcknowledged += delete;
session.CharacterRestoreReceived += restore;
session.CharacterErrorReceived += error;
session.ServerNameReceived += worldName;
}
public bool IsDisposed => _session is null;
@ -276,6 +280,7 @@ public sealed class LiveSessionController
session.CharacterDeleteAcknowledged -= _delete;
session.CharacterRestoreReceived -= _restore;
session.CharacterErrorReceived -= _error;
session.ServerNameReceived -= _worldName;
}
}
@ -886,6 +891,14 @@ public sealed class LiveSessionController
if (IsCurrent(scope, generation))
CharacterSelectionState.ApplyError(error);
}
},
worldName =>
{
lock (_gate)
{
if (IsCurrent(scope, generation))
CharacterSelectionState.ApplyWorldName(worldName.WorldName);
}
});
public RuntimeCommandResult Highlight(

View file

@ -36,6 +36,11 @@ public enum RuntimeCharacterSelectionDeltaKind
ErrorChanged,
EnteringWorld,
EnteredWorld,
/// <summary>
/// Campaign LA gate round 2 finding 3: <see cref="ServerName"/> arrived —
/// see <see cref="RuntimeCharacterSelectionState.ApplyWorldName"/>.
/// </summary>
WorldNameChanged,
}
public readonly record struct RuntimeCharacterSelectionEntry(
@ -77,6 +82,7 @@ public readonly record struct RuntimeCharacterSelectionSnapshot(
string AccountName,
int SlotCount,
int RosterCount,
string WorldName,
uint HighlightedCharacterId,
int HighlightedDisplayIndex,
uint PendingDeleteCharacterId,
@ -202,6 +208,7 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
private long _revision;
private string _accountName = string.Empty;
private int _slotCount;
private string _worldName = string.Empty;
private uint _highlightedCharacterId;
private uint _pendingDeleteCharacterId;
private uint _lastRestoreRequestedCharacterId;
@ -236,6 +243,7 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
_accountName,
_slotCount,
_entries.Length,
_worldName,
_highlightedCharacterId,
selectedIndex,
_pendingDeleteCharacterId,
@ -326,6 +334,28 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
selected);
}
/// <summary>
/// Campaign LA gate round 2 finding 3: retail's <c>UpdateWorldName</c>
/// (<c>0x004ec120</c>) / <c>RecvNotice_WorldName</c> (<c>0x004ec360</c>)
/// both just push <c>Client::GetWorldName()</c> onto element
/// <c>0x1000039B</c> — no lifecycle gate. ACE sends <c>ServerName</c> in
/// the same batch as <c>CharacterList</c>, so this may land slightly
/// before or after <see cref="ApplyRoster"/>; it is intentionally
/// ungated (beyond disposal) so neither arrival order loses the name.
/// </summary>
internal void ApplyWorldName(string worldName)
{
ArgumentNullException.ThrowIfNull(worldName);
lock (_gate)
{
if (_disposed || _worldName == worldName)
return;
_worldName = worldName;
_revision++;
}
Publish(RuntimeCharacterSelectionDeltaKind.WorldNameChanged);
}
internal bool TryHighlight(uint characterId)
{
lock (_gate)
@ -900,6 +930,7 @@ public sealed class RuntimeCharacterSelectionState : IDisposable
_entries = [];
_accountName = string.Empty;
_slotCount = 0;
_worldName = string.Empty;
_highlightedCharacterId = 0u;
_pendingDeleteCharacterId = 0u;
_lastRestoreRequestedCharacterId = 0u;