Skip to content
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

Merged
merged 4 commits into from
Jul 27, 2023
Merged

Add support for loading plugins from Thunderstore packages #513

merged 4 commits into from
Jul 27, 2023

Conversation

Jan200101
Copy link
Contributor

@Jan200101 Jan200101 commented Jul 21, 2023

closes #509

reposition things a bit, adds a few more sanity checks and looks for dlls in packages.

Tested with the kyurid plugin.

@Jan200101
Copy link
Contributor Author

force pushing because I made an error I do not want to acknowledge

@Jan200101
Copy link
Contributor Author

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.

@ASpoonPlaysGames
Copy link
Contributor

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)

Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a 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

NorthstarDLL/plugins/plugins.cpp Show resolved Hide resolved
NorthstarDLL/plugins/plugins.cpp Outdated Show resolved Hide resolved
@JMM889901
Copy link

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

Copy link
Contributor

@itscynxx itscynxx left a 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)

@Jan200101 Jan200101 added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Jul 23, 2023
@Jan200101
Copy link
Contributor Author

Jan200101 commented Jul 23, 2023

rebased because of the submodule PR, checking out commits before it can be painful.

catornot
catornot previously approved these changes Jul 25, 2023
Copy link
Member

@catornot catornot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

NorthstarDLL/plugins/plugins.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GeckoEidechse
Copy link
Member

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)

@GeckoEidechse GeckoEidechse dismissed stale reviews from ASpoonPlaysGames and catornot July 26, 2023 15:55

LGTM is not a valid review

Copy link
Member

@F1F7Y F1F7Y left a 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

NorthstarDLL/plugins/plugins.cpp Outdated Show resolved Hide resolved
@ASpoonPlaysGames
Copy link
Contributor

LGTM is not a valid review

@GeckoEidechse literally only reviewed to make my older review requesting changes (which was still blocking even tho resolved) not relevant

Copy link
Member

@F1F7Y F1F7Y left a 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

@GeckoEidechse GeckoEidechse removed needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Jul 27, 2023
@GeckoEidechse
Copy link
Member

@CooldudePUGS tested and @F1F7Y + @ASpoonPlaysGames code reviewed. Let's hope merging and releasing this goes smoothly ^^"

@GeckoEidechse GeckoEidechse merged commit a65cbea into R2Northstar:main Jul 27, 2023
GeckoEidechse pushed a commit that referenced this pull request Jul 27, 2023
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)
@Jan200101
Copy link
Contributor Author

Reducing the nesting ended up introducing an error that no one caught until rc4.
Fixed by #522

GeckoEidechse pushed a commit that referenced this pull request Jul 28, 2023
Fixes a regression introduced in #513
GeckoEidechse pushed a commit that referenced this pull request Jul 28, 2023
Fixes a regression introduced in #513

(cherry picked from commit e742eb3)
return;
}

fs::recursive_directory_iterator iterator(pluginPath);
Copy link
Member

@GeckoEidechse GeckoEidechse Jul 29, 2023

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.

// 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.

@Jan200101 Jan200101 deleted the PR/thunderstore-package-plugins branch June 22, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add support for loading plugins from packages directory
7 participants