-
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: Verified mods auto-downloading #362
Conversation
…arLauncher into feat/new-verified-mods
This reverts commit 86c3ba2.
Squirrel VM does not need to know the list of verified mods, so GetVerifiedModsList method is no longer needed. We instead make FetchVerifiedModsList method available to Squirrel VM, so that verified mods list can be fetched while starting VM.
Since we're using a local verified mods list for now, we don't need code to fetch said list from master server.
Squirrel VM invokes the DownloadMod method only after ensuring mod is verified (by calling IsModVerified), so there's no need to invoke IsModVerified a second time.
failing build D: |
I added this mod both to the client list of verified mods and to the list of required mods on my server, so it can be auto-downloaded.
This will definitely be an issue. Should we force including mods' dependencies into required mods server lists as well? |
IMO, a simple solution for this would be "for your mod to get verified, it's dependencies also have to be verified." |
Agreed. We should check both when verifying the mod as well as in launcher when it pulls in the mod dependencies in case we had a slip up. |
Agreed too! |
…arLauncher into feat/new-verified-mods
This is now up-to-date with verified_download_s2space.webm |
Basically all that is missing for getting this PR merged is statically linking the necessary dlls into |
Ehm, actually, miniz does not expose the same API as libzip at all... |
Waiting for #500 to be merged before solving conflicts. I plan to push the parkour gamemode through the verification process, and use it as the final example mod for this feature. |
For testing ones own mod it might be useful to have like a command line arg to bypass verification and allow downloading any mod from Thunderstore if the server requires it. I'm fine with having a separate PR for this though afterwards. Just something that came to mind rn ^^ |
I agree on the principle, however we still need to link mod names to related Thunderstore packages, which can only be done manually... |
Outside of the scope of this PR but with |
Closing this in favour of a new branch. |
New version: #545 |
This pull request introduces automatic mods fetching.
NorthstarMods
associated pull request: R2Northstar/NorthstarMods#542This 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".
Discussion here: https://github.com/R2Northstar/VerifiedMods
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)
: tells if a mod is being downloaded; this is used by UI to check if it should display loading dialog to the user;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
verified_download_s2space.webm
TODOs
zip.dll
,bzip.dll
andlibzip.dll
into game folder, but those are not generated sometimes, gotta find why)manifest.json
and put it in mod directory"AutoDownloaded": true
entry intomod.json