[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...
This commit is contained in:
derrod 2020-12-14 08:27:02 +01:00
parent daeee2eb8d
commit cb7ea25a18
2 changed files with 13 additions and 4 deletions

View file

@ -786,7 +786,7 @@ class LegendaryCore:
if not max_shm:
max_shm = self.lgd.config.getint('Legendary', 'max_memory', fallback=1024)
if dl_optimizations or is_opt_enabled(game.app_name):
if dl_optimizations or is_opt_enabled(game.app_name, new_manifest.meta.build_version):
self.log.info('Download order optimizations are enabled.')
process_opt = True
else:

View file

@ -1,13 +1,22 @@
# coding: utf-8
# games where the download order optimizations are enabled by default
# a set() of versions can be specified, empty set means all versions.
_optimize_default = {
'wombat', 'snapdragon'
'wombat': {}, # world war z
'snapdragon': {}, # metro exodus
'honeycreeper': {}, # diabotical
'bcc75c246fe04e45b0c1f1c3fd52503a': { # pillars of eternity
'1.0.2' # problematic version
}
}
def is_opt_enabled(app_name):
return app_name.lower() in _optimize_default
def is_opt_enabled(app_name, version):
if (versions := _optimize_default.get(app_name.lower())) is not None:
if version in versions or not versions:
return True
return False
_cyberpunk_sdl = {