fix(net,runtime): FA2 fix-round MUST-FIX -- allegiance clears at reset, 0x027C stops seeding
Two MUST-FIX findings from the FA2 mechanism/blast reviews (docs/research/2026-08-12-fa2-review-mechanism.md, docs/research/2026-08-12-fa2-review-blast.md): MF-1 (mechanism) -- RuntimeAllegianceState survived a generation reset, contradicting retail (ClientAllegianceSystem::OnEndCharacterSession @0x00569FA0 tail-calls AllegianceProfile::Clear at the same boundary Fellowship already clears at), contradicting the precedent it cited (RuntimeCharacterOptionsState.ResetSession clears-and-relatches, it does not persist), and pinned by a test asserting the wrong behavior. Fixed: RuntimeAllegianceState.ResetSession() clears the profile and drops HasServerSeed; a new RuntimeGenerationResetStage.Allegiance stage runs it on every generation reset, mirroring RuntimeFellowshipState exactly. RuntimeGenerationResetTests' FellowshipClearsAtResetButAllegianceSurvivesReconnect inverted to FellowshipAndAllegianceBothClearAtGenerationReset. MF-2 (mechanism) / blast MF-2 -- 0x027C AllegianceInfoResponse fed the Runtime allegiance owner (self-gated). Retail's own handler for 0x027C (CM_Allegiance::DispatchUI_AllegianceInfoResponseEvent @0x006a7470) unpacks into a stack-local profile destroyed on return; the consumer (Handle_Allegiance__AllegianceInfoResponseEvent @0x0056a1d0) only prints AddTextToScroll lines. Retail's panel is fed exclusively by 0x0020 AllegianceUpdate. The removed seeding also fabricated RuntimeAllegianceSnapshot.Rank (0x027C carries no rank field) on any client whose first allegiance message was a self @allegiance info query. Fixed: dropped ApplyInfoResponseSelf, the onAllegianceInfoResponseSelf delegate hole, and the self-gate; 0x027C is text-only again, matching retail and the pre-FA2 shape. Also covers blast SHOULD-FIX 1 in the same edit to LiveSessionEventRouter.cs: the fellowship/allegiance delegate holes are now passed conditionally on the owner being supplied, so GameEventDispatcher.GetUnhandledCount reads correctly for callers without an owner (bare-ChatLog tests, a future partial host) instead of silently reading 0 for 9 event types whose parse result was discarded. RuntimeAllegianceState.cs and the two owners' Apply* mutators also move their ObjectDisposedException.ThrowIf checks inside the lock they already take (mechanism SHOULD-FIX 2) -- the prior check-then-lock shape let an inbound event on the decode thread race Dispose on the host thread and repopulate state after _disposed = true, permanently falsifying CaptureOwnership().IsConverged at teardown. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
63649c8053
commit
4272ad0ea4
9 changed files with 425 additions and 229 deletions
|
|
@ -223,10 +223,18 @@ public sealed class GameRuntime
|
|||
faultInjection);
|
||||
|
||||
// Campaign FA slice FA2 (2026-08-12): two sibling J-owners, not
|
||||
// children of Communication — the reset semantics differ
|
||||
// (fellowship is session-scoped, allegiance survives reconnect;
|
||||
// docs/research/2026-08-11-fa-acdream-seams.md §1.3).
|
||||
context.Fellowship = new RuntimeFellowshipState();
|
||||
// children of Communication. Originally documented as differing
|
||||
// in reset semantics (fellowship session-scoped, allegiance
|
||||
// surviving reconnect) — the FA2 fix-round MUST-FIX 1
|
||||
// (docs/research/2026-08-12-fa2-review-mechanism.md) found that
|
||||
// citation inverted (retail clears BOTH at
|
||||
// OnEndCharacterSession) and corrected both owners to clear at
|
||||
// every generation reset. They remain two owners because
|
||||
// fellowship and allegiance are still independent retail
|
||||
// systems with independent wire families — not because their
|
||||
// lifetimes differ anymore.
|
||||
context.Fellowship = new RuntimeFellowshipState(
|
||||
timeProvider: dependencies.TimeProvider);
|
||||
construction.Own(context.Fellowship);
|
||||
Fault(
|
||||
GameRuntimeConstructionPoint.FellowshipCreated,
|
||||
|
|
@ -293,7 +301,8 @@ public sealed class GameRuntime
|
|||
context.EntityObjects,
|
||||
context.Character,
|
||||
context.PlayerIdentity,
|
||||
context.Fellowship);
|
||||
context.Fellowship,
|
||||
context.Allegiance);
|
||||
|
||||
context.Movement.AttachPhysicsPublication(
|
||||
new RuntimeLocalPlayerPhysicsPublicationState(
|
||||
|
|
@ -713,16 +722,19 @@ public sealed class GameRuntime
|
|||
| GameRuntimeTeardownStage.MovementDisposed
|
||||
| GameRuntimeTeardownStage.CharacterDisposed
|
||||
| GameRuntimeTeardownStage.InventoryDisposed,
|
||||
9 => GameRuntimeTeardownStage.HostLeasesReleased
|
||||
| GameRuntimeTeardownStage.EventsDetached
|
||||
| GameRuntimeTeardownStage.SessionDisposed
|
||||
| GameRuntimeTeardownStage.TransitReset
|
||||
| GameRuntimeTeardownStage.ActionsDisposed
|
||||
| GameRuntimeTeardownStage.MovementDisposed
|
||||
| GameRuntimeTeardownStage.CharacterDisposed
|
||||
| GameRuntimeTeardownStage.InventoryDisposed
|
||||
| GameRuntimeTeardownStage.CommunicationDisposed
|
||||
| GameRuntimeTeardownStage.FellowshipDisposed,
|
||||
// Blast MF-1 (docs/research/2026-08-12-fa2-review-blast.md,
|
||||
// 2026-08-12 fix round): stage 9 disposes Fellowship (see
|
||||
// DrainCurrentStage/case 9 below), so at _disposeStage == 9
|
||||
// only stages 0..8 have COMPLETED — the flag set must end at
|
||||
// CommunicationDisposed (9 flags), not include
|
||||
// FellowshipDisposed. The original longhand spelling had one
|
||||
// flag too many; restored to the self-checking subtraction form
|
||||
// every other case already uses.
|
||||
9 => GameRuntimeTeardownStage.Complete
|
||||
& ~GameRuntimeTeardownStage.FellowshipDisposed
|
||||
& ~GameRuntimeTeardownStage.AllegianceDisposed
|
||||
& ~GameRuntimeTeardownStage.IdentityDisposed
|
||||
& ~GameRuntimeTeardownStage.EntityObjectsDisposed,
|
||||
10 => GameRuntimeTeardownStage.Complete
|
||||
& ~GameRuntimeTeardownStage.AllegianceDisposed
|
||||
& ~GameRuntimeTeardownStage.IdentityDisposed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue