mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 22:31:18 +00:00
Split off mpmissions so there's always a pristine version of it in the server container, for when we merge XML.
Forget xmlmerge. Switch to xmlstarlet. Add the two shared objects required to get a release server running. This is just to get around having to host them/fish them up from elsewhere. Update docs.
This commit is contained in:
parent
2fc31fea37
commit
ebf961bb73
6 changed files with 49 additions and 41 deletions
|
@ -32,6 +32,7 @@ cd /serverfiles
|
||||||
mv DayZServer DayZServer.release
|
mv DayZServer DayZServer.release
|
||||||
wget https://cdn.discordapp.com/attachments/491622000935305217/1105089599983853698/DayZServer
|
wget https://cdn.discordapp.com/attachments/491622000935305217/1105089599983853698/DayZServer
|
||||||
chmod 755 DayZServer
|
chmod 755 DayZServer
|
||||||
|
cp /files/tmp/* .
|
||||||
exit
|
exit
|
||||||
docker compose exec server bash
|
docker compose exec server bash
|
||||||
dz start # Will start a vanilla Chernarus map
|
dz start # Will start a vanilla Chernarus map
|
||||||
|
|
|
@ -9,7 +9,9 @@ volumes:
|
||||||
serverfiles:
|
serverfiles:
|
||||||
# Server profile files
|
# Server profile files
|
||||||
profiles:
|
profiles:
|
||||||
# Server maps
|
# Upstream mission files
|
||||||
|
servermpmissions:
|
||||||
|
# Server mission files
|
||||||
mpmissions:
|
mpmissions:
|
||||||
# Mods
|
# Mods
|
||||||
mods:
|
mods:
|
||||||
|
@ -21,6 +23,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- homedir_main:/home/user
|
- homedir_main:/home/user
|
||||||
- serverfiles:/serverfiles
|
- serverfiles:/serverfiles
|
||||||
|
- servermpmissions:/serverfiles/mpmissions
|
||||||
- mods:/serverfiles/steamapps/workshop/content
|
- mods:/serverfiles/steamapps/workshop/content
|
||||||
- mods:/mods
|
- mods:/mods
|
||||||
- ./files:/files
|
- ./files:/files
|
||||||
|
@ -35,6 +38,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- homedir_server:/home/user
|
- homedir_server:/home/user
|
||||||
- serverfiles:/serverfiles
|
- serverfiles:/serverfiles
|
||||||
|
- servermpmissions:/mpmissions:ro
|
||||||
- mods:/mods
|
- mods:/mods
|
||||||
- mpmissions:/serverfiles/mpmissions
|
- mpmissions:/serverfiles/mpmissions
|
||||||
- profiles:/profiles
|
- profiles:/profiles
|
||||||
|
|
|
@ -14,7 +14,6 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-reco
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
gdb \
|
gdb \
|
||||||
git \
|
git \
|
||||||
gwenhywfar-tools \
|
|
||||||
jq \
|
jq \
|
||||||
libsdl2-2.0-0 \
|
libsdl2-2.0-0 \
|
||||||
libcap2 \
|
libcap2 \
|
||||||
|
@ -24,7 +23,8 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-reco
|
||||||
procps \
|
procps \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
strace \
|
strace \
|
||||||
wget
|
wget \
|
||||||
|
xmlstarlet
|
||||||
|
|
||||||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
|
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
|
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
|
||||||
|
|
|
@ -121,6 +121,7 @@ get_mods(){
|
||||||
workshoplist+=" +workshop_download_item "${release_client_appid}" "${ID}
|
workshoplist+=" +workshop_download_item "${release_client_appid}" "${ID}
|
||||||
mod_command_line+="@${MODNAME};"
|
mod_command_line+="@${MODNAME};"
|
||||||
done
|
done
|
||||||
|
# Remove the trailing semi-colon. This is necessary.
|
||||||
if [[ ${mod_command_line} != "" ]]
|
if [[ ${mod_command_line} != "" ]]
|
||||||
then
|
then
|
||||||
mod_command_line="-mod=${mod_command_line::-1}"
|
mod_command_line="-mod=${mod_command_line::-1}"
|
||||||
|
@ -143,6 +144,44 @@ report() {
|
||||||
echo -e "========================================== End log ======================================${default}"
|
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 '<?xml' ${WORKSHOP_DIR}/${ID}/${var,,}.xml
|
||||||
|
then
|
||||||
|
# When we have no XML or root node
|
||||||
|
echo "The file has no root node"
|
||||||
|
# xmlstarlet ed -s / -t elem -n "eventposdef" -m /event /eventposdef ${WORKSHOP_DIR}/${ID}/${var,,}.xml
|
||||||
|
fi
|
||||||
|
if ! grep -q '<?xml' ${WORKSHOP_DIR}/${ID}/${var,,}.xml
|
||||||
|
then
|
||||||
|
# When we have no XML node
|
||||||
|
else
|
||||||
|
# When it's normalized
|
||||||
|
xmlstarlet ed -s / -t elem -n "eventposdef" -m /event /eventposdef ${WORKSHOP_DIR}/${ID}/${var,,}.xml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
popd > /dev/null
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
# Start the server in the foreground
|
# Start the server in the foreground
|
||||||
start(){
|
start(){
|
||||||
# Do the report on exit. Set here so that it only happens once we're starting the server, and not for other actions.
|
# 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
|
report
|
||||||
' EXIT
|
' EXIT
|
||||||
get_mods
|
get_mods
|
||||||
|
mergexml
|
||||||
|
exit 0
|
||||||
cd ${SERVER_FILES}
|
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
|
# 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.
|
# safely shut the container down without killing the server within.
|
||||||
|
@ -262,44 +303,6 @@ activate(){
|
||||||
status
|
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
|
# Our internal RCON
|
||||||
rcon(){
|
rcon(){
|
||||||
exec /usr/local/py3rcon/py3rcon.py --gui ~/py3rcon.config.json
|
exec /usr/local/py3rcon/py3rcon.py --gui ~/py3rcon.config.json
|
||||||
|
|
BIN
tmp/libsteam_api.so
Executable file
BIN
tmp/libsteam_api.so
Executable file
Binary file not shown.
BIN
tmp/steamclient.so
Executable file
BIN
tmp/steamclient.so
Executable file
Binary file not shown.
Loading…
Add table
Reference in a new issue