Skip to content

Commit 6390c3a

Browse files
Merge branch 'main' into launch-with-subprocess
2 parents 0d4736f + d034649 commit 6390c3a

4 files changed

Lines changed: 80 additions & 27 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ENV GAME_ADMINS=""
6262
ENV GAME_SCENARIO_ID="{ECC61978EDCC2B5A}Missions/23_Campaign.conf"
6363
ENV GAME_MAX_PLAYERS=32
6464
ENV GAME_VISIBLE=true
65-
ENV GAME_SUPPORTED_PLATFORMS=PLATFORM_PC,PLATFORM_XBL
65+
ENV GAME_SUPPORTED_PLATFORMS=PLATFORM_PC,PLATFORM_XBL,PLATFORM_PSN
6666
ENV GAME_PROPS_BATTLEYE=true
6767
ENV GAME_PROPS_DISABLE_THIRD_PERSON=false
6868
ENV GAME_PROPS_FAST_VALIDATION=true

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
version: '3.8'
32
services:
43
arma-reforger:
54
image: ghcr.io/acemod/arma-reforger:latest

docker_default.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,21 @@
1919
"passwordAdmin": "",
2020
"admins": [],
2121
"scenarioId": "{ECC61978EDCC2B5A}Missions/23_Campaign.conf",
22-
"maxPlayers": 32,
22+
"maxPlayers": 64,
2323
"visible": true,
2424
"supportedPlatforms": [
2525
"PLATFORM_PC",
26-
"PLATFORM_XBL"
26+
"PLATFORM_XBL",
27+
"PLATFORM_PSN"
2728
],
2829
"gameProperties": {
29-
"serverMaxViewDistance": 2500,
30-
"serverMinGrassDistance": 50,
31-
"networkViewDistance": 1000,
32-
"disableThirdPerson": true,
30+
"serverMaxViewDistance": 1600,
31+
"serverMinGrassDistance": 0,
32+
"networkViewDistance": 1500,
33+
"disableThirdPerson": false,
3334
"fastValidation": true,
3435
"battlEye": true,
35-
"missionHeader": {
36-
"m_iPlayerCount": 40,
37-
"m_eEditableGameFlags": 6,
38-
"m_eDefaultGameFlags": 6
39-
}
36+
"missionHeader": {}
4037
},
4138
"mods": []
4239
}

launch.py

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import signal
77
import subprocess
88
import sys
9+
from pathlib import Path
910

1011
# On SIGTERM, raise KeyboardInterrupt instead of exiting abruptly.
1112
signal.signal(signal.SIGTERM, signal.default_int_handler)
@@ -30,22 +31,78 @@ def bool_str(text):
3031
return text.lower() == "true"
3132

3233

34+
SENTINEL_WINDOWS_FIX = "/reforger/.windows_fix_done"
35+
36+
# Clear Windows fix sentinel if switching away from experimental appId
37+
if Path(SENTINEL_WINDOWS_FIX).exists() and os.environ["STEAM_APPID"] != "1890870":
38+
Path(SENTINEL_WINDOWS_FIX).unlink()
39+
3340
if os.environ["SKIP_INSTALL"] in ["", "false"]:
34-
steamcmd = ["/steamcmd/steamcmd.sh"]
35-
steamcmd.extend(["+force_install_dir", "/reforger"])
36-
if env_defined("STEAM_USER"):
37-
steamcmd.extend(
38-
["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]]
39-
)
41+
# Special handling for experimental appId 1890870
42+
if os.environ["STEAM_APPID"] == "1890870":
43+
# We only need the Windows pass once to work around this bug. On subsequent
44+
# launches just perform the normal Linux update so we don't waste bandwidth.
45+
run_windows_pass = not Path(SENTINEL_WINDOWS_FIX).exists()
46+
47+
subprocess.call(["/steamcmd/steamcmd.sh", "+login", "anonymous", "+quit"])
48+
49+
if run_windows_pass:
50+
steamcmd_win = ["/steamcmd/steamcmd.sh"]
51+
steamcmd_win.extend(["+force_install_dir", "/reforger"])
52+
if env_defined("STEAM_USER"):
53+
steamcmd_win.extend(
54+
["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]]
55+
)
56+
else:
57+
steamcmd_win.extend(["+login", "anonymous"])
58+
steamcmd_win.extend(["+@sSteamCmdForcePlatformType", "windows"])
59+
steamcmd_win.extend(["+app_update", os.environ["STEAM_APPID"]])
60+
if env_defined("STEAM_BRANCH"):
61+
steamcmd_win.extend(["-beta", os.environ["STEAM_BRANCH"]])
62+
if env_defined("STEAM_BRANCH_PASSWORD"):
63+
steamcmd_win.extend(
64+
["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]]
65+
)
66+
steamcmd_win.extend(["validate", "+quit"])
67+
subprocess.call(steamcmd_win)
68+
Path(SENTINEL_WINDOWS_FIX).touch()
69+
70+
# Install with Linux platform
71+
steamcmd_linux = ["/steamcmd/steamcmd.sh"]
72+
steamcmd_linux.extend(["+force_install_dir", "/reforger"])
73+
if env_defined("STEAM_USER"):
74+
steamcmd_linux.extend(
75+
["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]]
76+
)
77+
else:
78+
steamcmd_linux.extend(["+login", "anonymous"])
79+
steamcmd_linux.extend(["+@sSteamCmdForcePlatformType", "linux"])
80+
steamcmd_linux.extend(["+app_update", os.environ["STEAM_APPID"]])
81+
if env_defined("STEAM_BRANCH"):
82+
steamcmd_linux.extend(["-beta", os.environ["STEAM_BRANCH"]])
83+
if env_defined("STEAM_BRANCH_PASSWORD"):
84+
steamcmd_linux.extend(
85+
["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]]
86+
)
87+
steamcmd_linux.extend(["validate", "+quit"])
88+
subprocess.call(steamcmd_linux)
4089
else:
41-
steamcmd.extend(["+login", "anonymous"])
42-
steamcmd.extend(["+app_update", os.environ["STEAM_APPID"]])
43-
if env_defined("STEAM_BRANCH"):
44-
steamcmd.extend(["-beta", os.environ["STEAM_BRANCH"]])
45-
if env_defined("STEAM_BRANCH_PASSWORD"):
46-
steamcmd.extend(["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]])
47-
steamcmd.extend(["validate", "+quit"])
48-
subprocess.call(steamcmd)
90+
# Standard installation for other appIds
91+
steamcmd = ["/steamcmd/steamcmd.sh"]
92+
steamcmd.extend(["+force_install_dir", "/reforger"])
93+
if env_defined("STEAM_USER"):
94+
steamcmd.extend(
95+
["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]]
96+
)
97+
else:
98+
steamcmd.extend(["+login", "anonymous"])
99+
steamcmd.extend(["+app_update", os.environ["STEAM_APPID"]])
100+
if env_defined("STEAM_BRANCH"):
101+
steamcmd.extend(["-beta", os.environ["STEAM_BRANCH"]])
102+
if env_defined("STEAM_BRANCH_PASSWORD"):
103+
steamcmd.extend(["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]])
104+
steamcmd.extend(["validate", "+quit"])
105+
subprocess.call(steamcmd)
49106

50107
if os.environ["ARMA_CONFIG"] != "docker_generated":
51108
config_path = f"/reforger/Configs/{os.environ['ARMA_CONFIG']}"

0 commit comments

Comments
 (0)