diff --git a/OpenDreamPackaging/DreamPackaging.cs b/OpenDreamPackaging/DreamPackaging.cs index e171bb0208..13004e1e97 100644 --- a/OpenDreamPackaging/DreamPackaging.cs +++ b/OpenDreamPackaging/DreamPackaging.cs @@ -1,6 +1,5 @@ using Robust.Packaging; using Robust.Packaging.AssetProcessing; -using Robust.Packaging.AssetProcessing.Passes; namespace OpenDreamPackaging; @@ -20,21 +19,13 @@ public static async Task WriteResources( var inputPass = graph.Input; - await RobustSharedPackaging.WriteContentAssemblies( - inputPass, + await RobustClientPackaging.WriteClientResources( contentDir, - "Content.Client", - new[] { "OpenDreamClient", "OpenDreamShared" }, - cancel: cancel); + inputPass, + cancel); await RobustClientPackaging.WriteClientResources(contentDir, inputPass, cancel); - WriteRscResources(dreamRootDir, resources, inputPass); - - inputPass.InjectFinished(); - } - - public static void WriteRscResources(string dreamRootDir, string[] resources, AssetPassPipe inputPass) { for (var i = 0; i < resources.Length; i++) { var resource = resources[i].Replace('\\', Path.DirectorySeparatorChar); // The game client only knows a resource ID, so that's what we name the files. @@ -44,5 +35,7 @@ public static void WriteRscResources(string dreamRootDir, string[] resources, As inputPass.InjectFileFromDisk(path, diskPath); } + + inputPass.InjectFinished(); } } diff --git a/OpenDreamRuntime/DreamAczProvider.cs b/OpenDreamRuntime/DreamAczProvider.cs deleted file mode 100644 index c85182a556..0000000000 --- a/OpenDreamRuntime/DreamAczProvider.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using OpenDreamPackaging; -using Robust.Packaging; -using Robust.Packaging.AssetProcessing; -using Robust.Server.ServerStatus; - -namespace OpenDreamRuntime; - -public sealed class DreamAczProvider : IMagicAczProvider, IFullHybridAczProvider { - private readonly IDependencyCollection _dependencies; - private readonly string _rootPath; - private readonly string[] _resources; - - public DreamAczProvider(IDependencyCollection dependencies, string rootPath, string[] resources) { - _dependencies = dependencies; - _rootPath = rootPath; - _resources = resources; - } - - public async Task Package(AssetPass pass, IPackageLogger logger, CancellationToken cancel) { - var contentDir = DefaultMagicAczProvider.FindContentRootPath(_dependencies); - - await DreamPackaging.WriteResources(contentDir, _rootPath, _resources, pass, logger, cancel); - } - - public Task Package(AssetPass hybridPackageInput, AssetPass output, IPackageLogger logger, CancellationToken cancel) { - var clientAssetGraph = new RobustClientAssetGraph(); - var resourceInput = clientAssetGraph.Input; - output.AddDependency(clientAssetGraph.Output); - output.AddDependency(hybridPackageInput); - - AssetGraph.CalculateGraph( - clientAssetGraph.AllPasses.Concat(new[] { hybridPackageInput, output }).ToArray(), - logger); - - DreamPackaging.WriteRscResources(_rootPath, _resources, resourceInput); - resourceInput.InjectFinished(); - - return Task.CompletedTask; - } -} diff --git a/OpenDreamRuntime/DreamMagicAczProvider.cs b/OpenDreamRuntime/DreamMagicAczProvider.cs new file mode 100644 index 0000000000..965f6aa8b6 --- /dev/null +++ b/OpenDreamRuntime/DreamMagicAczProvider.cs @@ -0,0 +1,26 @@ +using System.Threading; +using System.Threading.Tasks; +using OpenDreamPackaging; +using Robust.Packaging; +using Robust.Packaging.AssetProcessing; +using Robust.Server.ServerStatus; + +namespace OpenDreamRuntime; + +public sealed class DreamMagicAczProvider : IMagicAczProvider { + private readonly IDependencyCollection _dependencies; + private readonly string _rootPath; + private readonly string[] _resources; + + public DreamMagicAczProvider(IDependencyCollection dependencies, string rootPath, string[] resources) { + _dependencies = dependencies; + _rootPath = rootPath; + _resources = resources; + } + + public async Task Package(AssetPass pass, IPackageLogger logger, CancellationToken cancel) { + var contentDir = DefaultMagicAczProvider.FindContentRootPath(_dependencies); + + await DreamPackaging.WriteResources(contentDir, _rootPath, _resources, pass, logger, cancel); + } +} diff --git a/OpenDreamRuntime/DreamManager.cs b/OpenDreamRuntime/DreamManager.cs index 7453ae3c70..5befb8d19f 100644 --- a/OpenDreamRuntime/DreamManager.cs +++ b/OpenDreamRuntime/DreamManager.cs @@ -116,7 +116,7 @@ public bool LoadJson(string? jsonPath) { } _compiledJson = json; - var rootPath = Path.GetFullPath(Path.GetDirectoryName(jsonPath)!); + var rootPath = Path.GetDirectoryName(jsonPath)!; var resources = _compiledJson.Resources ?? Array.Empty(); _dreamResourceManager.Initialize(rootPath, resources); if(!string.IsNullOrEmpty(_compiledJson.Interface) && !_dreamResourceManager.DoesFileExist(_compiledJson.Interface)) @@ -146,9 +146,9 @@ public bool LoadJson(string? jsonPath) { _dreamMapManager.LoadMaps(_compiledJson.Maps); - var aczProvider = new DreamAczProvider(_dependencyCollection, rootPath, resources); - _statusHost.SetMagicAczProvider(aczProvider); - _statusHost.SetFullHybridAczProvider(aczProvider); + _statusHost.SetMagicAczProvider(new DreamMagicAczProvider( + _dependencyCollection, rootPath, resources + )); return true; } diff --git a/OpenDreamRuntime/EntryPoint.cs b/OpenDreamRuntime/EntryPoint.cs index 6a54f0db18..6f962e645e 100644 --- a/OpenDreamRuntime/EntryPoint.cs +++ b/OpenDreamRuntime/EntryPoint.cs @@ -25,6 +25,10 @@ public sealed class EntryPoint : GameServer { private DreamCommandSystem? _commandSystem; public override void Init() { + IoCManager.Resolve().SetMagicAczProvider(new DefaultMagicAczProvider( + new DefaultMagicAczInfo("Content.Client", new[] {"OpenDreamClient", "OpenDreamShared"}), + IoCManager.Resolve())); + IComponentFactory componentFactory = IoCManager.Resolve(); componentFactory.DoAutoRegistrations(); diff --git a/RobustToolbox b/RobustToolbox index a891cacae5..eb092e90ef 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit a891cacae53d704f1d0afa85bd3bc10820c38881 +Subproject commit eb092e90efc7ac4ae562bc46f9b760745a29e289