Compare commits

...

8 Commits

Author SHA1 Message Date
ae95e1b037 fixed rename mods [CI SKIP] 2022-09-18 21:42:55 +02:00
d6ec41c269 fixed exclude
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-15 13:34:56 +02:00
03a471cd0f added mod exclude
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-15 13:28:44 +02:00
725af3fcbd no simlink for missions
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-05 18:00:37 +02:00
3b67e47cb6 improved mod download script
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-30 16:05:41 +02:00
f91d8b3580 link mission dir 2022-08-30 16:05:20 +02:00
f0e49e981b added drone file
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-29 13:53:29 +02:00
209a23db16 renamed port and fps parameter 2022-08-29 13:53:17 +02:00
6 changed files with 60 additions and 19 deletions

15
.drone.yml Normal file
View File

@@ -0,0 +1,15 @@
type: docker
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
repo: djeeberjr/arma3
username: djeeberjr
password:
from_secret: DOCKER_HUB_TOKEN
trigger:
branch:
- master

View File

@@ -12,8 +12,9 @@ RUN mkdir -p /home/steam/server && \
USER steam
VOLUME /home/steam/server
VOLUME /home/steam/server/mpmissions
# VOLUME /home/steam/volumes/missions
VOLUME /home/steam/volumes/config
VOLUME /home/steam/volumes/missions
VOLUME /home/steam/volumes/mods
VOLUME /home/steam/volumes/servermods

View File

@@ -6,6 +6,8 @@ Use the `downloadMods.sh` to download mods to a volume.
# Environment variables
`PORT` - Port to listen on. default: 2302
`LIMIT_FPS` - Limit the fps of the server
`STEAM_USER` - Steam username
`STEAM_PASSWORD` - Steam password
`WORKSHOP_COLLECTION` - id of a steam workshop collection. Used to load mods

View File

@@ -8,6 +8,7 @@ services:
STEAM_USER: testo
STEAM_PASSWORD: testo
WORKSHOP_COLLECTION: 1400118996
MOD_EXCLUDE: 667953829,1210050323,925018569,837729515,2041057379
volumes:
- arma3_dev_game:/home/steam/server
- arma3_dev_mods:/home/steam/volumes/mods

View File

@@ -15,15 +15,15 @@ PAYLOAD=$(cat <<EOF
set -e
WORKSHOP_DIR="/home/steam/Steam/steamapps/workshop/content"
MOD_DIR="\$WORKSHOP_DIR/107410"
mkdir -p \$WORKSHOP_DIR
rm -rf \$WORKSHOP_DIR/content
ln -s /home/steam/mount "\$WORKSHOP_DIR/107410"
ln -s /home/steam/mount "\$MOD_DIR"
echo -n "Username: "
read username
echo "Perform initial login. Exit after successfull login. To login type login username"
echo "Perform initial login."
/home/steam/steamcmd/steamcmd.sh +login \$username +quit
@@ -40,14 +40,25 @@ do
echo "quit";
} > "\$tmpFile"
echo "Downloading mod \$mod_id"
echo "### DOWNLOADING MOD \$mod_id ###"
until /home/steam/steamcmd/steamcmd.sh +runscript "\$tmpFile"; do echo -e "###\nLets try that again\n###"; done
echo -e "###\nDownload finished\n###"
echo "### DOWNLOAD FINISHED ###"
done
echo "### FIX CASE ###"
IFS=\$'\n'
for SRC in \$(find "\$MOD_DIR/" -depth -type f -name '*.pbo' -o -type f -name '*.bisign')
do
DST=\$(dirname "\${SRC}")/\$(basename "\${SRC}" | tr '\[A-Z\]' '\[a-z\]')
if [ "\${SRC}" != "\${DST}" ]
then
[ ! -e "\${DST}" ] && mv -vT "\${SRC}" "\${DST}"
fi
done
# for f in \$(find /home/steam/mount -type f -name '*.pbo' -o -type f -name '*.bisign'); do mv -v "\$f" "\$(echo \$f | tr '[A-Z]' '[a-z]')"; done
EOF
)

View File

@@ -34,12 +34,12 @@ fi
# https://community.bistudio.com/wiki/Arma_3:_Startup_Parameters#Server_Options
SERVER_ARGS="-name server -config=$VOLUME_HOME/config/config.cfg -profiles=$VOLUME_HOME/config/profiles"
if [ -n "$A3_LIMIT_FPS" ]; then
SERVER_ARGS="${SERVER_ARGS} -limitFPS=${A3_LIMIT_FPS}"
if [ -n "$LIMIT_FPS" ]; then
SERVER_ARGS="${SERVER_ARGS} -limitFPS=${LIMIT_FPS}"
fi
if [ -n "$A3_PORT" ]; then
SERVER_ARGS="${SERVER_ARGS} -port=${A3_PORT}"
if [ -n "$PORT" ]; then
SERVER_ARGS="${SERVER_ARGS} -port=${PORT}"
fi
#
@@ -51,9 +51,13 @@ mkdir -p "$MOD_LINK_DIR"
rm -f "$MOD_LINK_DIR"/*
MODS_TO_LOAD=""
MOD_EXCLUDE=${MOD_EXCLUDE:=""}
for mod_id in $(curl -s "https://steamcommunity.com/sharedfiles/filedetails/?id=$WORKSHOP_COLLECTION" | grep -E 'id="sharedfile_[0-9]+"' | sed 's/.*id="sharedfile_\([0-9]\+\)".*/\1/')
do
# Check if mod is excluded
if [[ "$MOD_EXCLUDE" != *"$mod_id"* ]]; then
# Check if directory exists
if [ ! -d "$VOLUME_HOME/mods/$mod_id" ]; then
echo "Could not find mod directory for $mod_id"
@@ -63,12 +67,19 @@ do
ln -s "$VOLUME_HOME/mods/$mod_id" "$MOD_LINK_DIR/$mod_id"
MODS_TO_LOAD="${MODS_TO_LOAD}mods/${mod_id};"
fi
done
if [ -n "$MODS_TO_LOAD" ]; then
SERVER_ARGS="${SERVER_ARGS} -mod=${MODS_TO_LOAD::-1}"
fi
#
# LINK MISSIONS
#
# rm -r /home/steam/server/mpmissions
# ln -s "$VOLUME_HOME/missions" "/home/steam/server/mpmissions"
# SERVER_ARGS="${SERVER_ARGS} -serverMod=${SERVER_MODS}"