Commit graph

270 commits

Author SHA1 Message Date
derrod 8181f9faeb [core] Log number of deleted files (if any) 2021-10-21 14:10:14 +02:00
derrod 964ee08d05 [core] Add references to "clean-saves" in error message 2021-10-21 13:28:33 +02:00
derrod 355b1107e6 [cli/core] Add "clean-saves" command to remove obsolete/broken cloud save data 2021-10-21 13:26:36 +02:00
derrod 85a275950d [core] Show warnings and error out if save data is corrupted 2021-10-21 13:26:00 +02:00
derrod d5ec14b556 [core] Fix resolving "{AppData}" in save path
Why did they decide that {AppData} should match to %LOCALAPPDATA%?
2021-10-21 12:15:44 +02:00
derrod 0ef916e9c5 [cli/lfs] Prune game metadata that's no longer needed 2021-10-16 19:44:48 +02:00
derrod 8c002a76e0 [cli/core] Replace old manual game store query with new property 2021-10-16 19:44:15 +02:00
derrod 841db6bcb6 [core] Add "asset_available" helper function 2021-10-16 18:59:18 +02:00
derrod e6bb64f16f [core] Only delete files that are actually installed (based on tags) 2021-10-12 15:24:49 +02:00
derrod 0bc543518c [core] Properly construct Origin launch URI 2021-10-10 12:30:25 +02:00
derrod 74bc2fecc0 [core] Check if base path exists, add failure condition if it doesn't 2021-10-10 08:36:36 +02:00
derrod aafba86a94 [core] Validate session expiry time before skipping login 2021-10-08 10:36:32 +02:00
derrod 9471ca41e1 [core] Do not check egstore folder for DLC 2021-10-08 10:17:15 +02:00
derrod b3b5470947 [core] Make auth() return immediately if already logged in 2021-10-08 10:15:07 +02:00
derrod b857967dfa [cli/core] Add WebView killswitch to Legendary update data
In case epic breaks it, this at least lets us disable it remotely.
2021-10-07 05:20:08 +02:00
derrod c4695d2b99 [cli/models/lfs] Clean up some old code/comments 2021-10-05 09:22:17 +02:00
derrod 8460fdfd2a [cli/core/lfs] Add support for trying multiple encryption keys
Should Epic change the key used for EGL in the future we want to
be backwards-compatible to existing (outdated) EGL installs as well
as new ones without having to push out a new release.

Also forces updating of version data before attempting the import to
get the latest key(s) and adds a log message when auth data is deleted.
2021-10-05 07:34:52 +02:00
derrod 638578283b [core/utils/lfs] Fix auth import with now encrypted EGL user data
It took way too long to find the key.
It's not even hidden, I'm just dumb.
2021-10-04 09:26:44 +02:00
derrod e7ce2e5cb7 [core] Force-refresh aliases when fetching games without assets 2021-10-02 21:21:46 +02:00
derrod 0d8b74a9e0 [cli/core/utils/lfs] Add automatic alias generation 2021-10-02 21:10:25 +02:00
derrod 7509550eb1 [cli/core] Add option to force refresh game metadata 2021-09-28 05:56:19 +02:00
derrod a1993eb568 [core] Refactor getting wine/wrapper launch command into its own function 2021-09-28 05:21:16 +02:00
derrod b5d4224664 [cli/core] Only return legendary-defined environment variables 2021-09-28 05:07:06 +02:00
derrod 888d62a96d [cli/core/models] Refactor launch parameters and add --json option
Primarily intended to make it easier for third-party applications
(mainly Heroic) to handle launch options on their own by simply
taking the necessary information from legendary and ignoring
user-defined stuff.

