-
Notifications
You must be signed in to change notification settings - Fork 118
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: Verified mods auto-downloading #542
Conversation
When joining a server and a mod is not found, we check if it's included in the verified mods list. If missing mod is not verified, we say it in the error message.
This way, we can wait for a mod to be downloaded if needed.
Imo, the percentage downloaded for the currently downloading mod should be shown since mods like map mods will end up being a significantly sized download. Also, it might be better to get all of the auto-downloadable mods before downloading each of them individually, so that we could show the number of mods downloaded/downloading |
I can implement the master server side of this whenever you need it. |
Master server would just pull from some repo, right? So that we have a way of organising approving verified mods via PRs |
Do you have an idea of the size of a complete map? Maybe an example of a "big" mod from Thunderstore?
Appreciate the help! I will definitely ping you when this is merged.
That's what was agreed upon, yep. @GeckoEidechse could you create it? 😄 |
Likely a few hundred megabytes when compressed tbh, given they would include textures as well as the actual bsps/stbsps An example of a "big mod" would be Juicy's Zircon Spitfire (about a 200MB download?) |
Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Outdated
Show resolved
Hide resolved
Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Outdated
Show resolved
Hide resolved
This has been added in 2b7075a. |
could actual size of download and amount downloaded also be shown in megabytes potentially? likely in the content of the message rather than header |
Sure! I added this in Since zip decompression takes much more time than download (1min VS 6s), I'll have to display zip extraction progression as well |
Ok so I would like to get some reviews on this already-existing code basis, even if it needs to be reworked after whole mod system rework (see issue R2Northstar/NorthstarLauncher#396). How to test?
|
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.
Just some naming things, the rest looks fine
Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Outdated
Show resolved
Hide resolved
Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Outdated
Show resolved
Hide resolved
…rogress Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
…rogress Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
This reverts commit e489df2.
@Alystrasz I know that you are working on the Launcher side of this (in a separate branch though right?) Should this PR be considered obsolete? |
This one is obsolete yep, I think I'll create a new one, just like the launcher side |
With #761 merged I think we can close this PR if I'm not mistaken ^^ |
This pull request introduces automatic mods fetching.
NorthstarLauncher
associated pull request: R2Northstar/NorthstarLauncher#362This allows for the client to download and install mods that are required by a server (client+server-side mods, like new game mods or maps for instance). List of verified mods is local (compiled in the dll), but it can be fetched from master server in the future, to ease the addition of new verified mods.
With this feature, if users want to join a server requiring a gamemode mod or a map mod, their game can automatically download it for them, instead of forcing them to go through manual mod installation process (which can be hard for some people). While downloading a mod, progress download is displayed and live-updated on a dialog pop-up.
Verified mod entries
A verified mod entry looks like this:
Versions are checked individually to ensure no malicious code has been added during mod updates.
Please note that it is up to the community to decide what's needed for a mod to be "verified", and how such mod is "verified".
Mod installation process
a. Check if it is listed
b. Check if version is listed
a. Fetch zip from API
b. Compare checksum with local checksum
Please note that downloaded archive is checksumed, to verify it is the very archive that has been verified.
Changes
Northstar.Client
OnServerSelected
method becomes async, to allow waiting for mod verification;_OnServerSelected
method now displays some dialogs:Launcher
libzip
openssl
lib;verifiedmods.cpp
bool NSIsModVerified(string modName, string modVersion)
: tells if a mod is verified or not;void NSDownloadMod(string modname, string modVersion)
: starts downloading a mod; returns nothing because actual mod downloading is done in a thread, as not to block UI;bool NSIsModBeingDownloaded(string modName, string modVersion)
: tells if a mod is being downloaded; this is used by UI to check if it should display loading dialog to the user;array<float> NSGetCurrentDownloadProgress()
: returns progression in percentage of current download/extraction;string NSGetModExtractionResult()
: returns result of mod download/extraction;Testing
I tested this PR with two mods:
Juicy.Zircon_Spitfire
, a HUGE (1.7GB) skin mod (set as client-required for the sake of testing this);Fifty.mp_frostbite
, a map mod.Maps mods are a good example of mods that would benefit from auto-downloading, because they are required on both client and server sides.
Media
If mod is not verified
If something goes wrong during mod download/extraction
If mod is verified
TODOs