Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Fix runtime arg path
Browse files Browse the repository at this point in the history
- Use full runtime path for eac and battleeye instead of separate wrapper arg
- Update tests
  • Loading branch information
redromnon committed Jul 3, 2023
1 parent 6bcf85c commit cb86865
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
9 changes: 2 additions & 7 deletions func/checkparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,12 @@ def checkparameters(appname, gamejsonfile, gametype):
#eacRuntime
eacRuntimeArgs = []
if gameSettings.get("eacRuntime"):
environment["PROTON_EAC_RUNTIME"] = configpath.runtimepath
eacRuntimeArgs = ["eac_runtime"]
wrapperArgs += eacRuntimeArgs
environment["PROTON_EAC_RUNTIME"] = os.path.join(configpath.runtimepath, "eac_runtime")

#battlEyeRuntime
battlEyeRuntimeArgs = []
if gameSettings.get("battlEyeRuntime"):
environment["PROTON_BATTLEYE_RUNTIME"] = configpath.runtimepath
battlEyeRuntimeArgs = ["battleye_runtime"]
wrapperArgs += battlEyeRuntimeArgs

environment["PROTON_BATTLEYE_RUNTIME"] = os.path.join(configpath.runtimepath, "battleye_runtime")

#nvidiaPrime
if gameSettings.get("nvidiaPrime"):
Expand Down
2 changes: 1 addition & 1 deletion func/configpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def is_flatpak_installed(application_id: str) -> bool:

storejsonpath = os.path.join(actual_config_path, "heroic/store/config.json")

runtimepath = os.path.join(actual_config_path, "heroic/tools/runtimes/")
runtimepath = os.path.join(actual_config_path, "heroic/tools/runtimes")

