Add custom integration for disabling the personal light. This gets turned on despite what's set in serverDZ.cfg because it's overridden in cfggameplay.json.

Add wipe command, to allow for easy wiping of storage.
Remove cfggameplay case-sensitivity hack, now that this is fixed upstream.
Continue documenting the vanilla installation instructions for Hype Train, for some reason.
This commit is contained in:
Daniel Ceregatti 2024-01-18 11:40:19 -08:00
parent cd308e1f96
commit 5918646eb0
4 changed files with 62 additions and 39 deletions

View file

@ -0,0 +1,5 @@
{
"PlayerData": {
"disablePersonalLight": true
}
}

View file

@ -5,19 +5,26 @@
The files used to integrate the [HypeTrain mod](https://steamcommunity.com/sharedfiles/filedetails/?id=3115714092) came from The files used to integrate the [HypeTrain mod](https://steamcommunity.com/sharedfiles/filedetails/?id=3115714092) came from
[here](https://steamcommunity.com/workshop/filedetails/discussion/3115714092/4032475029247848861/). [here](https://steamcommunity.com/workshop/filedetails/discussion/3115714092/4032475029247848861/).
## Goals
To spawn exactly one large complete train (7-8 cars) somewhere in Chernarus, in one of many possible locations, and having all cars persist
Later, to spwan exactly one smaller train in the same manner as above, but then to spawn in more cars over time, in random places.
## Mod Integration Files ## Mod Integration Files
5 files are required to run the mod. Two are map-specific and the rest are common to all maps: 5 files are required to run the mod. Two are map-specific and the rest are common to all maps:
These are map-specific. The ones included in this repository is for Chernarus. These are map-specific. The ones included in this repository are for Chernarus:
* `cfgeventgroups.xml`
* `cfgeventspawns.xml` * `cfgeventgroups.xml` - Defines "sets of trains", one for every possible spawn point.
* `cfgeventspawns.xml` - The possible spawn point locations within Chernarus.
These files are commong to all maps: These files are commong to all maps:
* `cfgspawnabletypes.xml` * `cfgspawnabletypes.xml` -
* `events.xml` * `events.xml` - An event that spawns a complete train
* `types.xml` * `types.xml` - All types from the mod.
The `start.sh` script is for doing extra stuff, but programatically. See the comments within it for details. The `start.sh` script is for doing extra stuff, but programatically. See the comments within it for details.

View file

@ -1,4 +1,4 @@
hostname = "Hype Train mod testing"; // Server name hostname = "DayZ on Linux for Linux"; // Server name
password = ""; // Password to connect to the server password = ""; // Password to connect to the server
passwordAdmin = ""; // Password to become a server admin passwordAdmin = ""; // Password to become a server admin

View file

@ -48,6 +48,7 @@ Options and arguments:
r|restart - Restart the server without restarting the container r|restart - Restart the server without restarting the container
s|status - Shows the server's status: Running, uptime, mods, parameters, mod parameter, etc. s|status - Shows the server's status: Running, uptime, mods, parameters, mod parameter, etc.
stop - Stop the server stop - Stop the server
w|wipe - Wipes the current storage_1
${default}" ${default}"
exit 1 exit 1
} }
@ -147,9 +148,6 @@ mergexml(){
-o -name "init.c" \ -o -name "init.c" \
\) -exec cp -v {} ${SERVER_FILES}{} \; \) -exec cp -v {} ${SERVER_FILES}{} \;
# FIXME!!! HACK to account for cfgGameplay mixed case
cp ${MPMISSIONS}/${MAP}/cfggameplay.json ${MPMISSIONS}/${MAP}/cfgGameplay.json
# Follow https://community.bistudio.com/wiki/DayZ:Central_Economy_mission_files_modding # Follow https://community.bistudio.com/wiki/DayZ:Central_Economy_mission_files_modding
# Remove any existing files, via the mod_ and custom_ prefixes # Remove any existing files, via the mod_ and custom_ prefixes
rm -rf ${MPMISSIONS}/${MAP}/mod_* rm -rf ${MPMISSIONS}/${MAP}/mod_*
@ -226,11 +224,8 @@ mergexml(){
fi fi
echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'"
rm -f /tmp/x /tmp/y rm -f /tmp/x /tmp/y
# FIXME: This is a hack to fix the JSON file, as it expects mixed case jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x
jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/cfgGameplay.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json
# jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/wtf
# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
fi fi
done done
# These are merged directly into the upstream file, but are C # These are merged directly into the upstream file, but are C
@ -324,10 +319,8 @@ mergexml(){
fi fi
echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'"
rm -f /tmp/x /tmp/y rm -f /tmp/x /tmp/y
jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/cfgGameplay.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x
mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
# jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x
# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
fi fi
done done
if [[ ${FOUND} = 1 ]] if [[ ${FOUND} = 1 ]]
@ -539,8 +532,7 @@ status(){
D=$(date +%s) D=$(date +%s)
F=$(date +%s -r ${SERVER_PROFILE}/server_console.log) F=$(date +%s -r ${SERVER_PROFILE}/server_console.log)
DAYS=$(( (${D} - ${F}) / 86400 )) DAYS=$(( (${D} - ${F}) / 86400 ))
# UPTIME=$(date --date="$(( ${D} - ${F} ))" +"${DAYS} days %H:%M:%S") UPTIME="${DAYS} days "$(date -d@$(($(date +%s) - $(date +%s -r ${SERVER_PROFILE}/server.pid))) -u +"%H hours %M minutes %S seconds")
UPTIME="${DAYS} days "$(date -d@$(($(date +%s) - $(date +%s -r ${SERVER_PROFILE}/server_console.log))) -u +"%H hours %M minutes %S seconds")
RUNNING="${YES}\nUptime: ${green}${UPTIME}${default}" RUNNING="${YES}\nUptime: ${green}${UPTIME}${default}"
# Current parameters # Current parameters
@ -584,6 +576,22 @@ backup(){
cp -a /profiles ${B} cp -a /profiles ${B}
} }
wipe(){
DIR="${MPMISSIONS}/${MAP}/storage_1"
if ! [ -d "${DIR}" ]
then
echo "Storage directory ${DIR} does not exist"
return
fi
if prompt_yn "Wipe server storage directory '${DIR}'?"
then
rm -rf "${DIR}"
echo "Storage ${DIR} removed"
else
echo "Storage directory ${DIR} NOT removed..."
fi
}
MAP=$(get_map_name) MAP=$(get_map_name)
# Capture the first argument and shift it off so we can pass $@ to every function # Capture the first argument and shift it off so we can pass $@ to every function
@ -635,6 +643,9 @@ case "${C}" in
stop) stop)
stop "${@}" stop "${@}"
;; ;;
w|wipe)
wipe "${@}"
;;
*) *)
usage "$*" usage "$*"
;; ;;