diff --git a/files/custom/no-personal-light/cfggameplay.json b/files/custom/no-personal-light/cfggameplay.json new file mode 100644 index 0000000..f06027c --- /dev/null +++ b/files/custom/no-personal-light/cfggameplay.json @@ -0,0 +1,5 @@ +{ + "PlayerData": { + "disablePersonalLight": true + } +} diff --git a/files/mods/3115714092/README.md b/files/mods/3115714092/README.md index 25b48f9..bb43c98 100644 --- a/files/mods/3115714092/README.md +++ b/files/mods/3115714092/README.md @@ -5,19 +5,26 @@ 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/). +## 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 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. -* `cfgeventgroups.xml` -* `cfgeventspawns.xml` +These are map-specific. The ones included in this repository are for Chernarus: + +* `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: -* `cfgspawnabletypes.xml` -* `events.xml` -* `types.xml` +* `cfgspawnabletypes.xml` - +* `events.xml` - An event that spawns a complete train +* `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. diff --git a/files/serverDZ.cfg b/files/serverDZ.cfg index b803cdb..40d94ee 100644 --- a/files/serverDZ.cfg +++ b/files/serverDZ.cfg @@ -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 passwordAdmin = ""; // Password to become a server admin diff --git a/server/bin/dz b/server/bin/dz index 0860c4d..8a78875 100755 --- a/server/bin/dz +++ b/server/bin/dz @@ -48,6 +48,7 @@ Options and arguments: r|restart - Restart the server without restarting the container s|status - Shows the server's status: Running, uptime, mods, parameters, mod parameter, etc. stop - Stop the server + w|wipe - Wipes the current storage_1 ${default}" exit 1 } @@ -110,10 +111,10 @@ EOF # Make sure to clean up and report on exit, as these files remain in the container's volume report() { - if [[ ${DONT_START} != "" ]] - then - exit 0 - fi + if [[ ${DONT_START} != "" ]] + then + exit 0 + fi rm -f /tmp/mod_command_line /tmp/parameters echo echo -e "${yellow}========================================== error.log ==========================================" @@ -147,9 +148,6 @@ mergexml(){ -o -name "init.c" \ \) -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 # Remove any existing files, via the mod_ and custom_ prefixes rm -rf ${MPMISSIONS}/${MAP}/mod_* @@ -226,11 +224,8 @@ mergexml(){ fi echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" 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}/cfgGameplay.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x - 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 + jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x + mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json fi done # These are merged directly into the upstream file, but are C @@ -324,10 +319,8 @@ mergexml(){ fi echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" rm -f /tmp/x /tmp/y - jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/cfgGameplay.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x - mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json -# jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x -# 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 done if [[ ${FOUND} = 1 ]] @@ -488,27 +481,27 @@ rcon(){ # List mods activelist(){ X=1 - C="${green}" + C="${green}" spaces=" " have=no - for link in $(ls -tdr ${SERVER_PROFILE}/@* 2> /dev/null) + for link in $(ls -tdr ${SERVER_PROFILE}/@* 2> /dev/null) do - if [[ ${have} = "no" ]] - then - have="yes" - echo -e "\n ID Name URL Size" - echo "------------------------------------------------------------------------------------------------------------------------" - fi + if [[ ${have} = "no" ]] + then + have="yes" + echo -e "\n ID Name URL Size" + echo "------------------------------------------------------------------------------------------------------------------------" + fi ID=$(readlink ${link} | awk -F/ '{print $NF}') - MODNAME=$(get_mod_name ${ID}) + MODNAME=$(get_mod_name ${ID}) SIZE=$(du -sh "${WORKSHOP_DIR}/${ID}" | awk '{print $1}') printf "${C}%.3d %s %.30s %s https://steamcommunity.com/sharedfiles/filedetails/?id=%s %s${default}\n" ${X} ${ID} "${MODNAME}" "${spaces:${#MODNAME}+1}" ${ID} ${SIZE} X=$((X+1)) done if [[ ${have} = "no" ]] - then - echo -ne "${red}none${default}" - fi + then + echo -ne "${red}none${default}" + fi } get_map_name(){ @@ -523,7 +516,7 @@ get_map_name(){ # Display the status of everything status(){ - loadconfig + loadconfig INSTALLED="${NO}" RUNNING="${NO}" @@ -539,14 +532,13 @@ status(){ D=$(date +%s) F=$(date +%s -r ${SERVER_PROFILE}/server_console.log) 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_console.log))) -u +"%H hours %M minutes %S seconds") + UPTIME="${DAYS} days "$(date -d@$(($(date +%s) - $(date +%s -r ${SERVER_PROFILE}/server.pid))) -u +"%H hours %M minutes %S seconds") RUNNING="${YES}\nUptime: ${green}${UPTIME}${default}" # Current parameters RUNNING="${RUNNING}\nRunning Parameters: $(cat /tmp/parameters)\nRunning mod parameter: $(cat /tmp/mod_command_line)" fi - MAP=${MAP} + MAP=${MAP} # Number of mods plus the list denoting on or off echo -ne " Server files installed: ${INSTALLED}" @@ -584,6 +576,22 @@ backup(){ 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) # Capture the first argument and shift it off so we can pass $@ to every function @@ -635,6 +643,9 @@ case "${C}" in stop) stop "${@}" ;; + w|wipe) + wipe "${@}" + ;; *) usage "$*" ;;