refactor(runtime): unify generation reset for direct hosts

Move canonical per-session teardown into one retryable Runtime transaction, reduce App reset to projection acknowledgements, and prove the same GameRuntime graph through deterministic no-window lifecycle, gameplay, portal, fault, reconnect, and isolation gates.\n\nCo-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-27 00:43:26 +02:00
parent 7818494116
commit a9a822f206
28 changed files with 2707 additions and 345 deletions

View file

@ -94,29 +94,28 @@ public sealed class RuntimeSimulationFixtureHostTests
public RuntimeOnlySimulationFixtureHost()
{
EntityObjects = new RuntimeEntityObjectLifetime();
Inventory = new RuntimeInventoryState(EntityObjects);
Character = new RuntimeCharacterState();
Runtime = new GameRuntime(new GameRuntimeDependencies(
this,
this,
this,
this,
CombatTime: () => _now));
Character.Spellbook.InstallMetadata(SpellMetadata());
Character.Spellbook.OnSpellLearned(1u);
Communication = new RuntimeCommunicationState();
Actions = new RuntimeActionState(
Inventory.Transactions,
Character.Spellbook,
this,
this,
this,
this,
now: () => _now);
Movement = new RuntimeLocalPlayerMovementState();
}
public RuntimeEntityObjectLifetime EntityObjects { get; }
public RuntimeInventoryState Inventory { get; }
public RuntimeCharacterState Character { get; }
public RuntimeCommunicationState Communication { get; }
public RuntimeActionState Actions { get; }
public RuntimeLocalPlayerMovementState Movement { get; }
public GameRuntime Runtime { get; }
public RuntimeEntityObjectLifetime EntityObjects =>
Runtime.EntityObjects;
public RuntimeInventoryState Inventory =>
Runtime.InventoryOwner;
public RuntimeCharacterState Character =>
Runtime.CharacterOwner;
public RuntimeCommunicationState Communication =>
Runtime.CommunicationOwner;
public RuntimeActionState Actions => Runtime.ActionOwner;
public RuntimeLocalPlayerMovementState Movement =>
Runtime.MovementOwner;
public List<string> Trace { get; } = [];
public void Move()
@ -219,13 +218,7 @@ public sealed class RuntimeSimulationFixtureHostTests
}
public RuntimeSimulationOwnershipSnapshot CaptureOwnership() =>
RuntimeSimulationOwnership.Capture(
EntityObjects,
Inventory,
Character,
Communication,
Actions,
Movement);
Runtime.CaptureOwnership().Simulation;
public bool IsInWorld => true;
public uint LocalPlayerId => 0x50000001u;
@ -297,12 +290,7 @@ public sealed class RuntimeSimulationFixtureHostTests
if (_disposed)
return;
_disposed = true;
Movement.Dispose();
Actions.Dispose();
Communication.Dispose();
Character.Dispose();
Inventory.Dispose();
EntityObjects.Dispose();
Runtime.Dispose();
}
private static SpellTable SpellMetadata()