-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlaunch.py
35 lines (31 loc) · 1.04 KB
/
launch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import subprocess
STABLE_BRANCH_APPID = "1874900"
EXPERIMENTAL_BRANCH_APPID = "1890870"
def select_branch() -> str:
"""
If USE_EXPERIMENTAL is set to true, use the Experimental Reforger server branch
"""
if os.environ["USE_EXPERIMENTAL"] == "true":
return EXPERIMENTAL_BRANCH_APPID
return STABLE_BRANCH_APPID
steamcmd = ["/home/reforger/steamcmd/steamcmd.sh"]
steamcmd.extend(["+force_install_dir", "/home/reforger/reforger_bins"])
steamcmd.extend(["+login", "anonymous"])
steamcmd.extend(["+app_update", select_branch()])
steamcmd.extend(["validate", "+quit"])
subprocess.call(steamcmd)
launch = " ".join(
[
"/home/reforger/reforger_bins/ArmaReforgerServer",
f"-config /home/reforger/configs/{os.environ['CONFIG']}.json",
"-createDB",
"-nothrow",
f"-maxFPS {os.environ['MAX_FPS']}",
f"-profile /home/reforger/profile",
f"-addonDownloadDir /home/reforger/workshop",
f"-addonsDir /home/reforger/workshop"
]
)
print(launch, flush=True)
os.system(launch)