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

39 commits

Author SHA1 Message Date
loathingKernel 446cbd6c67 Lgdnr: Check for old_igame before writing tags 2024-01-18 16:43:06 +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 6daee29c24
Revert "Lgndr: Undo bind_ip changes"
This reverts commit 7979563cb5.
2023-12-10 12:09:26 +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 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 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
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 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 5e022e6d28 Lgndr: Rename a few fields to reflect legendary's names 2022-08-08 21:06:58 +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 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 14087a3c6c Lgndr: Add default implementation for get_boolean_choice that returns False 2022-08-02 10:42:38 +03:00
loathingKernel b4a1efa357 Lgndr: Add 'repair_and_update' argument in InstallOptionsModel 2022-08-02 10:42:38 +03:00
loathingKernel aeb149a3e9 Lgndr: Use custom wrapped decorator to wrap LegendaryCLI functions
Lgndr: Add `get_boolean_choice` to relevant args dataclasses
Lgndr: Move mock functions to `api_monkeys`

InstallDialog: Add status queue to prepare_overlay_install arguments, fixes missing download stats
2022-08-02 10:42:38 +03:00
loathingKernel caffd9c51d Lgndr: Return result from resolve_aliases (woops) 2022-08-02 10:42:38 +03:00
loathingKernel 10b845c0aa Lgndr: Save the manifest if it was downloaded while verifying 2022-08-02 10:42:38 +03:00
loathingKernel 545d77ef07 Lgndr: Expose 'resolve_aliases' for outside usage 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 197f915fb3 InstallOptionsModel: Rename fields to use the same names as Legendary's arguments 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 2c2f44c97c Use a loggin handler in stead of monkeypatching for raising LgndrException 2022-08-02 10:42:38 +03:00
Stelios Tsampas 04a76ed2ff Include PoC implementation of LegendaryCLI for the import_game method 2022-08-02 10:42:38 +03:00