# Check if Steam is Flatpak
is_steam_flatpak = is_flatpak_installed(STEAM_FLATPAK_APPID)
28 changes: 14 additions & 14 deletions tests/testcheckparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def test_getparameters_epic_proton_all_options(self):
# maxSharpness
'WINE_FULLSCREEN_FSR_STRENGTH': str(MOCK_GAME_CONFIG_FULL_OBJ[MOCK_APP_NAME]['maxSharpness']),
# eacRuntime
'PROTON_EAC_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_EAC_RUNTIME': f"{MOCK_RUNTIME_PATH}/eac_runtime",
# battlEyeRuntime
'PROTON_BATTLEYE_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_BATTLEYE_RUNTIME': f"{MOCK_RUNTIME_PATH}/battleye_runtime",
# nvidiaPrime
'DRI_PRIME': '1',
'__NV_PRIME_RENDER_OFFLOAD': '1',
Expand All @@ -196,9 +196,9 @@ def test_getparameters_epic_proton_all_options(self):
expected_environment = expected_environment | MOCK_ENVIRONMENT
expected_arguments = [
# eacRuntime
'eac_runtime',
#'eac_runtime',
# battlEyeRuntime
'battleye_runtime',
#'battleye_runtime',
# wrapperOptions
MOCK_GAME_CONFIG_FULL_OBJ[MOCK_APP_NAME]['wrapperOptions'][0]['exe'],
# unpack list of wrapper args
Expand Down Expand Up @@ -241,9 +241,9 @@ def test_getparameters_epic_proton_steam_runtime_all_options(self):
# maxSharpness
'WINE_FULLSCREEN_FSR_STRENGTH': str(MOCK_GAME_CONFIG_FULL_OBJ[MOCK_APP_NAME]['maxSharpness']),
# eacRuntime
'PROTON_EAC_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_EAC_RUNTIME': f"{MOCK_RUNTIME_PATH}/eac_runtime",
# battlEyeRuntime
'PROTON_BATTLEYE_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_BATTLEYE_RUNTIME': f"{MOCK_RUNTIME_PATH}/battleye_runtime",
# nvidiaPrime
'DRI_PRIME': '1',
'__NV_PRIME_RENDER_OFFLOAD': '1',
Expand All @@ -259,9 +259,9 @@ def test_getparameters_epic_proton_steam_runtime_all_options(self):
expected_environment = expected_environment | MOCK_ENVIRONMENT
expected_arguments = [
# eacRuntime
'eac_runtime',
#'eac_runtime',
# battlEyeRuntime
'battleye_runtime',
#'battleye_runtime',
# wrapperOptions
MOCK_GAME_CONFIG_PROTON_OBJ[MOCK_APP_NAME]['wrapperOptions'][0]['exe'],
# unpack list of wrapper args
Expand Down Expand Up @@ -306,9 +306,9 @@ def test_checkparameters_gog_linux(self):
# maxSharpness
'WINE_FULLSCREEN_FSR_STRENGTH': str(MOCK_GAME_CONFIG_FULL_OBJ[MOCK_APP_NAME]['maxSharpness']),
# eacRuntime
'PROTON_EAC_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_EAC_RUNTIME': f"{MOCK_RUNTIME_PATH}/eac_runtime",
# battlEyeRuntime
'PROTON_BATTLEYE_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_BATTLEYE_RUNTIME': f"{MOCK_RUNTIME_PATH}/battleye_runtime",
# nvidiaPrime
'DRI_PRIME': '1',
'__NV_PRIME_RENDER_OFFLOAD': '1',
Expand All @@ -317,7 +317,7 @@ def test_checkparameters_gog_linux(self):
}
# environmentOptions
expected_environment = expected_environment | MOCK_ENVIRONMENT
expected_arguments = ['eac_runtime', 'battleye_runtime', '/my/test/wrapper', '--my', '--test', '--args', 'mangohud', '--dlsym', 'gamemoderun', '/path/to/gog-dl', 'launch', '"/path/to/gog/game"', 'TestGameId', '--override-exe', '"/path/to/override/exe"', '--offline', '--platform=linux', 'launcherArgsValue']
expected_arguments = ['/my/test/wrapper', '--my', '--test', '--args', 'mangohud', '--dlsym', 'gamemoderun', '/path/to/gog-dl', 'launch', '"/path/to/gog/game"', 'TestGameId', '--override-exe', '"/path/to/override/exe"', '--offline', '--platform=linux', 'launcherArgsValue']
expected_cloudsync = "/path/to/gog-dl sync-saves --save-path \"/path/to/saves\" TestGameId -y"
actual_environment, actual_arguments, actual_cloudsync = checkparameters.checkparameters(
MOCK_APP_NAME, MOCK_GAME_JSON_PATH, "gog-linux")
Expand All @@ -342,9 +342,9 @@ def test_checkparameters_epic_wine_custom_libs(self):
# enableFsync
'WINEFSYNC': '1',
# eacRuntime
'PROTON_EAC_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_EAC_RUNTIME': f"{MOCK_RUNTIME_PATH}/eac_runtime",
# battlEyeRuntime
'PROTON_BATTLEYE_RUNTIME': MOCK_RUNTIME_PATH,
'PROTON_BATTLEYE_RUNTIME': f"{MOCK_RUNTIME_PATH}/battleye_runtime",
# nvidiaPrime
'DRI_PRIME': '1',
'__NV_PRIME_RENDER_OFFLOAD': '1',
Expand All @@ -357,7 +357,7 @@ def test_checkparameters_epic_wine_custom_libs(self):
}
# environmentOptions
expected_environment = expected_environment | MOCK_ENVIRONMENT
expected_arguments = ['eac_runtime', 'battleye_runtime', '/my/test/wrapper', '--my', '--test', '--args', 'mangohud', '--dlsym', 'gamemoderun', '/path/to/heroic', 'launch', 'TestGameId', '--override-exe', '"/path/to/override/exe"', '--offline', '--language', 'fr', '--wine-prefix', '"/path/to/TestGameId/pfx"', '--wine', '/path/to/game/wine/bin/wine', 'launcherArgsValue']
expected_arguments = ['/my/test/wrapper', '--my', '--test', '--args', 'mangohud', '--dlsym', 'gamemoderun', '/path/to/heroic', 'launch', 'TestGameId', '--override-exe', '"/path/to/override/exe"', '--offline', '--language', 'fr', '--wine-prefix', '"/path/to/TestGameId/pfx"', '--wine', '/path/to/game/wine/bin/wine', 'launcherArgsValue']
expected_cloudsync = "/path/to/heroic sync-saves --save-path \"/path/to/saves\" TestGameId -y"
actual_environment, actual_arguments, actual_cloudsync = checkparameters.checkparameters(
MOCK_APP_NAME, MOCK_GAME_JSON_PATH, "epic")
Expand Down

0 comments on commit cb86865

Please sign in to comment.