-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for loading plugins from Thunderstore packages #513
Add support for loading plugins from Thunderstore packages #513
Conversation
force pushing because I made an error I do not want to acknowledge |
Worth noting: loading the same plugin multiple times can cause crashes, perhaps this should be checked for? Since this can also be replicated with the normal plugin setup this seems out of scope. |
I agree that this is out of scope, could you make an issue about it? (if one doesn't exist already) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major, code looks good for the most part.
feel free to mark the one about strstr
as resolved if you don't want to do it
Tested this locally with titanframework, works at loading from package, it also has no errors loading the same plugin from multiple packages or even from the plugins folder and a package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngl I'm terrible with code, just an active helper, but tested pr and it worked perfectly fine locally using titan framework and framework doublebarrel (titan framework has a plugin included to replicate safeio, and is a dependency of framework doublebarrel)
rebased because of the submodule PR, checking out commits before it can be painful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Re-requested review from some reviewers cause "LGTM" is not a valid review >:) Please explicitly state whether you tested or just looked at code (and do it soon cause I want to get this merged <3) |
LGTM is not a valid review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool to have a style guide for launcher just like we're doing with mods ( or at least trying to ), otherwise looks good
we should also get rid of the recursive iterator and settle on a structure
didnt test
@GeckoEidechse literally only reviewed to make my older review requesting changes (which was still blocking even tho resolved) not relevant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, didnt test
@CooldudePUGS tested and @F1F7Y + @ASpoonPlaysGames code reviewed. Let's hope merging and releasing this goes smoothly ^^" |
Adds support for loading plugins from `packages` directory which was missing from the original PR that introduced the `packages` directory. (cherry picked from commit a65cbea)
Reducing the nesting ended up introducing an error that no one caught until rc4. |
Fixes a regression introduced in #513
return; | ||
} | ||
|
||
fs::recursive_directory_iterator iterator(pluginPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, I just realised another issue with this.
This doesn't do the regex check that the modmanager.cpp
code does to ensure that package is installed correctly.
NorthstarLauncher/NorthstarDLL/mods/modmanager.cpp
Lines 622 to 623 in 82bff57
// Set up regex for `AUTHOR-MOD-VERSION` pattern | |
std::regex pattern(R"(.*\\([a-zA-Z0-9_]+)-([a-zA-Z0-9_]+)-(\d+\.\d+\.\d+))"); |
Also I'm pretty sure it still loads plugins recursively which we shouldn't need to do anymore. The only reason we added recursive load was to have a plugin -> Thunderstore-package mapping with the old plugin system, i.e. #460 which can also be reverted now.
closes #509
reposition things a bit, adds a few more sanity checks and looks for dlls in packages.
Tested with the kyurid plugin.