Also useful for debugging.
2021-09-28 04:06:54 +02:00
derrod ee2432c443 [cli/core/lfs] Allow specifying custom config file 2021-09-28 03:07:15 +02:00
derrod e881e42d5f [core] Save non-install game metadata 2021-09-18 20:02:52 +02:00
derrod fbd0df1ecc [cli/core] Include DLCs in installed games list
This should be replaced later on by including information
about the main game in the InstalledGame metadata.
2021-09-10 20:30:53 +02:00
derrod 6b4cf6558b [core] Warn if parsing manifest-defined launch parameters fails 2021-09-09 09:55:48 +02:00
derrod 0bf7110653 [core] Move getting env vars to separate method 2021-09-08 10:37:40 +02:00
derrod b12798e6b0 [cli/core/lfs/utils] Fetch SDL data from API 2021-09-05 09:41:54 +02:00
derrod 791bc77c7c [core/lfs] Enable update notification for PyInstaller on Linux 2021-09-05 00:49:11 +02:00
derrod 5a8de3a3bc [core/utils] Update auth EGL version and game workarounds from API 2021-09-03 23:20:17 +02:00
derrod ba6ec3ecca [cli/core] Add option to launch games via Origin (Windows only) 2021-09-03 22:59:47 +02:00
derrod 315bdfb4a4 [cli/core/lfs] Enable update check by default, make notice optional
This will allow legendary to force checking for updates in critical
situations where it may be required. Also enables updating configuration
data on Linux by default.
2021-09-03 20:10:30 +02:00
derrod d3026672d1 [core] Fix for epic authentication API changes 2021-09-03 19:16:37 +02:00
derrod a465966954 [api/cli/core/lfs] Add Legendary update check 2021-09-02 19:31:04 +02:00
derrod 4d5539c889 [cli/utils] Automatically create missing config sections 2021-09-02 19:31:04 +02:00
derrod f78674b3ed [core] Formatting and type hint fixes 2021-09-01 15:29:25 +02:00
derrod a80244ed37 [cli/core] Add flag to show non-installable games/DLCs
This primarily means titles that have to be activated on external stores
such as Battlefront II which has to be installed via Origin.

Addresses half of #202
2021-09-01 15:28:25 +02:00
derrod 7ff16aad44 [core/downloader] Move downloader to new sub-package
Preparing to add a new AIO based downloader
2021-08-14 05:12:10 +02:00
derrod d86039dd9b [cli/core] Add option to disable HTTPS for downloads
The EGS client does not use HTTPS for downloads in order to facilitate
the use of tools such as LanCache that use DNS based CDN redirection.

Legendary should be usable in such an environment as well,
but HTTPS will remain on by default.

See: https://lancache.net/news/2019/06/15/steamcache-is-rebranding-to-lancachenet/
2021-08-09 11:31:03 +02:00
derrod 1760c34703 [cli/core] Add option for preferred CDN host
Allows a user to specify a preferred CDN via config or command line.
Also changes selection process to match EGS client
(no random selection anymore).
2021-08-09 11:17:15 +02:00
derrod bb3d6f9348 [core/utils] Improve minimum disk space calculation when updating 2021-06-17 15:00:34 +02:00
derrod a2280edea8 [cli/core] Add option to override launch executable 2021-01-10 14:24:06 +01:00
derrod ee3b3fb9fe Fix various typos and some style complaints
Closes #175
2021-01-02 06:53:21 +01:00
derrod 3c71229b7e [core] Fix missing {} around KnownFolders GUID 2020-12-26 22:01:30 +01:00
derrod 104b928e3a [core] Increase default shared memory to 2048 MiB
This should still be reasonable for most machines people are going to run games on,
and means no manual increases are required for every game it has been previously
needed for.
2020-12-18 17:26:51 +01:00
derrod 1a015a3ba7 [core] Only attempt to delete untagged files that exist 2020-12-18 17:01:52 +01:00
derrod 1cec4c6cb0 [core] Add method to remove untagged files 2020-12-17 15:25:01 +01:00
derrod 86ea066e8d [core] Save install tags to InstalledGame 2020-12-17 15:23:06 +01:00
derrod cff8abd0da [core] Import/Export install tags to EGL 2020-12-17 15:23:05 +01:00
derrod df9380ab3d [core] Fix calculating install size *again* 2020-12-17 15:23:05 +01:00
derrod 691fd9bc8f [core] Fix calculating install size (again) 2020-12-16 12:15:18 +01:00
derrod e710bb893f [core] Fall back to default wine prefix location
This and the previous commit fix #41
2020-12-16 11:29:39 +01:00
derrod 5e061d6946 [core/utils] Add save path resolution on Linux
If a wine prefix is specified in the config, attempt to
find savegames in there.
2020-12-16 11:18:58 +01:00
derrod 3e2a6011ff [core] Ignore comments in configuration environment variables
Comments are treated as keys with no value by configparser, but env
variables with None as the value are not valid so this would crash.

