Handle different variants of types files.

Add map name to status output.
This commit is contained in:
Daniel Ceregatti 2023-03-30 10:21:20 -07:00
parent f79a13ae92
commit fec061e8ff

View file

@ -22,10 +22,11 @@ magenta="\e[35m"
cyan="\e[36m" cyan="\e[36m"
# DayZ release server Steam app ID. Presumably once the Linux server is released, the binaries will come # DayZ release server Steam app ID. Presumably once the Linux server is released, the binaries will come
# from this ID # from this ID. Let's find out!
#release_server_appid=223350 release_server_appid=223350
# For now, use the experimental server app id # For now, use the experimental server app id
release_server_appid=1042420 #release_server_appid=1042420
# DayZ release client SteamID. This is for mods, as only the release client has them. # DayZ release client SteamID. This is for mods, as only the release client has them.
release_client_appid=221100 release_client_appid=221100
@ -293,7 +294,7 @@ install(){
dologin dologin
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${release_server_appid}" validate +quit ${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" +app_update "${release_server_appid}" validate +quit
else else
printf "[ ${lightblue}DayZ${default} ] The Server is already installed.\n" printf "[ ${lightblue}DayZ${default} ] The server is already installed.\n"
fi fi
} }
@ -384,6 +385,7 @@ modupdate(){
get_mods get_mods
echo "Updating mods..." echo "Updating mods..."
dologin dologin
# echo ${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" ${workshoplist} +quit
${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" ${workshoplist} +quit ${STEAMCMD} +force_install_dir ${SERVER_FILES} +login "${steamlogin}" ${workshoplist} +quit
# Updated files come in with mixed cases. Fix that. # Updated files come in with mixed cases. Fix that.
echo -ne "\nFixing file names..." echo -ne "\nFixing file names..."
@ -567,30 +569,22 @@ mod_cmd(){
} }
checkTypesXML(){ checkTypesXML(){
# See if this mod has an extras/types.xml. If so, manage it. # See if this mod has a types.xml. If so, manage it.
if [ -f "${workshopfolder}/${1}/extras/types.xml" ] for path in "${workshopfolder}/${1}/extras" "${workshopfolder}/${1}" "/files/mods/${1}"
then do
echo -n "The mod id ${1} has an extras/types.xml. " if [ -f "${path}/types.xml" ]
if [[ ${2} = "install" ]]
then then
echo "Merging to missions..." echo -n "The mod id ${1} has a types.xml: ${path}/types.xml. "
else if [[ ${2} = "install" ]]
echo "Removing contents from missions..." then
echo "Merging to missions..."
else
echo "Removing contents from missions..."
fi
/files/mods/types.sh ${1} ${2} ${path}/types.xml
break
fi fi
/files/mods/types.sh ${1} ${2} done
fi
# Also see if there's a symlink to some other file that serves the same purpose, but named differently
if [ -s "/files/mods/${1}/types.xml" ]
then
echo -n "The mod id ${1} has a types.xml symlink. "
if [[ ${2} = "install" ]]
then
echo "Merging to missions..."
else
echo "Removing contents from missions..."
fi
/files/mods/types.sh ${1} ${2} /files/mods/${1}/types.xml
fi
} }
checkInstall(){ checkInstall(){
@ -600,6 +594,14 @@ checkInstall(){
echo "An ${2}.sh was found for mod id ${1}. Running..." echo "An ${2}.sh was found for mod id ${1}. Running..."
/files/mods/${1}/${2}.sh /files/mods/${1}/${2}.sh
fi fi
# A generic map install script. Presumes a git repo as the source
if [ -f /files/mods/${1}/install.env ]
then
echo "An ${2}.env was found for mod id ${1}. Performing ${2}..."
source /files/mods/${1}/install.env
/files/mods/install.sh ${1} ${2}
fi
} }
# Our internal RCON # Our internal RCON
rcon(){ rcon(){
@ -658,8 +660,9 @@ Mods:
echo -e " echo -e "
Server running: ${RUNNING} Server running: ${RUNNING}
Working parameters: ${parameters} Working parameters: ${parameters}
Working mod parameter: ${mod_command_line} Working mod parameter: ${mod_command_line}"
" MAP=$(grep template ${SERVER_CFG_DST} | grep -v "^//" | cut -d= -f2 | cut -d\; -f1)
echo "Map: ${MAP}"
} }
backup(){ backup(){