KnossosNET / Knossos.NET

Repository for the Knossos.NET launcher, currently in development.
GNU General Public License v3.0
21 stars 10 forks source link

Search other mod versions for files instead of download #208

Closed Shivansps closed 2 weeks ago

Shivansps commented 3 weeks ago

The aim of this PR is to avoid downloads from nebula if we can avoid it.

-Added function during mod installs to search for other versions of the mod we are installing, if we found one (or more than one) before package download it will search to see if any of the already installed versions to see if they have a package that was installed using the nebula file (comparison is done by checking the nebula hash file in the json of both mods), If one matching package is found then the filelist of the new file is checked against what is on disk, and if all files are found, and sha256 hash matches, then it will procced to copy all files or to create hardlinks if this is allowed and supported by the filesystem.

-Added hardlinking function, it is similar to a simbolic link, with the only difference that if the origin file is deleted, it does not matter, the target link still works, what means you effectively need to delete all hardlinks of the file to actually delete the file. This is not supported on FAT filesystems. But ext4, and NTFS are supported and tested. MacOS remains untested.

-Add option to do a "clean install" in mod install window to disable all these changes

-Add option to disable "hardlink" function during mod install window to disable the creation of hardlinks, file copies will be done instead.

This will need more testing and maybe changing how the opt-ins are done, but other than that, the work should be done.