Fixes #156
2020-12-16 05:45:05 +01:00
derrod cb7ea25a18 [core/utils] Add version check to game workarounds
Also add more games to the list of optimizations being enabled by default.

This will bring Pillars of Eternity down to around ~2 GiB shared memory,
which is still too much but without implementing another workaround that
adds a prefix filter I cannot really fix this. Certainly better than 24...
2020-12-14 08:27:02 +01:00
derrod b7db0ac721 [api/core/downloader] Update User-Agents 2020-12-13 03:14:55 +01:00
derrod 5db6d9c73f [core/README] Add max_workers config option
Addresses #148
2020-12-07 23:52:43 +01:00
derrod 3aeb48efdf [core] Always initialize locale on startup 2020-11-25 18:50:09 +01:00
derrod 8a98c14055 [core] Fix CDN URI building for new Akamai CDN 2020-11-21 17:57:54 +01:00
derrod 1598844bc6 [core] Always use default.env
Also fixes minor typo
2020-11-21 06:21:59 +01:00
derrod 3e6e173772 [core] Fix Uplay installer check 2020-11-05 15:25:37 +01:00
derrod 8206283755 [core/cli] Warn/Fail if game requires Uplay
Addresses #69 but does not fix it.
2020-11-02 19:08:06 +01:00
derrod 3310f7e7a7 [core] Fix crash if no old manifest present 2020-11-02 18:35:22 +01:00
derrod e97941327e [core] Return empty asset list if not authenticated
Fixes #106
2020-11-02 15:26:10 +01:00
derrod 83e3af344f [core/lfs] Remove unversioned local manifest saving/loading 2020-11-02 14:58:23 +01:00
derrod effc74b73b [core] Exclude mods from games list 2020-11-01 16:38:43 +01:00
derrod 37083b01de [core] Disable delta manifests if versions identical 2020-11-01 15:38:18 +01:00
derrod 7046b06f14 [api/core/downloader] User-Agent update 2020-11-01 14:34:36 +01:00
derrod ace9ce8b5d [core] Show warning when looking up DLC fails
Might fix #101
2020-10-31 19:48:08 +01:00
derrod d95fd20e76 [core] Use non-POSIX mode for parsing manifest launch arguments
(hopefully) Fixes #128
2020-10-24 19:19:25 +02:00
derrod dcbf8db54d [core] Properly handle Delta manifests (update base manifest)
Also removes the old workaround.
2020-09-09 10:29:46 +02:00
derrod d4f4571f85 [core] Allow "wrapper" and "no_wine" in "default" section
The entire config crap will have to be rewritten to be "nicer"...
2020-09-08 04:56:56 +02:00
derrod 6bae5d3081 [core] Prevent importing unknown games from EGL 2020-09-08 04:38:11 +02:00
derrod 7575b8f3a7 [cli/core] Prevent crash when game asset metadata is missing 2020-09-08 04:25:34 +02:00
derrod 9c9fee8f11 [core] Don't request delta manifest if old == new 2020-09-06 06:18:43 +02:00
derrod a55f75d5e8 [core/downloader] Prevent file deletion when using delta manifest
This is technically not how we should do this. In theory we should
"overlay" the delta manifest over the proper one and simply add/replace
the chunk/file list entries with the one from the delta manifest.
However simply not deleting files also works for the time being since files
are rarely deleted anyways.
2020-09-06 05:57:28 +02:00
derrod bd66d6c5dc [api/core/downloader] Update User-Agents 2020-09-06 03:16:06 +02:00
derrod 0430204f59 [core] Add debug message for delta manifest unavailability 2020-09-05 05:27:44 +02:00
derrod fb9e8d4138 [core] Fix disk space check for initial install and add override 2020-09-05 05:18:15 +02:00
derrod d1b8412b27 [core] Add options for delta manifests and update-when-repairing 2020-09-05 05:16:05 +02:00
derrod 4b4483c580 [core] Implement delta manifests 2020-09-05 05:05:21 +02:00
derrod f4a1e4610b [core] Skip savegame download if manifest empty 2020-08-06 09:28:35 +02:00
derrod 0a5b53ab6f [cli/core/utils] Only remove files in manifest during uninstall
Some games are using the installation directory to store savegames.
To avoid deleting those, only remove files that are actually in the
manifest and only delete the directory if it is empty.
2020-06-10 18:21:47 +02:00
derrod 2647fa4915 [core] Do not sync DLC to EGL 2020-06-10 17:59:04 +02:00
derrod 4720b59d99 [core/cli] Fix typos in function names 2020-06-05 15:01:02 +02:00
derrod 8d46d7ad2e [core] Fix save path when downloading multiple saves 2020-06-04 15:55:16 +02:00
derrod 6d84307134 [core] Fix crash if EGL installation has been removed 2020-06-02 11:35:54 +02:00
derrod f8f134dd4b [core] Resolve WINE dos device mappings 2020-06-01 12:51:12 +02:00
derrod c216341467 [core] Add wine_prefix config option 2020-06-01 08:36:06 +02:00
derrod 211f65c4c6 [core/downloader/api] Update User-Agents 2020-05-31 02:37:37 +02:00
derrod 3063f02db3 [cli/core] Implement newer Epic authentication scheme
Fixes #52
2020-05-31 02:01:50 +02:00
derrod fb2af2b17a [core] Add more debug logging 2020-05-30 02:40:58 +02:00
derrod 3b5fc04829 [core] Keep EGL GUID when updating 2020-05-30 02:40:48 +02:00
derrod a488d32502 [core] Fix game path on linux (\ vs /) 2020-05-30 00:49:48 +02:00
derrod 9dbc57ece7 [core] Abort export if manifest cannot be loaded 2020-05-30 00:49:30 +02:00
derrod 3380671b74 [core] Avoid recursion in egs_sync 2020-05-30 00:49:10 +02:00
derrod 0610b07bf3 [core] Do not attempt to fetch metadata if update_assets is not set 2020-05-30 00:48:54 +02:00
derrod d3c2769014 [core] Adjust game path when importing from EGL in WINE 2020-05-30 00:25:54 +02:00
derrod 9b545a82a8 [core] Fix egl_uninstall missing exception handling 2020-05-30 00:17:06 +02:00
derrod 867a661c9d [core] Also remove egl programdata path from config if invalid 2020-05-30 00:10:50 +02:00
derrod 99485da7d8 [core] Reset EGL path if it is invalid 2020-05-29 23:53:07 +02:00
derrod 0b220cd19a [core] Add Epic Games Launcher import/export functionality
May contain bugs, right now it works but there are a few
hacks in there to deal with synchronization that may come
to bite me in the ass later.
2020-05-29 23:07:58 +02:00
derrod 1d7d0eaa38 [core/cli] Import games installed via EGL w/o verification 2020-05-29 00:20:31 +02:00
derrod 2e2bb3ad41 [cli/core/models] Add install size to installed games 2020-05-28 23:05:36 +02:00
derrod 5d4d46f7ea [core] Remove unused parameter 2020-05-28 22:58:14 +02:00
derrod da757ac18e [core] Also initialize Epic LFS on Linux 2020-05-28 22:45:08 +02:00
derrod e3ad2d8de9 [core] Fix crash when game config section is missing 2020-05-28 22:41:31 +02:00
derrod e083b6f9b5 [core] Show error if game installation could not be deleted
Kinda fixes #44
2020-05-25 13:01:12 +02:00
derrod dad1c7f2c2 [core] Move getting manifest urls into separate function 2020-05-23 23:20:13 +02:00
derrod cddc58c46e README update and whitespace fixes 2020-05-23 19:02:13 +02:00
derrod e4e4a0b7df [core] Add "no_wine" config option 2020-05-23 18:35:58 +02:00
derrod c52cd09eb7 [cli/core] Add env var for wrapper and fix priority
Priority should always be command line > env var > config
2020-05-23 18:33:11 +02:00
derrod 6c9e3a1d62 [cli/core] Add flag to disable WINE 2020-05-23 18:29:43 +02:00
derrod e9a959e3a7 [core] Strip leading slashes from executable path
Fixes #42 and launching Hyper Light Drifter
2020-05-23 12:43:37 +02:00
derrod 38f5bbd934 [cli/core/models] Add support for importing already installed games
Fixes #10 though will need further improvement.
2020-05-20 14:06:55 +02:00
derrod 0d6bcf5950 [cli/core] Add support for launching games with a wrapper 2020-05-20 12:49:51 +02:00
derrod c904bbfa19 [cli/core] Add repair command/flag
Fixes #27
2020-05-20 12:44:45 +02:00
derrod 1622b415ea [core/utils] Move lfs helpers to utils 2020-05-19 17:45:46 +02:00
derrod 8cda65fd3e [core] Use and save existing base urls for manifest overrides 2020-05-19 14:44:45 +02:00
derrod 59f2ebb211 [core] Apply expanduser to config values as well 2020-05-18 10:59:38 +02:00
derrod 39f0d4c831 [cli/core/api] Allow setting locale/language
Fixes #35 as far as I can tell
2020-05-18 10:58:23 +02:00
derrod 099e222a80 [core] Return platform specific version if override is used 2020-05-16 16:48:45 +02:00
derrod 730eaebec9 [cli/core/models] Fix a whole bunch of cloud save issues
- Games that didn't already have cloud saves weren't synced
- Games that didn't have local saves didn't behave correctly
- Games that only had local saves also didn't work correctly
2020-05-16 12:50:28 +02:00
derrod 03c503b4e6 [core/utils] Show warning/info if no save files have been found
This should alert users in cases the exclude/include filters fail
2020-05-16 12:29:33 +02:00
derrod 2ba036a654 [core/utils] Implement save game file filters 2020-05-16 12:19:06 +02:00
derrod e88a369feb [core] Honor existing installation directory
This prevents an issue where changing the base
path later on would cause an update to be written
to the wrong directory (or cause crashes).
2020-05-16 11:01:13 +02:00
derrod 532e1df237 [core] Show error if old manifest can't be loaded
Also prevents crashes.
2020-05-16 10:52:09 +02:00
derrod 289a1aa9e8 [core] Log if game installation directory does not exist 2020-05-15 12:38:27 +02:00
derrod d6abbcc694 Cleanup! (Remove shebangs, unused files) 2020-05-15 07:01:30 +02:00
derrod 0f01e404a4 [cli/core/downloader] Support multiple filter arguments
Fixes #20
2020-05-14 16:32:08 +02:00
derrod 98df2a0a38 [cli/core/models/utils] Add basic cloud save syncing support 2020-05-14 14:52:33 +02:00
derrod 2945c6c91f [cli/core] Add flags/env vars to override WINE binary/prefix 2020-05-12 02:31:01 +02:00
derrod 31530692ef [api/cli/core] Add extremely basic support for cloud saves
Currently only supports downloading all saves to a folder,
in the future it should support automatically extracting save
files to the proper directory (at least on Windows).
2020-05-06 15:40:04 +02:00
derrod e54d13be37 [core] Add warning for EQU8 anti-cheat 2020-05-04 19:50:56 +02:00
derrod 441c619db0 [core] Fix disk space check 2020-05-04 19:50:44 +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 261d0c636f [cli/core] Add some more logging 2020-05-01 19:57:42 +02:00
derrod 20a477d20f [core] Always get all base urls 2020-05-01 19:57:22 +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 7dacd7ba35 [cli/core] Fix manifest saving/loading
The refactoring didn't take into account that the raw
manifest data still needs to be accessible. Since I did
not want to modify the manifest model to hold the raw
data (waste of RAM), just make the methods return the
raw data again (at least for now)
2020-04-30 11:42:09 +02:00
derrod 6788b1257c [core] Refactor manifest loading 2020-04-30 11:10:34 +02:00
derrod ef0ea26372 [cli/core/downloader] Add support for filtering downloaded files by prefix 2020-04-29 22:08:28 +02:00
derrod 6e5e281c82 [core] Fix pre-installation warnings
- Make errors unique
- FNA/XNA games don't seem to really work with WINE.
2020-04-29 15:41:21 +02:00
derrod 209ba2dd81 [core] Remove unnecessary OVT path adjustments
Not only does this not work (path.join() will not
actually add Z: on non-Windows), it's also not necessary.

Confirmed to work with Detroit: Become Human (Demo) and
Just Cause 4.
2020-04-29 15:16:17 +02:00
derrod 9613ad34ba [core] Log when manifest/base url is being overridden by the user 2020-04-28 15:56:52 +02:00
derrod 8251db22d2 [cli/core] Allow overriding platform and UE filter in list-games 2020-04-28 15:32:38 +02:00