diff --git a/README.md b/README.md index ff5930d..fe7b767 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ cd /serverfiles mv DayZServer DayZServer.release wget https://cdn.discordapp.com/attachments/491622000935305217/1105089599983853698/DayZServer chmod 755 DayZServer +cp /files/tmp/* . exit docker compose exec server bash dz start # Will start a vanilla Chernarus map diff --git a/docker-compose.yml b/docker-compose.yml index f7744f9..beeb78e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,9 @@ volumes: serverfiles: # Server profile files profiles: - # Server maps + # Upstream mission files + servermpmissions: + # Server mission files mpmissions: # Mods mods: @@ -21,6 +23,7 @@ services: volumes: - homedir_main:/home/user - serverfiles:/serverfiles + - servermpmissions:/serverfiles/mpmissions - mods:/serverfiles/steamapps/workshop/content - mods:/mods - ./files:/files @@ -35,6 +38,7 @@ services: volumes: - homedir_server:/home/user - serverfiles:/serverfiles + - servermpmissions:/mpmissions:ro - mods:/mods - mpmissions:/serverfiles/mpmissions - profiles:/profiles diff --git a/server/Dockerfile b/server/Dockerfile index 426f7aa..bd9b4c7 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -14,7 +14,6 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-reco ca-certificates \ gdb \ git \ - gwenhywfar-tools \ jq \ libsdl2-2.0-0 \ libcap2 \ @@ -24,7 +23,8 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-reco procps \ python3-pip \ strace \ - wget + wget \ + xmlstarlet RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 diff --git a/server/bin/dz b/server/bin/dz index 7074a96..3d78926 100755 --- a/server/bin/dz +++ b/server/bin/dz @@ -121,6 +121,7 @@ get_mods(){ workshoplist+=" +workshop_download_item "${release_client_appid}" "${ID} mod_command_line+="@${MODNAME};" done + # Remove the trailing semi-colon. This is necessary. if [[ ${mod_command_line} != "" ]] then mod_command_line="-mod=${mod_command_line::-1}" @@ -143,6 +144,44 @@ report() { echo -e "========================================== End log ======================================${default}" } +mergexml(){ + # Start with the upstream XML files from a pristine mpmissions directory + echo "Copying upstream XML files from mpmissions..." + pushd /mpmissions > /dev/null + for var in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES + do + find -name "${var,,}.xml" -exec cp -vf {} ${SERVER_FILES}/mpmissions/{} \; + done + for link in $(ls -tdr ${SERVER_PROFILE}/@* 2> /dev/null) + do + ID=$(readlink ${link} | awk -F/ '{print $NF}') + MODNAME=$(get_mod_name ${ID}) +# for var in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES + for var in EVENTS TYPES + do + if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ] + then + echo "Merging ${WORKSHOP_DIR}/${ID}/${var,,}.xml..." + if ! grep -q ' /dev/null + exit 0 +} + # Start the server in the foreground start(){ # Do the report on exit. Set here so that it only happens once we're starting the server, and not for other actions. @@ -150,6 +189,8 @@ start(){ report ' EXIT get_mods + mergexml + exit 0 cd ${SERVER_FILES} # Run the server. Allow docker to restart the container if the script exits with a code other than 0. This is so we can # safely shut the container down without killing the server within. @@ -262,44 +303,6 @@ activate(){ status } -checkXML(){ - # See if we have a template for it - if [ -f "/files/mods/${1}/types.env" ] - then - echo "Found a templatate for mod ID ${1}, merging..." - source "/files/mods/${1}/types.env" - for xml in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES - do - NAME=$(echo ${xml} | tr A-Z a-z) - if echo ${!xml} | grep -q http - then - echo "${NAME} file is remote, downloading..." - curl -o ${WORKSHOP_DIR}/${1}/${NAME}.xml ${!xml} - else - echo "${NAME} file is in the mod, copying..." - cp -vf ${!xml} ${WORKSHOP_DIR}/${1}/${NAME}.xml - fi - done -# else - # See if this mod has a types.xml in the "standard" locations -# for path in "${WORKSHOP_DIR}/${1}/extras" "${WORKSHOP_DIR}/${1}" -# do -# if [ -f "${path}/types.xml" ] -# then -# echo -n "The mod id ${1} has a types.xml: ${path}/types.xml. " -# if [[ ${2} = "install" ]] -# then -# echo "Merging to missions..." -# else -# echo "Removing contents from missions..." -# fi -# /files/mods/types.sh ${1} ${2} ${path}/types.xml -# break -# fi -# done - fi -} - # Our internal RCON rcon(){ exec /usr/local/py3rcon/py3rcon.py --gui ~/py3rcon.config.json diff --git a/tmp/libsteam_api.so b/tmp/libsteam_api.so new file mode 100755 index 0000000..10b6385 Binary files /dev/null and b/tmp/libsteam_api.so differ diff --git a/tmp/steamclient.so b/tmp/steamclient.so new file mode 100755 index 0000000..6f49323 Binary files /dev/null and b/tmp/steamclient.so differ