Make main menu commands submit-only
This commit is contained in:
parent
bbf2444eda
commit
26a6026338
2 changed files with 48 additions and 32 deletions
|
|
@ -2494,7 +2494,7 @@ static void RequireMainMenuSettingsCommands(string root)
|
|||
|
||||
var requiredMainMenuAuthoritySymbols = new[]
|
||||
{
|
||||
"TrySendKnownAetheriaEveCommand(request, \"player-settings\")",
|
||||
"SendKnownAetheriaEveCommand(request, \"player-settings\")",
|
||||
"AetheriaRuntimeMainMenuCommandKind.PlayerSettingsCommand",
|
||||
"AetheriaRuntimeEveCommands.TrySendKnownSurfaceCommand(",
|
||||
"stateBoot.StateFilePath",
|
||||
|
|
@ -2512,6 +2512,21 @@ static void RequireMainMenuSettingsCommands(string root)
|
|||
string.Join(", ", missingUiCalls));
|
||||
}
|
||||
|
||||
var forbiddenSubmitAcceptanceSymbols = new[]
|
||||
{
|
||||
"private static bool TrySendKnownAetheriaEveCommand(",
|
||||
"if (!TrySendKnownAetheriaEveCommand(request, \"player-settings\"))"
|
||||
};
|
||||
var submitAcceptanceHits = forbiddenSubmitAcceptanceSymbols
|
||||
.Where(symbol => source.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (submitAcceptanceHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"MainMenu player-settings command lowering still treats Eve submission as local acceptance state: " +
|
||||
string.Join(", ", submitAcceptanceHits));
|
||||
}
|
||||
|
||||
if (source.Contains("TrySendPlayerSettingsCommand(", StringComparison.Ordinal) ||
|
||||
source.Contains("CommandKindForSurface(request)", StringComparison.Ordinal) ||
|
||||
source.Contains("new AetheriaRuntimePlayerSettingsCommandBody", StringComparison.Ordinal))
|
||||
|
|
@ -2569,7 +2584,7 @@ static void RequireMainMenuSettingsCommands(string root)
|
|||
"AetheriaRuntimePlayerSettingsSurfaceBuilder.Build",
|
||||
"AetheriaEveUnitySurfaceHost.RenderRuntime(",
|
||||
"AetheriaRuntimeMainMenuCommandKind.PlayerSettingsCommand",
|
||||
"TrySendKnownAetheriaEveCommand(request, \"player-settings\")"
|
||||
"SendKnownAetheriaEveCommand(request, \"player-settings\")"
|
||||
};
|
||||
|
||||
var missingMainMenuSymbols = requiredMainMenuSymbols
|
||||
|
|
@ -5169,7 +5184,7 @@ static void RequireClientTargetBootAuthority(string root)
|
|||
"stateBoot.LastReplicaSyncError",
|
||||
"AetheriaState.At(ActionGameManager.GameDataDirectory)",
|
||||
".ClientTarget",
|
||||
"TryRequestClientTargetCommand(request)",
|
||||
"RequestClientTargetCommand(request)",
|
||||
"AetheriaRuntimeClientTargetSurfaceCommands.TryRequest(",
|
||||
"ProjectMainMenuSurfaceState(",
|
||||
"AetheriaRuntimeMainMenuSurfaceBuilder.BuildRoot(",
|
||||
|
|
@ -5627,8 +5642,8 @@ static void RequireVerseSettingsShellAndBridge(string root)
|
|||
"AetheriaRuntimeMainMenuSurfaceCommands.TryRead(request, out var command)",
|
||||
"AetheriaRuntimeMainMenuCommandKind.ClientTargetCommand",
|
||||
"AetheriaRuntimeMainMenuCommandKind.VerseHostCommand",
|
||||
"TryRequestClientTargetCommand(request)",
|
||||
"TrySendKnownAetheriaEveCommand(request, \"Verse-host\")",
|
||||
"RequestClientTargetCommand(request)",
|
||||
"SendKnownAetheriaEveCommand(request, \"Verse-host\")",
|
||||
"AetheriaRuntimeEveCommands.TrySendKnownSurfaceCommand(",
|
||||
"AetheriaState.At(ActionGameManager.GameDataDirectory)",
|
||||
".ClientTarget",
|
||||
|
|
@ -5644,6 +5659,23 @@ static void RequireVerseSettingsShellAndBridge(string root)
|
|||
string.Join(", ", missingMainMenuSymbols));
|
||||
}
|
||||
|
||||
var forbiddenSubmitAcceptanceSymbols = new[]
|
||||
{
|
||||
"private static bool TryRequestClientTargetCommand(",
|
||||
"private static bool TrySendKnownAetheriaEveCommand(",
|
||||
"if (TryRequestClientTargetCommand(request))",
|
||||
"if (TrySendKnownAetheriaEveCommand(request, \"Verse-host\"))"
|
||||
};
|
||||
var submitAcceptanceHits = forbiddenSubmitAcceptanceSymbols
|
||||
.Where(symbol => mainMenu.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (submitAcceptanceHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"MainMenu Verse settings command lowering still treats submission as local acceptance state: " +
|
||||
string.Join(", ", submitAcceptanceHits));
|
||||
}
|
||||
|
||||
var forbiddenMainMenuMutationSymbols = new[]
|
||||
{
|
||||
"AetheriaRuntimeClientTargetStore.",
|
||||
|
|
|
|||
|
|
@ -306,12 +306,7 @@ public class MainMenu : MonoBehaviour
|
|||
ShowSettings();
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.PlayerSettingsCommand:
|
||||
if (!TrySendKnownAetheriaEveCommand(request, "player-settings"))
|
||||
{
|
||||
Debug.LogWarning($"Unhandled player-settings command kind: {command.Kind}");
|
||||
return;
|
||||
}
|
||||
|
||||
SendKnownAetheriaEveCommand(request, "player-settings");
|
||||
ShowPlayerSettingsSurface();
|
||||
return;
|
||||
default:
|
||||
|
|
@ -334,18 +329,12 @@ public class MainMenu : MonoBehaviour
|
|||
ShowSettings();
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.ClientTargetCommand:
|
||||
if (TryRequestClientTargetCommand(request))
|
||||
{
|
||||
ShowVerseSettingsSurface();
|
||||
}
|
||||
|
||||
RequestClientTargetCommand(request);
|
||||
ShowVerseSettingsSurface();
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.VerseHostCommand:
|
||||
if (TrySendKnownAetheriaEveCommand(request, "Verse-host"))
|
||||
{
|
||||
ShowVerseSettingsSurface();
|
||||
}
|
||||
|
||||
SendKnownAetheriaEveCommand(request, "Verse-host");
|
||||
ShowVerseSettingsSurface();
|
||||
return;
|
||||
default:
|
||||
Debug.LogWarning($"Unhandled verse-settings command kind: {command.Kind}");
|
||||
|
|
@ -447,7 +436,7 @@ public class MainMenu : MonoBehaviour
|
|||
return true;
|
||||
}
|
||||
|
||||
private static bool TryRequestClientTargetCommand(EveSurfaceCommandRequest request)
|
||||
private static void RequestClientTargetCommand(EveSurfaceCommandRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -456,28 +445,25 @@ public class MainMenu : MonoBehaviour
|
|||
request,
|
||||
out _))
|
||||
{
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"Failed to update typed Aetheria client target: {ex}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TrySendKnownAetheriaEveCommand(
|
||||
private static void SendKnownAetheriaEveCommand(
|
||||
EveSurfaceCommandRequest request,
|
||||
string label)
|
||||
{
|
||||
if (request == null)
|
||||
return false;
|
||||
return;
|
||||
|
||||
var stateBoot = CurrentStateBoot();
|
||||
if (!CanSendLocalEveCommand(stateBoot, label))
|
||||
return true;
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -489,16 +475,14 @@ public class MainMenu : MonoBehaviour
|
|||
out var error))
|
||||
{
|
||||
Debug.LogError($"Failed to submit Aetheria {label} Eve command: {error}");
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"Submitted Aetheria {label} Eve command: {submitted!.CommandId}");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"Failed to send Aetheria {label} Eve command: {ex}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue