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
Unhardcode mod package loaders #13223
Conversation
f72fed7
to
878960e
Compare
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.
Works, thanks! I can't review the code 100%, but it looked okay as well.
OpenRA.Game/FileSystem/ZipFile.cs
Outdated
public string Name { get; private set; } | ||
readonly Stream pkgStream; | ||
readonly SZipFile pkg; | ||
static readonly string[] Extensions = { ".zip", ".oramod", ".oramap" }; |
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.
I thought we dropped .oramod support, is it intentional that you keep support for that extension?
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.
This creeped back from the original PR I believe.
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.
Good catch, fixed.
878960e
to
a3f7641
Compare
Fixed, rebased, and dropped the test commit. |
That was a bit early, could you push a separate test branch? Because I can't get it to work locally, but I'm probably just making a mistake somewhere. |
I can get |
You need to do |
|
Test case works 👍 I'd still prefer either @RoosterDragon, @atlimit8 or someone else who is better than me at reviewing code to look over it before this is merged, so I won't merge this right away. |
I gave the code another look since nobody else seems to have the time or motivation, couldn't find anything that looks wrong, and in addition to the testcase all mods still seem to work fine. I assume that if there is any bug lurking that we overlooked, we'll probably run into it before the next major release, so I'll merge this now. |
This updates #13171 with architectural fixes and addresses the other FileSystem hacks that were blocked on having mod-defined package loaders.
This breaks the cycling dependency between assemblies that define package loaders that contain assemblies that define package loaders that... by requiring all dlls to be loaded from a normal directory. This then also fixes @abcdefg30's SharpDevelop problems.
This is already a monster of a PR, so i'm going to defer moving all the package loaders to the mod assemblies to a future PR. I've done the D2K sound parser as a testcase, but moving any more would make it difficult to keep a clean git history while addressing any review comments.
The final commit shows that it is still possible to explicitly mount subdirectories inside zip files.
I strongly suggest reviewing this commit by commit, using the
?w=1
parameter to squash whitespace changes on the main package loader commits.