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

@ -308,6 +308,7 @@ public sealed class InteractionUiRuntimeSourcesTests
AccountName: "account",
SlotCount: 0,
RosterCount: 0,
WorldName: string.Empty,
HighlightedCharacterId: 0u,
HighlightedDisplayIndex: -1,
PendingDeleteCharacterId: 0u,

View file

@ -67,6 +67,18 @@ public sealed class CharacterManagementLiveDatTests
"DELETE");
AssertButton(screen, CharacterManagementUiController.RestoreElementId,
"RESTORE");
// Finding 1: retail's bottom-row Credits/Exit buttons (offsets 6/7
// from the listbox base in
// gmCharacterManagementUI::ListenToElementMessage@0x004ed5a0).
AssertButton(screen, CharacterManagementUiController.CreditsElementId,
"CREDITS");
AssertButton(screen, CharacterManagementUiController.ExitElementId,
"EXIT");
// Finding 3: the World box (retail element 0x1000039B, resolved via
// UpdateWorldName@0x004ec120) imports as a plain UiText the
// controller binds Runtime's ServerName-sourced snapshot field to.
Assert.IsType<UiText>(screen.FindElement(
CharacterManagementUiController.WorldTextElementId));
Assert.DoesNotContain(
Descendants(screen.Root),
static element => element is UiViewport);
@ -88,6 +100,21 @@ public sealed class CharacterManagementLiveDatTests
],
rowInfo.States.Keys.Order().ToArray());
// Campaign LA gate round 2 finding 2: the row template's OWN authored
// justify is Left (character names render left-aligned in retail, not
// centered) — it carries three stateful Type-3 highlight-art children
// (0x10000481-0x10000483, the Normal_rollover/Normal_pressed/Highlight/
// Highlight_rollover face art) and NO Type-12 caption child, so the row's
// Left justify can only come from ElementInfo.HJustify directly, never a
// lifted text child. DatWidgetFactory.BuildButton must honor it.
Assert.Equal(HJustify.Left, rowInfo.HJustify);
Assert.DoesNotContain(rowInfo.Children, static child => child.Type == 12u);
ImportedLayout? builtRowLayout = LayoutImporter.Import(
dats, template.TemplateLayoutId, template.TemplateElementId,
_ => (0u, 0, 0), null, null);
var builtRow = Assert.IsType<UiButton>(builtRowLayout!.Root);
Assert.Equal(UiButton.LabelAlignment.Left, builtRow.LabelAlign);
uint dialogDid = RetailDataIdResolver.Resolve(dats, 2u, 5u);
Assert.Equal(0x2100003Cu, dialogDid);
ImportedLayout message = BuildSelected(dats, dialogDid, 0x24u);
@ -108,6 +135,14 @@ public sealed class CharacterManagementLiveDatTests
"ID_CharacterManagement_PleaseWait"));
Assert.Equal("Entering World", Resolve(strings, table,
"ID_Character_EnteringWorld"));
// Finding 1: MakeConfirmExitDialog@0x004ed250's text
// (compute_str_hash("ID_CharacterManagement_ConfirmExit"), table
// enum 0x10000002 -> 0x23000002). The raw DAT string carries a
// literal two-character "\n" escape (this test's Resolve() helper
// does not normalize it — RetailUiRuntime does, via
// NormalizeRetailNewlines, before handing it to the controller).
Assert.Equal("Are you sure you want to leave?\\n", Resolve(strings, table,
"ID_CharacterManagement_ConfirmExit"));
string confirmation = Assert.IsType<string>(strings.ResolveTemplate(
table,
"ID_CharacterManagement_DeleteCharacterConfirmation",

View file

@ -99,6 +99,32 @@ public sealed class CharacterManagementUiControllerTests
Assert.True(restore.Enabled);
}
/// <summary>
/// Campaign LA gate round 2 finding 3: retail's UpdateWorldName@0x004ec120
/// / RecvNotice_WorldName@0x004ec360 both push Client::GetWorldName()
/// onto element 0x1000039B. The controller binds Runtime's borrowed
/// snapshot field to that same element.
/// </summary>
[Fact]
public void WorldName_TicksFromSnapshot_IntoTheWorldTextElement()
{
using var environment = new EnvironmentHarness();
CharacterManagementUiController controller = environment.Controller;
var worldText = Assert.IsType<UiText>(environment.Screen.FindElement(
CharacterManagementUiController.WorldTextElementId));
Assert.Equal(
"sawato",
string.Join(" ", worldText.LinesProvider().Select(static line => line.Text)));
environment.Runtime.SetWorldName("Frostfell");
controller.Tick();
Assert.Equal(
"Frostfell",
string.Join(" ", worldText.LinesProvider().Select(static line => line.Text)));
}
[Fact]
public void RowHeight_UsesAllowedSlotsAndClampsAtOneTenthForLargeRosters()
{
@ -346,6 +372,81 @@ public sealed class CharacterManagementUiControllerTests
controller.Rows.Select(static row => row.Label!).ToArray());
}
/// <summary>
/// Campaign LA gate round 2 finding 1: Exit -> MakeConfirmExitDialog
/// (0x004ed250, retail's confirm-only dialog type 1) -> Cancel/Reject
/// leaves the screen exactly as it was — no exit request reaches
/// Runtime's window-close binding.
/// </summary>
[Fact]
public void ExitButton_OpenThenCancel_KeepsScreenActive_NoExitRequested()
{
using var environment = new EnvironmentHarness();
CharacterManagementUiController controller = environment.Controller;
UiButton exit = environment.Button(
CharacterManagementUiController.ExitElementId);
exit.OnClick!();
Assert.NotEqual(0u, controller.ConfirmExitDialogContext);
ImportedLayout dialog = environment.LastDialog(RetailDialogType.Confirmation);
Assert.Equal(
"Are you sure you want to leave?",
Message(dialog));
DialogButton(dialog, RetailConfirmationDialogView.RejectButtonId).OnClick!();
Assert.Equal(0, environment.Runtime.RequestExitCalls);
Assert.Equal(0u, controller.ConfirmExitDialogContext);
Assert.False(environment.Dialogs.IsOpen);
Assert.True(controller.Root.Visible);
}
/// <summary>
/// Confirm reaches the SAME graceful-shutdown seam window-close uses —
/// asserted here via the bindings fake, since the controller/Runtime
/// boundary is a plain host <c>Action</c>
/// (<see cref="CharacterSelectionRuntimeBindings.RequestExit"/>), not a
/// generation-gated Runtime command.
/// </summary>
[Fact]
public void ExitButton_OpenThenConfirm_ReachesGracefulShutdownSeam()
{
using var environment = new EnvironmentHarness();
CharacterManagementUiController controller = environment.Controller;
UiButton exit = environment.Button(
CharacterManagementUiController.ExitElementId);
exit.OnClick!();
ImportedLayout dialog = environment.LastDialog(RetailDialogType.Confirmation);
DialogButton(dialog, RetailConfirmationDialogView.AcceptButtonId).OnClick!();
Assert.Equal(1, environment.Runtime.RequestExitCalls);
Assert.Equal(0u, controller.ConfirmExitDialogContext);
Assert.False(environment.Dialogs.IsOpen);
}
/// <summary>
/// MakeConfirmExitDialog's own guard (<c>m_confirmExitDialogContext != 0
/// -&gt; return</c>): a second Exit click while the confirmation is
/// already open does not open a second dialog.
/// </summary>
[Fact]
public void ExitButton_SecondClickWhileOpen_IsNoOp()
{
using var environment = new EnvironmentHarness();
UiButton exit = environment.Button(
CharacterManagementUiController.ExitElementId);
exit.OnClick!();
Assert.Equal(1, environment.DialogLayouts.Count(
entry => entry.Type == RetailDialogType.Confirmation));
exit.OnClick!();
Assert.Equal(1, environment.DialogLayouts.Count(
entry => entry.Type == RetailDialogType.Confirmation));
}
[Fact]
public void AuthoredRowDoubleActivation_EntersTheHighlightedCharacter()
{
@ -598,7 +699,8 @@ public sealed class CharacterManagementUiControllerTests
name => $"WARNING! {name}\nType DELETE in the box below.",
"DELETE",
"Please Wait",
"Entering World");
"Entering World",
"Are you sure you want to leave?");
private static void AssertDetachedAndUnbound(ImportedLayout screen)
{
@ -633,6 +735,15 @@ public sealed class CharacterManagementUiControllerTests
0x21000004u,
0x100003A5u));
root.Children.Add(list);
root.Children.Add(new ElementInfo
{
Id = CharacterManagementUiController.WorldTextElementId,
Type = 12u,
X = 21f,
Y = 44f,
Width = 193f,
Height = 110f,
});
root.Children.Add(ButtonInfo(
CharacterManagementUiController.CreateElementId));
root.Children.Add(ButtonInfo(
@ -641,6 +752,10 @@ public sealed class CharacterManagementUiControllerTests
CharacterManagementUiController.DeleteElementId));
root.Children.Add(ButtonInfo(
CharacterManagementUiController.RestoreElementId));
root.Children.Add(ButtonInfo(
CharacterManagementUiController.CreditsElementId));
root.Children.Add(ButtonInfo(
CharacterManagementUiController.ExitElementId));
if (includePreview)
{
root.Children.Add(new ElementInfo
@ -762,7 +877,8 @@ public sealed class CharacterManagementUiControllerTests
RequestDelete,
ConfirmDelete,
Restore,
Cancel);
Cancel,
RequestExit);
}
public FakeView View { get; } = new();
@ -773,6 +889,7 @@ public sealed class CharacterManagementUiControllerTests
public int ConfirmDeleteCalls { get; private set; }
public int CancelCalls { get; private set; }
public int RestoreCalls { get; private set; }
public int RequestExitCalls { get; private set; }
public RuntimeCommandStatus RestoreStatus { get; set; } =
RuntimeCommandStatus.Accepted;
public bool ThrowOnRestore { get; set; }
@ -814,6 +931,9 @@ public sealed class CharacterManagementUiControllerTests
public void SetLifecycle(RuntimeCharacterSelectionLifecycle lifecycle) =>
Update(snapshot => snapshot with { Lifecycle = lifecycle });
public void SetWorldName(string worldName) =>
Update(snapshot => snapshot with { WorldName = worldName });
public void SetError(string message) => Update(snapshot => snapshot with
{
Lifecycle = RuntimeCharacterSelectionLifecycle.AwaitingSelection,
@ -915,6 +1035,8 @@ public sealed class CharacterManagementUiControllerTests
return Result(RuntimeCommandStatus.Accepted);
}
private void RequestExit() => RequestExitCalls++;
private RuntimeCharacterSelectionButtons ButtonsFor(uint characterId)
{
RuntimeCharacterSelectionEntry? selected = View.Entries
@ -959,6 +1081,7 @@ public sealed class CharacterManagementUiControllerTests
"account",
SlotCount: 5,
RosterCount: View.Entries.Length,
WorldName: "sawato",
highlightedCharacterId,
HighlightedDisplayIndex: Array.FindIndex(
View.Entries,

View file

@ -305,6 +305,67 @@ public class DatWidgetFactoryTests
Assert.IsType<UiButton>(e);
}
/// <summary>
/// Campaign LA gate round 2 finding 2: the retail character-select row
/// template (LayoutDesc 0x21000004, element 0x100003A5, live-DAT
/// confirmed) authors HJustify=Left DIRECTLY on the row's own
/// UIElement_Button — no separate Type-12 caption child (its label comes
/// from the runtime-bound character name, not an authored string), just
/// three stateful Type-3 highlight-art children. The old guard
/// (<c>!ReferenceEquals(labelInfo, info)</c>) only honored HJustify when
/// the label was LIFTED from a distinct Type-12 child, so a button
/// authoring its own justify with no such child fell through to
/// UiButton's Center default. This reproduces that exact shape.
/// </summary>
[Fact]
public void BuildButton_OwnHJustifyLeft_NoTextChild_MultipleStatefulFaces_LabelAlignsLeft()
{
var info = new ElementInfo
{
Type = 1,
Width = 160,
Height = 16,
HJustify = HJustify.Left,
};
info.States[1u] = new UiStateInfo { Id = 1u, Name = "Normal" };
info.States[2u] = new UiStateInfo { Id = 2u, Name = "Normal_rollover" };
info.States[3u] = new UiStateInfo { Id = 3u, Name = "Highlight" };
for (int i = 0; i < 3; i++)
{
var face = new ElementInfo { Type = 3, ReadOrder = (uint)i };
face.StateMedia["Normal_rollover"] = (0x06000000u + (uint)i, 1);
info.Children.Add(face);
}
var button = Assert.IsType<UiButton>(DatWidgetFactory.Create(info, NoTex, null));
Assert.Equal(UiButton.LabelAlignment.Left, button.LabelAlign);
// Direct (non-lifted) case: LabelOffsetX stays at UiButton's own
// default small left padding, not a bogus inner offset.
Assert.Equal(3f, button.LabelOffsetX);
}
/// <summary>
/// A button whose own authored HJustify really is Center (the normal
/// case — CREATE/ENTER/DELETE/RESTORE captions) must stay centered; the
/// fix only widens the Left branch, it must not force every button left.
/// </summary>
[Fact]
public void BuildButton_OwnHJustifyCenter_NoTextChild_StaysCentered()
{
var info = new ElementInfo
{
Type = 1,
Width = 160,
Height = 16,
HJustify = HJustify.Center,
};
var button = Assert.IsType<UiButton>(DatWidgetFactory.Create(info, NoTex, null));
Assert.Equal(UiButton.LabelAlignment.Center, button.LabelAlign);
}
// ── Test 5b: Type 11 → UiScrollbar ──────────────────────────────────────
[Fact]

View file

@ -729,6 +729,32 @@ public sealed class RetailDialogFactoryTests
Height = 32f,
});
}
else if (type == RetailDialogType.Confirmation)
{
// Campaign LA gate round 2 finding 1: CharacterManagementUiController's
// exit-confirm dialog is the first BuildDialogLayout consumer that
// exercises RetailDialogType.Confirmation through this synthetic
// builder (other Confirmation coverage in THIS file uses the real
// FixtureLoader.LoadConfirmationDialog() fixture instead).
popup.Children.Add(new ElementInfo
{
Id = RetailConfirmationDialogView.AcceptButtonId,
Type = 1u,
X = 80f,
Y = 48f,
Width = 80f,
Height = 32f,
});
popup.Children.Add(new ElementInfo
{
Id = RetailConfirmationDialogView.RejectButtonId,
Type = 1u,
X = 240f,
Y = 48f,
Width = 80f,
Height = 32f,
});
}
else if (type == RetailDialogType.ConfirmationTextInput)
{
var field = new ElementInfo

View file

@ -0,0 +1,81 @@
using System.Buffers.Binary;
using AcDream.Core.Net.Messages;
namespace AcDream.Core.Net.Tests.Messages;
public sealed class ServerNameTests
{
[Fact]
public void Parse_MirrorsAceSerializer_ExactFields()
{
// Mirrors ACE's GameMessageServerName: opcode, i32 currentConnections,
// i32 maxConnections, String16L serverName.
var w = AceWireWriter.GameMessage(ServerName.Opcode)
.Write(123)
.Write(1000)
.WriteString16L("sawato");
ServerName.Parsed parsed = ServerName.Parse(w.ToArray());
Assert.Equal(123, parsed.CurrentConnections);
Assert.Equal(1000, parsed.MaxConnections);
Assert.Equal("sawato", parsed.WorldName);
}
[Fact]
public void Parse_NegativeMaxConnections_PreservesSign()
{
// ACE's default is maxConnections = -1 (unlimited); the field must
// stay signed rather than being read as a huge unsigned value.
var w = AceWireWriter.GameMessage(ServerName.Opcode)
.Write(0)
.Write(-1)
.WriteString16L("Frostfell");
ServerName.Parsed parsed = ServerName.Parse(w.ToArray());
Assert.Equal(0, parsed.CurrentConnections);
Assert.Equal(-1, parsed.MaxConnections);
Assert.Equal("Frostfell", parsed.WorldName);
}
[Fact]
public void Parse_EmptyWorldName_RoundTrips()
{
var w = AceWireWriter.GameMessage(ServerName.Opcode)
.Write(0)
.Write(0)
.WriteString16L(string.Empty);
ServerName.Parsed parsed = ServerName.Parse(w.ToArray());
Assert.Equal(string.Empty, parsed.WorldName);
}
[Fact]
public void Parse_WrongOpcode_Throws()
{
byte[] bytes = new byte[4];
BinaryPrimitives.WriteUInt32LittleEndian(bytes, 0xDEADBEEFu);
Assert.Throws<FormatException>(() => ServerName.Parse(bytes));
}
[Fact]
public void Parse_TruncatedAfterCurrentConnections_Throws()
{
var w = AceWireWriter.GameMessage(ServerName.Opcode).Write(0);
Assert.Throws<FormatException>(() => ServerName.Parse(w.ToArray()));
}
[Fact]
public void Parse_TruncatedBeforeWorldName_Throws()
{
var w = AceWireWriter.GameMessage(ServerName.Opcode)
.Write(0)
.Write(0);
Assert.Throws<FormatException>(() => ServerName.Parse(w.ToArray()));
}
}

View file

@ -92,6 +92,30 @@ public sealed class WorldSessionCharacterSelectionTests
Assert.Equal(1u, current.SecondsGreyedOut);
}
[Fact]
public void ServerName_Dispatches_AndPopulatesServerInfo()
{
// Campaign LA gate round 2 finding 3: ACE's SendConnectResponse
// enqueues CharacterList then ServerName in the same batch
// (AuthenticationHandler.cs:257-261) — assert both arrive, in wire
// order, through the same UIQueue dispatch path.
using var session = CreateSession();
var events = new List<string>();
session.CharacterListReceived += _ => events.Add("roster");
session.ServerNameReceived += info => events.Add($"world:{info.WorldName}");
byte[] packet = BuildPacket(
BuildRoster(secondsGreyedOut: 0u),
BuildServerName("sawato", currentConnections: 3, maxConnections: 100));
InvokeProcessDatagram(session, packet);
Assert.Equal(["roster", "world:sawato"], events);
Assert.NotNull(session.ServerInfo);
Assert.Equal("sawato", session.ServerInfo!.Value.WorldName);
Assert.Equal(3, session.ServerInfo!.Value.CurrentConnections);
Assert.Equal(100, session.ServerInfo!.Value.MaxConnections);
}
[Fact]
public void ImmediateEnterWorld_IgnoresNumErrorsSentinelBeforeServerReady()
{
@ -183,6 +207,19 @@ public sealed class WorldSessionCharacterSelectionTests
return writer.ToArray();
}
private static byte[] BuildServerName(
string worldName,
int currentConnections,
int maxConnections)
{
var writer = new PacketWriter(64);
writer.WriteUInt32(ServerName.Opcode);
writer.WriteUInt32(unchecked((uint)currentConnections));
writer.WriteUInt32(unchecked((uint)maxConnections));
writer.WriteString16L(worldName);
return writer.ToArray();
}
private static byte[] BuildRestoreResponse()
{
var writer = new PacketWriter(64);

View file

@ -291,6 +291,55 @@ public sealed class RuntimeCharacterSelectionStateTests
delta => Assert.Equal(new RuntimeGenerationToken(9), delta.Generation));
}
[Fact]
public void ApplyWorldName_PopulatesSnapshot_IndependentOfRoster()
{
// Campaign LA gate round 2 finding 3: ACE sends ServerName in the
// same batch as CharacterList; ApplyWorldName must not require
// ApplyRoster to have run first (arrival order is not guaranteed).
using var state = new RuntimeCharacterSelectionState();
state.Begin(new RuntimeGenerationToken(5));
Assert.Equal(string.Empty, state.Snapshot.WorldName);
state.ApplyWorldName("sawato");
Assert.Equal("sawato", state.Snapshot.WorldName);
state.ApplyRoster(Roster(
new LiveSessionRosterEntry(0x50000001u, "One", 0u)));
Assert.Equal("sawato", state.Snapshot.WorldName);
Assert.Equal(0x50000001u, state.Snapshot.HighlightedCharacterId);
}
[Fact]
public void ApplyWorldName_UnchangedValue_DoesNotBumpRevisionOrPublish()
{
using var state = new RuntimeCharacterSelectionState();
state.Begin(new RuntimeGenerationToken(6));
state.ApplyWorldName("sawato");
var deltas = new List<RuntimeCharacterSelectionDelta>();
using IDisposable subscription = state.View.Subscribe(
new Observer(deltas.Add));
long revision = state.Snapshot.Revision;
state.ApplyWorldName("sawato");
Assert.Equal(revision, state.Snapshot.Revision);
Assert.Empty(deltas);
}
[Fact]
public void Reset_ClearsWorldName()
{
using var state = new RuntimeCharacterSelectionState();
state.Begin(new RuntimeGenerationToken(8));
state.ApplyWorldName("sawato");
state.Reset(new RuntimeGenerationToken(9));
Assert.Equal(string.Empty, state.Snapshot.WorldName);
}
private static LiveSessionRosterReport Roster(
params LiveSessionRosterEntry[] entries) =>
new("Canonical", 11, entries);