fix: Fixes assembly loading. (#759)

* `AssemblyHandler.Assemblies` will now only contain assemblies listed in `assemblies.json`
* `assemblies.json` has been updated to only contain asssemblies directly loaded by the server. Namely, only `UOContent.dll`.
  * Specifically assemblies loaded by assemblies.json are subject to check for `Configure` and `Initialize` methods.
* `modernuo.json` now has a new property called `assemblyDirectories`. This will be automatically set to `Distribution/Assemblies` (absolute path on your machine).
  * You can add more directories to this list.
* All assemblies in assemblies.json _AND_ dependents of any assembly will be searched for in the directories specified by `assemblyDirectories`.
This commit is contained in:
Kamron Batman 2021-09-03 23:35:44 -07:00 • committed by GitHub
parent 0d1fffd9fc
commit 54e56d2fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 9 deletions

View file

@ -365,6 +365,7 @@ namespace Server
{
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
AppDomain.CurrentDomain.AssemblyResolve += AssemblyHandler.AssemblyResolver;
LoopContext = new EventLoopContext();
@ -463,7 +464,7 @@ namespace Server
assemblyFiles[i] = Path.Join(BaseDirectory, "Assemblies", assemblyFiles[i]);
}
AssemblyHandler.LoadScripts(assemblyFiles);
AssemblyHandler.LoadAssemblies(assemblyFiles);
VerifySerialization();