Commit graph

21 commits

Author SHA1 Message Date
derrod 9f7133362c [downloader] Make sure timeout is not None
Hopefully fixes #22
2020-05-05 16:03:12 +02:00
derrod 0e86791237 [downloader] Reformat manager 2020-05-05 13:21:55 +02:00
derrod 6f8da36947 [downloader] Update logging (more debug/cleanup) 2020-05-05 13:21:06 +02:00
derrod df55f18a78 [cli/core/downloader] Increase timeout and make it configurable
Fixes #16
2020-05-04 14:08:26 +02:00
derrod 69383c4788 [cli/core/downloader/utils] Add download reordering optimization
This is an optimization that aims to fix issues with some titles
such as World War Z that have lots of duplicated files resulting
in a very high runtime cache requirement.

The basic idea is to group files that share lots of chunks together
so the data can be removed from the cache sooner.

For most games this has little to no effect. For some titles with heavy
duplication it can reduce the RAM usage significantly however. For
instance the RAM requirements for World War Z are reduced from 5.3 GiB
to 499 MiB.

Partially fixes #17
2020-05-04 14:06:25 +02:00
derrod 3f27ea0296 [downloader] Fix formatting of required cache size
Scientific notation is cool and all but not
particularly useful to most people.
2020-05-02 22:02:53 +02:00
derrod 9b5620ca30 [cli/core/downloader] Support filtering by install tags
Also adds tsv option for list-files and fixes
no_install not being set with --exclude.

Install tags are only present in some titles, I'm not
entirely sure how EGL uses them. Perhaps to allow one
manifest to be used on different platforms? Or to only
download extra assets when the user wants to?

Either way, it's another filtering feature that may be
useful, though for now it's mostly another toy to explore
EPIC's distribution system with.
2020-05-01 14:34:34 +02:00
derrod 531af3f586 [cli/core/downloader] Add --exclude option to ignore files when downloading
Useful to exclude unnecessary files such as redistributables.

Can be used together with --prefix to exclude files that would
still match the specified --prefix.
2020-05-01 10:43:55 +02:00
derrod 8f7db143a6 [downloader] Greatly simplify download task creation
This is a change to something that was so massively stupid and
overcomplicated that I feel like I need to explain and justify myself:

After figuring out the format for manifests and spending countless
hours staring at IDA/Ghidra I kinda was sick of that, so I decided to
figure out what to do with the manifest myself by playing around with
it, which was also a lot more fun than looking through disassembly.

When looking at the chunks and files it quickly became obvious that the
way they're created is by concatenating all files into 1 MiB chunks that
can be downloaded and reassmebled (mostly) sequentially. What I did not
know was how the order of files in this "stream" was determined.

In playing around with it I came up with the old method: essentially
forming a chain of files, because each file's end generally pointed to
the start of the next file. And it worked great! At least until now...

Yesterday somebody alerted me to a game where this failed and it took me
a bit to figure out. Essentially the chaining had failed because
multiple files started at the same offset, but some of them would follow
another chain that never went back to the chunk it started at,
effectively skipping those files. This was rather annoying to deal with,
I came up with a workaround but it wasn't pretty. So I decided to jump
back into IDA/Ghidra and find out how Epic does it for real.

Well it took me a while, but thanks to symbols (yay macOS!) and a decent
decompiler in Ghidra even a noob like me was able to find it eventually.
The answer is as simple as it can be: the files are sorted alphabetically
(case-insensitive).

So really all I ever had to do was to sort files alphabetically and then
run through them to create the list of tasks.

I feel so stupid.

P.S.: I tested a few games and for the most part the resulting file
processing order is identical between the old and the new method. The
cases where it differs is when there's heavy de-duplication happening
(e.g. Diabotical's small model files) but the runtime cache size remains
the same so both methods are equally efficient, the old one just can't
handle certain cases.
2020-04-30 11:05:26 +02:00
derrod ef0ea26372 [cli/core/downloader] Add support for filtering downloaded files by prefix 2020-04-29 22:08:28 +02:00
derrod e44a00d37f [downloader] Cap worker processes at 16 2020-04-28 06:12:30 +02:00
derrod 0485a728e3 [cli/downloader] Migrate to Queue based logging for subprocesses 2020-04-26 13:19:28 +02:00
derrod 96602d1890 [downloader/models] Minor code cleanups 2020-04-25 10:18:45 +02:00
derrod f1885639ae [downloader] Remove unnecessary imports 2020-04-25 09:25:12 +02:00
derrod 78d745b03f [downloader] Fix log message and close shared memory on exit 2020-04-21 20:26:17 +02:00
derrod 04cc72d154 [downloader] Make read speed actually work (somewhat) 2020-04-21 20:25:26 +02:00
derrod a8a0be5bd2 [downloader] Fix file patching for real this time
Missed this one m(
2020-04-21 20:18:19 +02:00
derrod be8e0169d4 [downloader] Check if resume file actually exists before trying to delete it 2020-04-21 20:05:03 +02:00
derrod c9961f4435 [downloader] Fix patching games with reused chunks 2020-04-21 19:56:34 +02:00
derrod feed5735d4 [downloader] Remove resume file after installation finishes 2020-04-20 01:27:22 +02:00
derrod e00e534f2c First public test version of legendary
Unfortunately the history from before this commit is lost to time. And
that's probably for the best.
2020-04-14 15:40:41 +02:00