beyond-all-reason / pr-downloader

console downloader for spring maps/games written in c++
GNU General Public License v2.0
0 stars 8 forks source link

Improve `--validate-sdp` #22

Open Jazcash opened 2 years ago

Jazcash commented 2 years ago

Currently: ./pr-downloader.exe --filesystem-writepath "C:\Users\username\Repos\bar-lobby\dist_electron\content" --validate-sdp "C:\Users\username\Repos\bar-lobby\dist_electron\content\packages\cef6f6184a579cbf25f1dce3c21e305e.sdp"

This has some usage annoyances:

p2004a commented 2 years ago

requires --filesystem-writepath to be specified, otherwise it looks up the related pool files in the wrong dir (defaulting to C:\Users\username\Documents\My Games\Spring\pool\ on windows).

This argument is already required for all the other commands, and without it, it defaults to the directory you specified. It's not specific to --validate-sdp.

requires user doing their own version lookup to know which sdp file relates to their content

Because it's for validating the SDP file, not some version.

is reaaaaally slow for what's essentially meant to be a quick check to see if a package is installed correctly

It doesn't only check if files are present, but also verifies that files aren't currupted etc. It does way more.


So, all in all, WAI. This commands does what it was designed to do. Instead of that, you probably want a different command for a different feature. Could you please describe that?

Jazcash commented 2 years ago

The main use case I'm trying to achieve for BAR Lobby would be joining a game, and checking if the game is installed before deciding to download it, and to send a sync status update to inform other players of if the user has the game installed or not, which is required before the game can be started.

I suppose what I'm really looking for is a fast way to check if a package is installed, i.e. by skipping full validation.

If prd kept a list of downloaded packages, and only added packages to that list after they've been 100% downloaded, then checking against that list would be enough for me. This would break things if packages got actually corrupted for whatever reason, but that would be a worthwhile sacrifice for the version checks to be super fast the rest of the time.

p2004a commented 1 year ago

Now with 5400b71199bfe1cf9b9b487392b8cdaf50d664e7 the sdp file is created only after fetching of the rapid package succeeded fully.