Skip to content

Commit

Permalink
enable depot download (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson authored Mar 9, 2024
1 parent 0812ed0 commit a08ee4b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ENV HEADLESS_CLIENTS_PROFILE="\$profile-hc-\$i"
ENV PORT=2302
ENV STEAM_BRANCH=public
ENV STEAM_BRANCH_PASSWORD=
ENV STEAM_ADDITIONAL_DEPOT=
ENV MODS_LOCAL=true
ENV MODS_PRESET=
ENV SKIP_INSTALL=false
Expand All @@ -51,6 +52,13 @@ EXPOSE 2306/udp
WORKDIR /arma3

VOLUME /steamcmd
VOLUME /arma3/addons
VOLUME /arma3/enoch
VOLUME /arma3/expansion
VOLUME /arma3/jets
VOLUME /arma3/heli
VOLUME /arma3/orange
VOLUME /arma3/argo

STOPSIGNAL SIGINT

Expand Down
23 changes: 22 additions & 1 deletion launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import shutil
import subprocess
from string import Template

Expand Down Expand Up @@ -34,9 +35,29 @@ def env_defined(key):
steamcmd.extend(["-beta", os.environ["STEAM_BRANCH"]])
if env_defined("STEAM_BRANCH_PASSWORD"):
steamcmd.extend(["-betapassword", os.environ["STEAM_BRANCH_PASSWORD"]])
steamcmd.extend(["validate", "+quit"])
steamcmd.extend(["validate"])
if env_defined("STEAM_ADDITIONAL_DEPOT"):
for depot in os.environ["STEAM_ADDITIONAL_DEPOT"].split("|"):
depot_parts = depot.split(",")
steamcmd.extend(
["+login", os.environ["STEAM_USER"], os.environ["STEAM_PASSWORD"]]
)
steamcmd.extend(
["+download_depot", "233780", depot_parts[0], depot_parts[1]]
)
steamcmd.extend(["+quit"])
subprocess.call(steamcmd)

if env_defined("STEAM_ADDITIONAL_DEPOT"):
for depot in os.environ["STEAM_ADDITIONAL_DEPOT"].split("|"):
depot_parts = depot.split(",")
depot_dir = (
f"/steamcmd/linux32/steamapps/content/app_233780/depot_{depot_parts[0]}/"
)
for file in os.listdir(depot_dir):
shutil.copytree(depot_dir + file, "/arma3/", dirs_exist_ok=True)
print(f"Moved {file} to /arma3")

# Mods

mods = []
Expand Down

0 comments on commit a08ee4b

Please sign in to comment.