1
0
Fork 0
mirror of synced 2024-06-18 02:24:43 +12:00
Commit graph

39 commits

Author SHA1 Message Date
loathingKernel 69a73882f5
Lgndr: Don't try to anonymize 2023-12-23 13:48:21 +02:00
loathingKernel b039f9e06c
LaunchDialog: allow legendary to check for updates in its own way 2023-12-19 11:46:13 +02:00
loathingKernel b93435d920
Lgndr: Disable legendary's update checks and ignore config file options 2023-12-16 16:23:58 +02:00
loathingKernel 54ac89a85a
Lgndr: Validate default platform if it is coming from the config 2023-12-16 15:36:38 +02:00
loathingKernel 447d704de3
Lgndr: Log what config location we are using 2023-12-16 13:57:32 +02:00
loathingKernel 1677ea762c
FetchWorker: Fix issue with missing MacOS assets on MacOS
Using `LegendaryCore.get_game_and_dlc_list` with platform `Windows`
updated the assets only for the `Windows` builds of the games missing
`Win32` and `MacOS` assets on clean installs. This caused Rare to not
include MacOS install options on MacOS (duh!). This might also have been
the cause that users were unable to launch games, since they where only
offered the `Windows` build of the games (big duh!).

To fix this, fetch the assets for `Win32` and `MacOS` games before getting
the final list of games and dlcs based on the `Windows` platform.

In this regard, also re-use the existing options for getting metadata to
give the option to the user to include them when updating assets. Also add
an option to include Unreal engine assets which until now were fetched
unconditionally.

* Include Unreal: When the user option is `true` or debugging.
  Defaults to `false`
* Update Win32: When the user option is `true` or debugging.
  Defaults to `false`
* Update MacOS: Force on MacOS, when the option is `true` or debugging on
  other platforms. Defaults to `true` on MacOS and is disabled,
  `false` on others

Furthermore, respect legendary's `default_platform` config option and
set it in the config on new configurations. The new method in our
LegendaryCore monkey allows us to use that option in RareGame when doing
version checks on not installed games, and not defaulting to `Windows`.

Finally, set `install_platform_fallback` to false in a new config to
avoid unwanted side-effects.
2023-12-15 16:57:32 +02:00
loathingKernel 23716e40d8
Lgndr: Log function name using the decorator 2023-12-13 21:29:02 +02:00
loathingKernel 90acf4b9ce
Lgndr: Make the decorator compatible with python 3.9
Revert this once we move to python `>=3.10`
2023-12-13 15:05:04 +02:00
loathingKernel f361828f37
Lgndr: Replace _installed_lock with a non-thread-local instance.
Since Python 3.11, `FileLock` is thread-local by default, which causes
numerous issues with Rare because of numerous operations running in
`QThreads` and `QRunnables`. To work around it, add a monkey LGDLFS class
that uses a non-thread-local instance of `FileLock`. Since the monkey class
exists, implement a `unlock_installed` method for code clarity

* Add decorate `LegendaryCore.egl_sync` with `unlock_installed`
* Log that Rare's monkeys are in use
* Add function signature protocols based on `typing.Protocol`
2023-12-13 15:05:01 +02:00
loathingKernel ca5daab71d
Lgndr: Log that the data lock is active 2023-12-10 22:46:02 +02:00
loathingKernel 5a2c9ae444
Lgndr: Handle exceptions in the unlock decorator 2023-12-10 13:47:07 +02:00
loathingKernel e308686468
Revert "Lgndr: Add _login overload in core.py"
This reverts commit 8d0397415d.
2023-12-10 12:09:38 +02:00
loathingKernel 6daee29c24
Revert "Lgndr: Undo bind_ip changes"
This reverts commit 7979563cb5.
2023-12-10 12:09:26 +02:00
loathingKernel 8d0397415d
Lgndr: Add _login overload in core.py
Revert this commit once the new version of Legendary (`>0.20.33`) is released
2023-12-03 11:21:51 +02:00
loathingKernel 7979563cb5
Lgndr: Undo bind_ip changes
Revert this commit once the new version of Legendary (`>0.20.33`) is released
2023-12-01 13:22:35 +02:00
loathingKernel 9aae822295
Lgndr: Import legendary changes 2023-12-01 13:21:44 +02:00
Stelios Tsampas 2ebc12b1f5 LgdnrCore: Add egstore_write and egstore_delete methods
`egl_unintall` and `egl_export` try to access EGL's programdata folder which raises an exception if the folder doesn't exist (Windows) or it isn't specified (Linux). Copy the relevant bits from LegendaryCore to LgndrCore and create two new methods that only manipulate the `.egstore` folder.
2023-03-15 17:59:33 +02:00
loathingKernel 2903c19667 Code cleanup 2023-02-07 13:06:08 +02:00
loathingKernel 5370355e5d Lgndr: Restructure module to follow legendary's file hierarchy
Move overloaded class files into the folders following
legendary's structure. Move Rare's integration classes into
their own subfolder.
2022-10-29 14:50:18 +03:00
loathingKernel 1137d75e79 Lgndr: Update to legendary 0.20.29 2022-09-16 15:26:31 +03:00
loathingKernel b7b96f79b2 Apply fix for "403 Client Error" by applying pending https://github.com/derrod/legendary/pull/477 2022-09-08 20:43:03 +03:00
Dummerle 4e325eb3d8
Ignore some pylint errors 2022-08-30 01:33:08 +02:00
loathingKernel a6d1cae8a8 Lgndr: Temporary fix for DLManager monkeypatching in Windows 2022-08-30 01:22:08 +02:00
loathingKernel 3ee789a695 Update DownloadThread 2022-08-03 02:33:50 +03:00
loathingKernel 785aaf648e GameInfo: Detect repair_and_update requirement
If a game was partially installed and it was imported
through the import functionality, if `repair_and_update`
is specified it will report `0` download size if there
is no real update to be done. Fix it by detecting the
need for an update explicitly.

