mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 10:17:31 +02:00
fix: interpolate client args
This commit is contained in:
parent
5e0e6e4592
commit
3857b69b70
@ -8,6 +8,7 @@ from pathlib import Path
|
||||
|
||||
from dzgui.const.constants import APP_NAME
|
||||
from dzgui.const.endpoints import STEAM_PUBLISHED_FILES
|
||||
from dzgui.util.bash import concat_bash_args
|
||||
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
@ -89,10 +90,11 @@ def get_remote_signatures(mods: list[str]) -> list[tuple[str, str, int, int]]:
|
||||
|
||||
# TODO: set config to name=user, use official server and no mods,
|
||||
# ensure that formatted string is identical to fixture with same hash
|
||||
def connect(addr: str, appid: int, name: str, mods: list[str]) -> int:
|
||||
def connect(client: str, addr: str, appid: int, name: str, mods: list[str]) -> int:
|
||||
concat = concat_mods(mods)
|
||||
client_args = concat_bash_args(client)
|
||||
# TODO: test flatpak arg expansion
|
||||
params = [
|
||||
"steam",
|
||||
"-applaunch",
|
||||
str(appid),
|
||||
f"-connect={addr}",
|
||||
@ -102,7 +104,7 @@ def connect(addr: str, appid: int, name: str, mods: list[str]) -> int:
|
||||
f"-name={name}",
|
||||
f"-mod={concat}",
|
||||
]
|
||||
proc = subprocess.run([*params])
|
||||
proc = subprocess.run([*client_args, *params])
|
||||
return proc.returncode
|
||||
|
||||
|
||||
|
||||
@ -246,7 +246,8 @@ class ConnectionManager:
|
||||
def _connect_steam(self) -> None:
|
||||
addr = f"{self.record.ip}:{self.record.gameport}"
|
||||
playername = self.controller.query_config(Preferences.NAME)
|
||||
rc = connect(addr, self.appid, playername, self.remote_mod_ids)
|
||||
client = self.controller.query_config(Preferences.CLIENT)
|
||||
rc = connect(client, addr, self.appid, playername, self.remote_mod_ids)
|
||||
if rc != 0:
|
||||
# TODO: log/pop the error
|
||||
func = StoredFunc(self.controller.update_status)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user