fix: use absolute paths in Arma 3 launch args to survive cwd change

Arma 3 changes its own working directory to the exe folder on startup,
so relative paths like -config=server.cfg resolved against A3Master/
instead of the server data dir. Configs were never found, and profile/
battleye dirs pointed at the wrong location (confirmed via RPT location
in A3Master/server/ instead of the data dir).

build_launch_args() now accepts an optional server_dir: Path argument.
When provided, all four path args (-config, -cfg, -profiles, -bepath)
use absolute paths. Service passes server_dir at the call site.
This commit is contained in:
Tran G. (Revernomad) Khoa
2026-04-20 11:13:18 +07:00
parent d45345a094
commit 6e9a37ef00
2 changed files with 21 additions and 5 deletions

View File

@@ -274,7 +274,7 @@ class ServerService:
# Build launch args
try:
launch_args = config_gen.build_launch_args(raw_sections, mod_args)
launch_args = config_gen.build_launch_args(raw_sections, mod_args, server_dir=server_dir)
except LaunchArgsError as e:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,