This will also force games that have failed verification
to also update while repairing them, fixing the
long-standing issue of repairing an older version of a
game and then doing the update in a separate step.
2022-08-02 10:42:38 +03:00
loathingKernel ee5adce18b Implement LgndrIndirectLogger to return the last logged message from LegendaryAPI
The indirect return is stored in a `LgndrIndirectStatus` object that provides checking and unpacking features

Lgndr: `LgndrInstallGameArgs.install_tag` default to None
Lgndr: add default `move` method.
Lgndr: monkeypatch `dlm.status_queue` after preparing a download to reduce `InstallQueueItemModel`
InstallOptionsModel: implement `as_install_kwargs` to pass only relevant arguments to `LgndrInstallGameArgs` in InstallDialog
InstallOptionsModel: rename `sdl_list` to `install_tag` as they were the same thing
LegendaryUtils: Update to use `LgndrIndirectStatus`
UninstallDialog: Add option to keep configuration decoupled from keeping game data
GameUtils: Add messagebox to show error messages from legendary after uninstalling a game
InstallDialog: Update to use `LgndrIndirectStatus`
InstallDialog: Update selectable download handling to match legendary's
DownloadThread: Remove multiple instance variables, instead reference them directly from `InstallQueueItemModel` instance
ImportGroup: Replace `info_label` with an `ElideLabel` for displaying long messages
ImportGroup: Don't translate message strings in the `ImportWorker`
GameInfo: Call `repair()` if needed after verification instead of handling it locally
GamesTab: Fix string matching for capitalized strings and scroll to top on when searching
2022-08-02 10:42:38 +03:00
loathingKernel 28531eec38 Lgndr: Add logger monkey class
The class acts as an intermediate between the logger and the function call
It keeps the last message that was sent to the logger. The instance of the
class can be returned as a return value from the LegendaryCLI methods to
provide return status and the message related to it.

The level at which it considers the logged message as an error is configurable.
By default it considers logging.ERROR and above as faulty return values
2022-08-02 10:42:38 +03:00
loathingKernel bbaff5f42c Lgndr: Add re-implemented uinstall_game
Lgndr: Change the exception level to CRITICAL for core
LegendaryUtils: Use uninstall_game from our Lgndr
UninstallDialog: Update to return a tuple of values
App: Keep files if the install directory was lost
App: Run legendary's exit procedures on exit
2022-08-02 10:42:38 +03:00
loathingKernel 7aded95a1f Lgndr: Monkeypatch modified DLManager into LegendaryCore at module import 2022-08-02 10:42:38 +03:00
loathingKernel 3aae3887f6 Lgndr: Create argument models for consistent function arguments and cleaner implementation.
Lgndr: Prefix files that aren't part of legendary with 'api_'
Lgndr: Return statistics from 'verify_game' instead of parsing the exception
VerifyWorker: Add 'error' signal for exceptions.
2022-08-02 10:42:38 +03:00
loathingKernel 883bd268ff Mirror Legendary classes structure in the shim.
Lgndr: Move code segments copied from `prepare_download` back to their original location in `install_game`
Lgndr: Add the LgndrLogHandler at initialization instead of every function.
Lgndr: Move `verify_game` to its original place in `LegendaryCLI`
Lgndr: Change the way DLManager is patched into LegendaryCore proper
Shared: Add singleton for LegendaryCLI, LegendaryCoreSignleton returns core from LegendaryCLI
VerifyWorker: Update to use `verify_game` from `LegendaryCLI` directly
PreLaunchThread: Initialize LegendaryCLI to get LegendaryCore from it
InstallDialog: Update `prepare_install` argument names
2022-08-02 10:42:38 +03:00
loathingKernel d4bf783018 Update core to the submodule rebase 2022-08-02 10:42:38 +03:00
loathingKernel fd2c094dc2 Add override for prepare_overlay_install() 2022-08-02 10:42:38 +03:00
loathingKernel 9af4e7ead8 Specify correct return type for prepare_download() and disable formatting for copied code segments 2022-08-02 10:42:38 +03:00
loathingKernel 2c2f44c97c Use a loggin handler in stead of monkeypatching for raising LgndrException 2022-08-02 10:42:38 +03:00
loathingKernel 99ab488820 Pass the correct status queue and monkeypatch run_real in prepare_download 2022-08-02 10:42:38 +03:00
loathingKernel d4718f823f Use custom exception to overload log.error and log.fatal in egl_import and egl_export 2022-08-02 10:42:38 +03:00
loathingKernel a9954a98f6 LegendaryCore: Re-use super's prepare_download() instead of copying it. 2022-08-02 10:42:38 +03:00
Stelios Tsampas e58d33ee5d Create shim legendary classes for overloaded functions 2022-08-02 10:42:37 +03:00