Move Aetheria EveUnity hooks into provider package

This commit is contained in:
Meta Vens 2026-07-09 20:39:54 +01:00
commit 074eab26fe
9 changed files with 188 additions and 69 deletions

View file

@ -1,23 +0,0 @@
using GameCult.Aetheria.EveRuntime;
using GameCult.Aetheria.State.Verse;
using UnityEngine;
public static class AetheriaUnityEveRuntimeHooks
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void Install()
{
AetheriaEveRuntimeUnityHooks.ResolveStateBoot =
overridePath => AetheriaRuntimeStateBoot.Inspect(
AetheriaUnityRuntimePaths.GameDataDirectory,
overridePath ?? "");
AetheriaEveRuntimeUnityHooks.RuntimeState =
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, runtimeId);
AetheriaEveRuntimeUnityHooks.Control =
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.Control(stateBoot, runtimeId);
AetheriaEveRuntimeUnityHooks.Ui =
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.Ui(stateBoot, runtimeId);
AetheriaEveRuntimeUnityHooks.StateRefResolver =
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(stateBoot, runtimeId);
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 72069f7b0885490fb690dc771e422aac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -2777,29 +2777,6 @@ public class DaemonRuntimeDocumentTests
0.02);
PublishLatestFrameThroughVerseClient(statePath, frame);
using var client = AetheriaClient
.OpenAsync(statePath, "unity-scene-receipt-test", startServer: false, pullOnOpen: true)
.GetAwaiter()
.GetResult();
var stateBoot = new AetheriaRuntimeStateBootReport(
"",
"",
"state-path-override",
"Aetheria daemon test",
"aetheria.local",
"unity-scene-receipt-test",
"",
statePath,
"",
stateFileExists: true,
supportsLocalStateFileRead: true,
"",
Array.Empty<string>(),
Array.Empty<AetheriaRuntimeDiscoveredVerse>(),
"",
"",
"",
"");
var previousResolveStateBoot = AetheriaEveRuntimeUnityHooks.ResolveStateBoot;
var previousRuntimeState = AetheriaEveRuntimeUnityHooks.RuntimeState;
var previousControl = AetheriaEveRuntimeUnityHooks.Control;
@ -2808,12 +2785,7 @@ public class DaemonRuntimeDocumentTests
try
{
AetheriaEveRuntimeUnityHooks.ResolveStateBoot = _ => stateBoot;
AetheriaEveRuntimeUnityHooks.RuntimeState = (_, __) => client.State;
AetheriaEveRuntimeUnityHooks.Control = (_, __) => client.Control;
AetheriaEveRuntimeUnityHooks.Ui = (_, __) => client.Ui;
AetheriaEveRuntimeUnityHooks.StateRefResolver = (_, __) =>
client.State.CreateEveSurfaceCultMeshStateRefResolver();
AetheriaEveRuntimeUnityHookInstaller.Install();
using var bridge = new AetheriaEveUnitySceneProviderBridge(
statePath,
@ -2850,6 +2822,7 @@ public class DaemonRuntimeDocumentTests
}
finally
{
AetheriaEveRuntimeUnityClientCache.Dispose();
AetheriaEveRuntimeUnityHooks.ResolveStateBoot = previousResolveStateBoot;
AetheriaEveRuntimeUnityHooks.RuntimeState = previousRuntimeState;
AetheriaEveRuntimeUnityHooks.Control = previousControl;