-
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
feat: Make MAD process cancellable #815
Conversation
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
What happens if a server requires two mods, and the first one completes but the second is aborted? Do we clean up the already-downloaded mod properly?
The download method is triggered once per mod: this means first mod would be installed, and second mod would be cleaned up. |
Do we enable the mods as soon as they are downloaded? Could this potentially cause issues? |
Nope, mods enabling happens after all mods have been downloaded (meaning no mod reloading happens if cancel button is pressed) and only has an effect on |
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 fine 👍
Cancelling while the mod is downloading:
https://github.com/user-attachments/assets/adba41df-9e71-48a0-bfd6-605727422fd1
Cancelling while the mod is extracting:
https://github.com/user-attachments/assets/72c46c02-5c5a-414e-879d-28e897fce3f1
Thanks for testing. I'll push out the current release-candidate as a full patch release, give it a day or two to stabilise and then merge this and prepare the next minor release ^^ |
Tested on NorthstarCN but it works fine! |
A long time ago, during the initial development of the feature, somebody (Jan maybe?) suggested making the mod install process cancellable, in case it takes too long (slow Internet speed, for instance).
This PR does just that, implementing the
ModDownloader::CancelDownload
function (already present in the header btw), that can stop MAD process at two moments:CURLE_ABORTED_BY_CALLBACK
(returned from download callback function, see https://curl.se/libcurl/c/CURLOPT_XFERINFOFUNCTION.html);Must be merged with mods counterpart (R2Northstar/NorthstarMods#865)!
Media
mod_download_cancelling.webm
Here, mod install process is interrupted twice, by successively stopping archive downloading and archive extraction; note that this does not prevent mod install from completing successfully when ran a third time.
Testing
allow_mod_auto_download 1
);Space battle
server (this server requires a mod that's big enough to leave you enough time to click the new "cancel" button);