Remove FileSystem.ResolveAssemblyPath

This commit is contained in:
Paul Chote
2024-09-28 16:18:22 +01:00
committed by Gustas
parent 806f0fd270
commit 014cbc0cbd
9 changed files with 14 additions and 64 deletions

View File

@@ -34,16 +34,10 @@ namespace OpenRA
ctorCache = new Cache<Type, ConstructorInfo>(GetCtor);
// Allow mods to load types from the core Game assembly, and any additional assemblies they specify.
// Assemblies can only be loaded from directories to avoid circular dependencies on package loaders.
// Assemblies must exist in the game binary directory next to the main game executable.
var assemblyList = new List<Assembly>() { typeof(Game).Assembly };
foreach (var path in manifest.Assemblies)
{
var resolvedPath = FileSystem.FileSystem.ResolveAssemblyPath(path, manifest, mods);
if (resolvedPath == null)
throw new FileNotFoundException($"Assembly `{path}` not found.");
LoadAssembly(assemblyList, resolvedPath);
}
foreach (var filename in manifest.Assemblies)
LoadAssembly(assemblyList, Path.Combine(Platform.BinDir, filename));
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
assemblies = assemblyList.SelectMany(asm => asm.GetNamespaces().Select(ns => (asm, ns))).ToArray();