IsAbstract plugin check + separate embedded dependency resolving pass#212
Merged
Jesus-QC merged 5 commits intonorthwood-studios:devfrom Sep 9, 2025
Merged
IsAbstract plugin check + separate embedded dependency resolving pass#212Jesus-QC merged 5 commits intonorthwood-studios:devfrom
Jesus-QC merged 5 commits intonorthwood-studios:devfrom
Conversation
Added a condition to skip abstract classes when instantiating plugins.
Added a loop between plugin assembly loading and instantiation that resolves embedded DLLs. Modified `AssemblyUtils::GetMissingDependencies` to create a set of the loaded assemblies. Changed the `LoadEmbeddedDll` and `LoadCompressedEmbeddedDll` methods in `AssemblyUtils` class to write resolved the assembly to a temporary file, load the DLL if no assembly with the same name has been loaded. The file is deleted after this operation.
Member
|
finally... it is here... |
Moved private methods in AssemblyUtils & PluginLoader to the end of the file. Made the LINQ selectors in `LogMissingDependencies` and `GetLoadedAssemblies` static. Removed the `ToArray` call and made the variable an `IEnumerable<string>` in `LogMissingDependencies` to improve performance.
Jesus-QC
approved these changes
Aug 28, 2025
Co-authored-by: Jesus QC <69375249+Jesus-QC@users.noreply.github.com>
Contributor
Author
|
@Jesus-QC Should embedded DLLs also be added to the |
Contributor
Yeah |
VALERA771
pushed a commit
to VALERA771/LabAPI
that referenced
this pull request
Sep 8, 2025
* Yaml converters for Vector3 and Color * Accepts color fix + added converters to the builder * Vector2, 3 and 4 converter, Color32 converter, extensions for yaml and such * Docs fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows the definition of abstract plugin types, and fixes the scenario where a plugin's embedded DLLs would be loaded after another dependent plugin attempted enabling.
The current dependency problem:
Assume the following scenario:
The following plugins are to be loaded:
Both
PluginAandPluginCdepend on an external dependencyDependencyPluginBincludesDependencyas an embedded resource.PluginA's assembly is loaded.PluginA, but might fail becauseDependencyis not loaded, unless ifDependencyincluded separately in LabAPI'sdependenciesfolder.PluginB's assembly is loaded,Dependencyis extracted,PluginBloads.PluginC's assembly is loaded, the plugin is initialized without issues.Failure also occurs if
PluginBdoes not have missing dependencies (e.g. it does not depend onDependencywhile including it as embedded) butPluginCdepends onDependency(PluginBdid not resolve embedded resources because it had no missing dependencies).Changes:
Plugintypes.AssemblyUtilsclass has been modified to load an embedded resource only if no assembly with the same name has been loaded yet. This affects the methodsResolveEmbeddedResourcesLoadEmbeddedDllLoadCompressedEmbeddedDllPlugintypes.This way, a plugin can reference dependencies that another plugin includes as embedded resources.