1
0
Fork 0
mirror of synced 2024-05-19 12:02:54 +12:00
Commit graph

78 commits

Author SHA1 Message Date
loathingKernel 17066f9a67 Rare: cherry-pick some of sourcery suggestions 2024-02-12 21:52:07 +02:00
loathingKernel 446cbd6c67 Lgdnr: Check for old_igame before writing tags 2024-01-18 16:43:06 +02:00
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 fa5294b1d5
Lgndr: Replace the monkey functions with factories to create them
The factories are also usable in Rare's code to create compatible
functions for the callbacks. If they there is no callback they just
log what is happening. It also removes the need for `typing-extentions`
module.
2023-12-10 22:43:31 +02:00
loathingKernel 5a2c9ae444
Lgndr: Handle exceptions in the unlock decorator 2023-12-10 13:47:07 +02:00
loathingKernel 9dd078aa92
Lgndr: match _handle_uninstaller signature 2023-12-10 12:18:50 +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
loathingKernel 32859715d3
Lgndr: Use perf_counter in download (Rare only) 2023-11-30 12:51:39 +02:00
loathingKernel 083094bcfc
Downloads: Code clarity 2023-11-28 16:38:02 +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 18ebb6888f
InstallDialog: Allow for some special cases to install 0 size downloads
This specifically helps with games that have selectable downloads.
If we import a game with SDLs without any `install_tags` in the config
we will verify against the full game, meaning that files missing will
cause the verification to fail despite the game being correct. Since the
game is correct, resolving the download will result in a 0 size update.
This change will allow the InstallDialog to finish through the Install
button successfully despite having nothing to install.

On the `lgndr` side things are more complicated. Due to minor oversights
in legendary, the `install_tags` in the above example wouldn't be written
to the configuration file, causing a verification loop because the file
list wouldn't be filtered. To fix that, we also save legendary's config
file at the end of cleaning after a 0 size download.
2023-03-14 12:18:19 +02:00
loathingKernel 9b856e5f8e InstallDialog: Allow downloading 0 size DLCs
There are DLCs (for example KingletAztec) which are essentially
entitlements, a single file the allows access to already downloaded
content. Updates for such DLCs only change the metadata version number
without any actual new data. These DLCs are handled correctly by the
DLM, but our dialog would refuse to allow installing them due to 0 download
size. This change allows them to pass through the InstallDialog.

The other issue, which I don't know if it was only a result of our faulty
validation at startup or could occur in legendary too, is that a DLC might
be marked with needing verification. Currently we don't have a way of
verifying DLCs, so when verifying the game, we will also set the same
state for any installed DLCs. In effect verifying the game successfully
will also mark any DLCs as correct.
2023-02-17 10:37:44 +02:00
loathingKernel 2903c19667 Code cleanup 2023-02-07 13:06:08 +02:00
ondrej.ivanko de236ea397 fix ValueError: 'mutable default X for field indirect_status is not allowed: use default_factory' 2022-12-05 20:09:17 +01: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
lennard 923aa1b90d
Migrate to legendary 0.20.30 2022-10-26 21:36:16 +02:00
loathingKernel 83551f9b9e DownloadThread: Don't mark prerequisites as installed if the user selected not to install them
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2022-09-18 20:52:59 +03:00
loathingKernel 1137d75e79 Lgndr: Update to legendary 0.20.29 2022-09-16 15:26:31 +03:00
loathingKernel 7d2e1ddac2 Lgndr: Keep legendary's logger name 2022-09-13 12:38:43 +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
Stelios Tsampas d5d795ce79 Paths: Query paths after the OrganizationName and ApplicationName have been set
At the point they were evaluated, `OrganizationName` and `ApplicationName` are unset
resulting in wrong paths. As a quick fix, explicitly set them to their later values
Per OS examples:
Windows:
	before:
		data: C:\Users\<user>\AppData\Local
		cache: C:\Users\<user>\AppData\Local\cache
	after:
		data: C:\Users\<user>\AppData\Local\Rare\Rare
		cache: C:\Users\<user>\AppData\Local\Rare\Rare\cache
2022-09-08 01:27:37 +03:00
loathingKernel 2c36ffcd51 Lgndr: Adjust for d8af06c936 2022-09-01 11:49:42 +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 c40fef0595 Lgndr: Transfer what DownloadThread does to install_game_real (not used yet)
DownloadThread: Refactor names to match Lgndr
2022-08-12 13:17:53 +03:00
loathingKernel dffd768934 Re-add dlc arguments 2022-08-08 21:32:31 +03:00
loathingKernel 5e022e6d28 Lgndr: Rename a few fields to reflect legendary's names 2022-08-08 21:06:58 +03:00
loathingKernel e97e9fe841 Downloads: Add skip_dlcs and with_dlcs arguments. 2022-08-08 17:26:38 +03:00
loathingKernel 3ee789a695 Update DownloadThread 2022-08-03 02:33:50 +03:00
loathingKernel 38dfdc8bc2 Lgndr: Remove LegendaryCLISingleton
Since `LegendaryCLI` isn't stateful, we can instantiate
it when needed
2022-08-02 10:42:38 +03:00
loathingKernel 5ac71e99f0 DownloadThread: Use clean_post_install instead of local copy
InstallDialog: Handly empty `config_tags`
Lgndr: Cleanup
2022-08-02 10:42:38 +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 c388f99c46 Lgndr: Move generic function implementations to api_monkeys 2022-08-02 10:42:38 +03:00
loathingKernel f375357a2c Utils: fix unresolved references 2022-08-02 10:42:38 +03:00
loathingKernel 7408116deb Lgndr: Don' use lambda with default argument 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