diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 9c6d7b6f1..d9fea9b52 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -14931,9 +14931,9 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) "_hasSentDaemonMoveVector", "_hasSentDaemonLookDirection", "_hasSentDaemonTractorPower", - "Func _resolveClient", + "Func _resolveControl", "Action submit", - "submit(client.Control)", + "submit(control)", "Failed to send Aetheria daemon pilot {label} operation", "operations => operations.SetMoveVector", "operations => operations.SetLookDirection", @@ -14951,6 +14951,8 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root) var forbiddenSentOperationSymbols = new[] { + "Func _resolveClient", + "submit(client.Control)", "Func _resolveObserver", "Action submit", "submit(observer.Operations)" diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 81f98eb3f..a39af27ac 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -32,7 +32,9 @@ public class ActionGameManager : MonoBehaviour private AetheriaUnityGameplayBootShell _gameplayBootShell; private AetheriaUnityGameplaySceneWiring _sceneWiring; private AetheriaUnityPilotCommandSender PilotCommands => - _pilotCommands ??= new AetheriaUnityPilotCommandSender(ResolveCurrentRuntimeClient, () => Time.unscaledTime); + _pilotCommands ??= new AetheriaUnityPilotCommandSender( + () => AetheriaUnityRuntimeClientProvider.Control("unity-pilot-commands"), + () => Time.unscaledTime); private AetheriaUnityObservedDockingIndex ObservedDocking => _observedDocking ??= new AetheriaUnityObservedDockingIndex(_observedEntityIndex); private AetheriaUnityObservedEntityRestorer ObservedEntityRestorer => @@ -291,12 +293,6 @@ public class ActionGameManager : MonoBehaviour private readonly AetheriaUnityDragSession _dragSession = new AetheriaUnityDragSession(); private readonly AetheriaUnityActionBarPresentation _actionBarPresentation = new AetheriaUnityActionBarPresentation(); - private static AetheriaClient ResolveCurrentRuntimeClient() - { - return AetheriaUnityRuntimeClientProvider.CurrentClientForStateFile( - AetheriaUnityRuntimePaths.RuntimeStateFilePath); - } - private void OnDisable() { _gameplayInputShell?.Dispose(); diff --git a/Assets/Scripts/Gameplay/AetheriaUnityPilotCommandSender.cs b/Assets/Scripts/Gameplay/AetheriaUnityPilotCommandSender.cs index f0102abc2..b09ffe655 100644 --- a/Assets/Scripts/Gameplay/AetheriaUnityPilotCommandSender.cs +++ b/Assets/Scripts/Gameplay/AetheriaUnityPilotCommandSender.cs @@ -15,7 +15,7 @@ public sealed class AetheriaUnityPilotCommandSender private const float DaemonTractorCommandIntervalSeconds = 0.05f; private const float DaemonTractorCommandChangeThreshold = 0.001f; - private readonly Func _resolveClient; + private readonly Func _resolveControl; private readonly Func _time; private Vector2 _lastSentDaemonMoveVector; private Vector3 _lastSentDaemonLookDirection; @@ -28,10 +28,10 @@ public sealed class AetheriaUnityPilotCommandSender private bool _hasSentDaemonTractorPower; public AetheriaUnityPilotCommandSender( - Func resolveClient, + Func resolveControl, Func time) { - _resolveClient = resolveClient ?? throw new ArgumentNullException(nameof(resolveClient)); + _resolveControl = resolveControl ?? throw new ArgumentNullException(nameof(resolveControl)); _time = time ?? throw new ArgumentNullException(nameof(time)); } @@ -99,16 +99,18 @@ public sealed class AetheriaUnityPilotCommandSender Action submit, string label) { - var client = _resolveClient(); - if (client == null || - submit == null) + if (submit == null) { return false; } try { - submit(client.Control); + var control = _resolveControl(); + if (control == null) + return false; + + submit(control); return true; } catch (Exception ex)