mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
fix: interpolate client args
This commit is contained in:
1 parent
5e0e6e4592
commit
3857b69b70
2 files changed
+7
-4
No files matched your search
+5
-3
@@ -8,6 +8,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from dzgui.const.constants import APP_NAME
|
from dzgui.const.constants import APP_NAME
|
||||||
from dzgui.const.endpoints import STEAM_PUBLISHED_FILES
|
from dzgui.const.endpoints import STEAM_PUBLISHED_FILES
|
||||||
|
from dzgui.util.bash import concat_bash_args
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(APP_NAME)
|
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,
|
# TODO: set config to name=user, use official server and no mods,
|
||||||
# ensure that formatted string is identical to fixture with same hash
|
# 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)
|
concat = concat_mods(mods)
|
||||||
|
client_args = concat_bash_args(client)
|
||||||
|
# TODO: test flatpak arg expansion
|
||||||
params = [
|
params = [
|
||||||
"steam",
|
|
||||||
"-applaunch",
|
"-applaunch",
|
||||||
str(appid),
|
str(appid),
|
||||||
f"-connect={addr}",
|
f"-connect={addr}",
|
||||||
@@ -102,7 +104,7 @@ def connect(addr: str, appid: int, name: str, mods: list[str]) -> int:
|
|||||||
f"-name={name}",
|
f"-name={name}",
|
||||||
f"-mod={concat}",
|
f"-mod={concat}",
|
||||||
]
|
]
|
||||||
proc = subprocess.run([*params])
|
proc = subprocess.run([*client_args, *params])
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -246,7 +246,8 @@ class ConnectionManager:
|
|||||||
def _connect_steam(self) -> None:
|
def _connect_steam(self) -> None:
|
||||||
addr = f"{self.record.ip}:{self.record.gameport}"
|
addr = f"{self.record.ip}:{self.record.gameport}"
|
||||||
playername = self.controller.query_config(Preferences.NAME)
|
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:
|
if rc != 0:
|
||||||
# TODO: log/pop the error
|
# TODO: log/pop the error
|
||||||
func = StoredFunc(self.controller.update_status)
|
func = StoredFunc(self.controller.update_status)
|
||||||
|
|||||||
Reference in new issue
Block a user