From cd50732b29e54cc66b9f3012a7b6f1248b6fab79 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 14:35:45 +0100 Subject: [PATCH] Make loadout restore requests submit-only --- Aetheria.State.Verify/Program.cs | 17 ++++++++++++++++- Assets/Scripts/Gameplay/ActionGameManager.cs | 10 ++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index eac0973ef..323d3ff4c 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -9714,7 +9714,7 @@ static void RequireInventoryLoadoutRestoreRequestAuthority(string root) var requiredSymbols = new[] { "RequestRuntimeLoadoutRestore", - "TryRequestDaemonLoadoutRestore", + "RequestDaemonLoadoutRestore", "Operations.RestoreLoadout" }; @@ -9735,6 +9735,21 @@ static void RequireInventoryLoadoutRestoreRequestAuthority(string root) "Unity loadout restore still rejects requests through renderer-local credits instead of daemon acceptance."); } + var forbiddenActionSymbols = new[] + { + "TryRequestDaemonLoadoutRestore", + "private bool TryRequestDaemonLoadoutRestore(" + }; + var forbiddenActionHits = forbiddenActionSymbols + .Where(symbol => actionGameManager.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (forbiddenActionHits.Length > 0) + { + throw new InvalidOperationException( + "Unity loadout restore still exposes daemon request submission as local acceptance state: " + + string.Join(", ", forbiddenActionHits)); + } + var daemonOperationsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonOperations.cs"); var daemonOperations = File.Exists(daemonOperationsPath) ? File.ReadAllText(daemonOperationsPath) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 1cb1aac75..ce3fcbe3a 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -901,11 +901,11 @@ public class ActionGameManager : MonoBehaviour var observer = ResolveDaemonObserver(); if (observer != null && observer.HasAuthoritativeState) { - TryRequestDaemonLoadoutRestore(observer, template, price); + RequestDaemonLoadoutRestore(observer, template, price); } } - private bool TryRequestDaemonLoadoutRestore( + private void RequestDaemonLoadoutRestore( AetheriaDaemonObserver observer, AetheriaRuntimeLoadoutTemplateSnapshot template, int price) @@ -916,24 +916,22 @@ public class ActionGameManager : MonoBehaviour string.IsNullOrWhiteSpace(template.Name) || price < 0) { - return false; + return; } var dockedEntityKey = ResolveEntityRecordKey(DockedEntity); if (string.IsNullOrWhiteSpace(dockedEntityKey)) { - return false; + return; } try { observer.Operations.RestoreLoadout(dockedEntityKey, template.Name, price); - return true; } catch (Exception ex) { Debug.LogWarning($"Failed to send Aetheria daemon loadout restore operation: {ex.Message}"); - return false; } }