From 8d0b9a7785694f9fc7c30974e5397875b607defe Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 29 Jun 2026 06:51:33 +0100 Subject: [PATCH] Remove ambient runtime client lookup --- Aetheria.State.Verify/Program.cs | 5 +++-- .../AetheriaUnityRuntimeClientProvider.cs | 18 +----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 7cf8de92a..5e9c1513b 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -16337,7 +16337,6 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) "public static AetheriaUi Ui(", "public static CultMeshReactiveDocument Reactive(string runtimeId = \"\")", "public static CultMeshReactiveDocument Reactive(", - "public static AetheriaClient CurrentClientForStateFile(string stateFilePath)", "private static readonly Dictionary RuntimeClients", "RuntimeClients.TryGetValue(cacheKey, out var runtimeClient)", "RuntimeClients[cacheKey] = runtimeClient", @@ -16361,10 +16360,12 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) } if (runtimeClientProvider.Contains("AetheriaRuntimePlayerSettingsSession _playerSettingsDocument", StringComparison.Ordinal) || + runtimeClientProvider.Contains("CurrentClientForStateFile", StringComparison.Ordinal) || + runtimeClientProvider.Contains("StatePathCachePrefix", StringComparison.Ordinal) || runtimeClientProvider.Contains(".ObservePlayer()", StringComparison.Ordinal)) { throw new InvalidOperationException( - "AetheriaUnityRuntimeClientProvider still routes player settings through a legacy session wrapper instead of the reactive typed document."); + "AetheriaUnityRuntimeClientProvider must expose narrow state/control/UI handles, not legacy sessions or ambient current-client lookups."); } var providerOwnedClientAccessSources = new Dictionary diff --git a/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs b/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs index 2c67e91fb..750dcb251 100644 --- a/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs +++ b/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs @@ -153,17 +153,6 @@ public static class AetheriaUnityRuntimeClientProvider return RuntimeState(stateBoot, runtimeId).Reactive(index); } - public static AetheriaClient CurrentClientForStateFile(string stateFilePath) - { - foreach (var pair in RuntimeClients) - { - if (pair.Key.StartsWith(StatePathCachePrefix(stateFilePath), StringComparison.Ordinal)) - return pair.Value; - } - - return null; - } - public static void Dispose() { _playerSettingsDocument?.Dispose(); @@ -178,12 +167,7 @@ public static class AetheriaUnityRuntimeClientProvider private static string CacheKey(string stateFilePath, string runtimeId) { - return StatePathCachePrefix(stateFilePath) + runtimeId; - } - - private static string StatePathCachePrefix(string stateFilePath) - { - return (stateFilePath ?? "") + "\n"; + return (stateFilePath ?? "") + "\n" + runtimeId; } private static void RefreshPlayerSettings(RuntimePlayerSettings settings)