beyond-all-reason/pr-downloader

Improve `--validate-sdp`

Jazcash opened this issue · 3 comments

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:

  • 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).
  • requires user doing their own version lookup to know which sdp file relates to their content
  • is reaaaaally slow for what's essentially meant to be a quick check to see if a package is installed correctly. Would probably require some optimisation/caching to be done on installs to only mark packages as complete after all its files have finished downloading

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?

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.

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