refactor(runtime): own communication and social state

Construct chat history, negotiated channels, friends, squelch, and reply targets in one presentation-independent Runtime owner. Make live routing, retained UI, devtools, and current-runtime projections borrow the exact instances, preserve reconnect reset semantics, and publish failure-isolated reentrant-safe chat commits.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-26 07:50:16 +02:00
parent e321410770
commit c9d25ade50
19 changed files with 684 additions and 117 deletions

View file

@ -193,7 +193,7 @@ public sealed class InteractionRetainedUiCompositionTests
Objects: null!,
MagicCatalog: null!,
Spellbook: null!,
Chat: null!,
Communication: null!,
LocalPlayer: null!,
ItemMana: null!,
StackSplitQuantity: null!,

View file

@ -9,6 +9,7 @@ using AcDream.App.Rendering;
using AcDream.App.Settings;
using AcDream.Core.Chat;
using AcDream.Core.Combat;
using AcDream.Runtime.Gameplay;
using AcDream.Core.Player;
using AcDream.Core.Spells;
using AcDream.UI.Abstractions.Input;
@ -228,7 +229,7 @@ public sealed class SettingsDevToolsCompositionTests
Settings,
Startup,
new HostQuiescenceGate(),
new ChatLog(),
new RuntimeCommunicationState(),
new CombatState(),
new LocalPlayerState(new Spellbook()),
enabled

View file

@ -474,6 +474,7 @@ public sealed class GameWindowSlice8BoundaryTests
"new ResourceShutdownStage(\"live entity dependents\"",
"new ResourceShutdownStage(\"submitted GPU work\"",
"new ResourceShutdownStage(\"render frontends\"",
"new ResourceShutdownStage(\"runtime communication state\"",
"new ResourceShutdownStage(\"shared texture owners\"",
"new ResourceShutdownStage(\"mesh adapter\"",
"new ResourceShutdownStage(\"remaining render owners\"",

View file

@ -18,6 +18,7 @@ using AcDream.Core.Selection;
using AcDream.Core.World;
using AcDream.Runtime;
using AcDream.Runtime.Entities;
using AcDream.Runtime.Gameplay;
using AcDream.Runtime.Session;
using AcDream.UI.Abstractions;
using AcDream.UI.Abstractions.Input;
@ -411,7 +412,7 @@ public sealed class CurrentGameRuntimeAdapterTests
new NoopEntityResources(),
EntityObjects);
Objects = EntityObjects.Objects;
Chat = new ChatLog();
Communication = new RuntimeCommunicationState();
Selection = new SelectionState();
MovementInput = new DispatcherMovementInputSource();
GameplayInput = new GameplayInputFrameController(
@ -456,7 +457,7 @@ public sealed class CurrentGameRuntimeAdapterTests
Identity,
Entities,
EntityObjects,
Chat,
Communication,
new LocalPlayerControllerSlot(),
WorldReveal,
Clock,
@ -471,7 +472,8 @@ public sealed class CurrentGameRuntimeAdapterTests
public RuntimeEntityObjectLifetime EntityObjects { get; }
public LiveEntityRuntime Entities { get; }
public ClientObjectTable Objects { get; }
public ChatLog Chat { get; }
public RuntimeCommunicationState Communication { get; }
public ChatLog Chat => Communication.Chat;
public SelectionState Selection { get; }
public DispatcherMovementInputSource MovementInput { get; }
public GameplayInputFrameController GameplayInput { get; }
@ -485,6 +487,7 @@ public sealed class CurrentGameRuntimeAdapterTests
public void Dispose()
{
Runtime.Dispose();
Communication.Dispose();
_session.Dispose();
_items.Dispose();
Entities.Clear();