diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index d7da37cf1f..7b338811a1 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -166,7 +166,7 @@ consoleinteract="no" # Do not edit gamename="ARMA 3" engine="realvirtuality" -glibc="2.13" +glibc="2.27" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index abad7f61cb..d5ad3b59f3 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -122,7 +122,7 @@ stopmode="5" # 3: gamedig # 4: gsquery # 5: tcp -querymode="4" +querymode="2" querytype="minecraftbe" ## Console type diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index 424cafabf1..a29d763745 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -16,16 +16,18 @@ appport=28082 rconpassword="CHANGE_ME" rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty. servername="Rust" -gamemode="vanilla" # values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) -maxplayers="50" +gamemode="vanilla" # Values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) +serverlevel="Procedural Map" # Values: Procedural Map, Barren, HapisIsland, SavasIsland +customlevelurl="" # Custom level url seed="" # range: 1-2147483647, used to reproduce a procedural map. salt="" # range: unknown, used to recover a known setting from an existing map. +maxplayers="50" worldsize="3000" # default: 3000, range: 1000-6000, map size in meters. saveinterval="300" # Auto-save in seconds. tickrate="30" # default: 30, range: 15-100. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" +startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.levelurl ${customlevelurl} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" #### LinuxGSM Settings #### @@ -108,7 +110,7 @@ logdays="7" ## Monitor | https://docs.linuxgsm.com/commands/monitor # Query delay time -querydelay="5" +querydelay="10" ## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors ansi="on" diff --git a/lgsm/data/bo_header.jpg b/lgsm/data/bo_header.jpg new file mode 100644 index 0000000000..d63ee5c3da Binary files /dev/null and b/lgsm/data/bo_header.jpg differ diff --git a/lgsm/data/rust_header.jpg b/lgsm/data/rust_header.jpg new file mode 100644 index 0000000000..e4006b0706 Binary files /dev/null and b/lgsm/data/rust_header.jpg differ diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index b8467eecc8..1d047b60b7 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -15,13 +15,13 @@ fi json=$(cat < "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" + fn_reload_startparameters cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 63cb830fba..d2d05defcb 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -12,9 +12,9 @@ fn_firstcommand_set # Provides an exit code upon error. fn_wipe_exit_code(){ - ((exitcode=$?)) + exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${currentaction}" + fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl @@ -22,209 +22,160 @@ fn_wipe_exit_code(){ } # Removes files to wipe server. -fn_wipe_server_files(){ - fn_print_start_nl "Wiping server" - fn_script_log_info "Wiping server" - # Wipe procedural map. - if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then - echo -en "removing procedural map proceduralmap.*.map file(s)..." - fn_sleep_time - fn_script_log_info "Removing procedural map file(s): ${serveridentitydir}/proceduralmap.*.map" - find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no procedural map file to remove" - fn_sleep_time - fn_script_log_pass "No procedural map file to remove" - fi - # Wipe Barren map. - if [ -n "$(find "${serveridentitydir}" -type f -name "barren*.map")" ]; then - echo -en "removing barren map barren*.map file(s)..." - fn_sleep_time - fn_script_log_info "Removing map file(s): ${serveridentitydir}/barren*.map" - find "${serveridentitydir:?}" -type f -name "barren*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no barren map file to remove" - fn_sleep_time - fn_script_log_pass "No barren map file to remove" - fi - # Wipe custom map. - if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then - echo -en "removing custom map file(s)..." - fn_sleep_time - fn_script_log_info "Removing map file(s): ${serveridentitydir}/*.map" - find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no map file to remove" - fn_sleep_time - fn_script_log_pass "No map file to remove" - fi - # Wipe custom map save. - if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then - echo -en "removing map save *.sav* file(s)..." - fn_sleep_time - fn_script_log_info "Removing map save(s): ${serveridentitydir}/*.sav*" - find "${serveridentitydir:?}" -type f -name "*.sav*" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no map save to remove" - fn_sleep_time - fn_script_log_pass "No map save to remove." - fi - # Wipe user dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/user" ]; then - echo -en "removing user directory..." - fn_sleep_time - fn_script_log_info "removing user directory: ${serveridentitydir}/user" - rm -rf "${serveridentitydir:?}/user" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe storage dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/storage" ]; then - echo -en "removing storage directory..." - fn_sleep_time - fn_script_log_info "removing storage directory: ${serveridentitydir}/storage" - rm -rf "${serveridentitydir:?}/storage" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe sv.files. - if [ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then - echo -en "removing server misc srv.files*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing server misc files: ${serveridentitydir}/sv.files.*.db" - find "${serveridentitydir:?}" -type f -name "sv.files.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - # No further information if not found because it should I could not get this file showing up. - fi - # Wipe player death files. - if [ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]; then - echo -en "removing player deaths player.deaths.*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing player death files: ${serveridentitydir}/player.deaths.*.db" - find "${serveridentitydir:?}" -type f -name "player.deaths.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no player death to remove" - fn_sleep_time - fn_script_log_pass "No player death to remove" - fi - # Wipe player states files - if [ -n "$(find "${serveridentitydir}" -type f -name "player.states.*.db")" ]; then - echo -en "removing player states player.states.*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing player states: ${serveridentitydir}/player.states.*.db" - find "${serveridentitydir:?}" -type f -name "player.states.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no player states to remove" - fn_sleep_time - fn_script_log_pass "No player states to remove" - fi - # Wipe blueprints only if full-wipe command was used. - if [ "${fullwipe}" == "1" ]; then - if [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - echo -en "removing blueprints player.blueprints.*.db file(s)..." +fn_wipe_files(){ + fn_print_start_nl "${wipetype}" + fn_script_log_info "${wipetype}" + + # Remove Map files + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then + echo -en "removing .map file(s)..." + fn_script_log_info "removing *.map file(s)" fn_sleep_time - fn_script_log_info "Removing blueprint file(s): ${serveridentitydir}/player.blueprints.*.db" - find "${serveridentitydir:?}" -type f -name "player.blueprints.*.db" -delete | tee -a "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" fn_wipe_exit_code + else + echo -e "no .map file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .map file(s) to remove" + fi + fi + # Remove Save files. + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then + echo -en "removing .sav file(s)..." + fn_script_log_info "removing .sav file(s)" fn_sleep_time + find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.sav*" -delete + fn_wipe_exit_code else - echo -e "no blueprint file to remove" + echo -e "no .sav file(s) to remove" + fn_script_log_pass "no .sav file(s) to remove" fn_sleep_time - fn_script_log_pass "No blueprint file to remove" fi - elif [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - echo -e "keeping blueprints" - fn_sleep_time - fn_script_log_info "Keeping blueprints" - else - echo -e "no blueprints found" - fn_sleep_time - fn_script_log_pass "No blueprints found" fi - # Wipe some logs that might be there. - if [ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]; then - echo -en "removing log files..." - fn_sleep_time - fn_script_log_info "Removing log files: ${serveridentitydir}/Log.*.txt" - find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there are no logs to remove. + # Remove db files for full wipe. + # Excluding player.tokens.db for Rust+. + if [ -n "${serverwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + echo -en "removing .db file(s)..." + fn_script_log_info "removing .db file(s)" + fn_sleep_time + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete + fn_wipe_exit_code + else + echo -e "no .db file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .db file(s) to remove" + fi fi } -fn_stop_warning(){ - fn_print_warn "this game server will be stopped during wipe" - fn_script_log_warn "this game server will be stopped during wipe" +fn_map_wipe_warning(){ + fn_print_warn "Map wipe will reset the map data and keep blueprint data" + fn_script_log_warn "Map wipe will reset the map data and keep blueprint data" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "this game server will be stopped during wipe: ${totalseconds}" + fn_print_warn "Map wipe will reset the map data and keep blueprint data: ${totalseconds}" totalseconds=$((totalseconds - 1)) sleep 1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn_nl "this game server will be stopped during wipe" + fn_print_warn_nl "Map wipe will reset the map data and keep blueprint data" } -fn_wipe_warning(){ - fn_print_warn "wipe is about to start" - fn_script_log_warn "wipe is about to start" +fn_full_wipe_warning(){ + fn_print_warn "Server wipe will reset the map data and remove blueprint data" + fn_script_log_warn "Server wipe will reset the map data and remove blueprint data" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "wipe is about to start: ${totalseconds}" + fn_print_warn "Server wipe will reset the map data and remove blueprint data: ${totalseconds}" totalseconds=$((totalseconds - 1)) sleep 1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn "wipe is about to start" + fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" } -# Will change the seed everytime the wipe command is run if the seed in config is not set. +# Will change the seed if the seed is not defined by the user. fn_wipe_random_seed(){ - shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + if [ -f "${datadir}/${selfname}-seed.txt" ]&&[ -n "${randomseed}" ]; then + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + seed=$(cat "${datadir}/${selfname}-seed.txt") + randomseed=1 + echo -en "generating new random seed (${cyan}${seed}${default})..." + fn_script_log_pass "generating new random seed (${cyan}${seed}${default})" + fn_sleep_time + fn_print_ok_eol_nl + fi +} + +# A summary of what wipe is going to do. +fn_wipe_details(){ + fn_print_information_nl "Wipe does not remove Rust+ data." + echo -en "* Wipe map data: " + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Wipe blueprint data: " + if [ -n "${serverwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Change Procedural Map seed: " + if [ -n "${randomseed}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi } fn_print_dots "" check.sh +fix_rust.sh # Check if there is something to wipe. -if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then - fn_wipe_warning +if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]&&[ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + if [ -n "${serverwipe}" ]; then + wipetype="Full wipe" + fn_full_wipe_warning + fn_wipe_details + elif [ -n "${mapwipe}" ]; then + wipetype="Map wipe" + fn_map_wipe_warning + fn_wipe_details + fi check_status.sh if [ "${status}" != "0" ]; then - fn_stop_warning + fn_print_restart_warning exitbypass=1 command_stop.sh fn_firstcommand_reset - fn_wipe_server_files + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" exitbypass=1 command_start.sh fn_firstcommand_reset else - fn_wipe_server_files + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" fi - fn_print_complete_nl "Wiping ${selfname}" - fn_script_log_pass "Wiping ${selfname}" - fn_wipe_random_seed else fn_print_ok_nl "Wipe not required" fn_script_log_pass "Wipe not required" diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 89b0ef0faf..ec1a98531a 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v21.2.2" +modulesversion="v21.2.3" # Core diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 904bad37d1..ea3c84f6d9 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -40,8 +40,8 @@ cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mo # Server specific. cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) -cmd_wipe=( "w;wipe;wi" "command_wipe.sh" "Map assets are wiped and blueprints are kept." ) -cmd_full_wipe=( "fw;full-wipe;wa;wipeall" "fullwipe=1; command_wipe.sh" "Map assets and blueprints are wiped." ) +cmd_fullwipe=( "fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data." ) +cmd_mapwipe=( "mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data." ) cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) @@ -105,7 +105,7 @@ fi # Unreal exclusive. if [ "${shortname}" == "rust" ]; then - currentopt+=( "${cmd_wipe[@]}" "${cmd_full_wipe[@]}" ) + currentopt+=( "${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}" ) fi if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index e28cb74573..811acfbba0 100755 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -79,5 +79,6 @@ if [ -z "${wsstartmap}" ]; then fi fn_parms(){ -parms="${startparameters}" + fn_reload_startparameters + parms="${startparameters}" } diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 8dfca66615..463f833c2e 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -375,6 +375,28 @@ fn_prompt_message(){ # On-Screen End of Line ################################## +# YES +fn_print_yes_eol(){ + echo -en "${cyan}YES${default}" + fn_sleep_time +} + +fn_print_yes_eol_nl(){ + echo -e "${cyan}YES${default}" + fn_sleep_time +} + +# NO +fn_print_no_eol(){ + echo -en "${red}NO${default}" + fn_sleep_time +} + +fn_print_no_eol_nl(){ + echo -e "${red}NO${default}" + fn_sleep_time +} + # OK fn_print_ok_eol(){ echo -en "${green}OK${default}" diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 1e62898df0..4488377a38 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -9,3 +9,13 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" + +# Part of random seed feature. +# If seed is not defined by user generate a seed file. +if [ -z "${seed}" ]; then + if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + fi + seed="$(cat "${datadir}/${selfname}-seed.txt")" + randomseed=1 +fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index e42236aa89..391964c2a6 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -262,6 +262,11 @@ fn_info_message_gameserver(){ echo -e "${lightblue}Beta Password:\t${default}${betapassword}" fi + # Server Version + if [ -n "${gdversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${gdversion}" + fi + # Server ip echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" @@ -347,7 +352,7 @@ fn_info_message_gameserver(){ fi if [ -n "${defaultscenario}" ]; then - # Current scenario + # Current scenario (Insurgency: Sandstorm) if [ -n "${gdgamemode}" ]; then echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" fi @@ -425,7 +430,22 @@ fn_info_message_gameserver(){ # Save interval (Rust) if [ -n "${saveinterval}" ]; then - echo -e "${lightblue}ASE:\t${default}${saveinterval} s" + echo -e "${lightblue}Save interval:\t${default}${saveinterval}s" + fi + + # Seed (Rust) + if [ -n "${seed}" ]; then + echo -e "${lightblue}Seed:\t${default}${seed}" + fi + + # Salt (Rust) + if [ -n "${salt}" ]; then + echo -e "${lightblue}Salt:\t${default}${salt}" + fi + + # World Size (Rust) + if [ -n "${worldsize}" ]; then + echo -e "${lightblue}World size:\t${default}${worldsize}m" fi # Random map rotation mode (Squad and Post Scriptum) @@ -1126,6 +1146,7 @@ fn_info_message_rust(){ echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/Query\tINBOUND\t${port}\tudp" echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + echo -e "> App\tINBOUND\t${appport}\ttcp" } | column -s $'\t' -t } diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index f2496ce5de..47148f4b3c 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -135,19 +135,16 @@ fn_info_parms_rust(){ servername=${servername:-"NOT SET"} port=${port:-"0"} queryport=${port:-"0"} + appport=${appport:-"0"} rconport=${rconport:-"0"} + gamemode=${gamemode:-"NOT SET"} + maxplayers=${maxplayers:-"0"} rconpassword=${rconpassword:-"NOT SET"} rconweb=${rconweb:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - saveinterval=${saveinterval:-"0"} tickrate=${tickrate:-"0"} - # Part of random seed feature. - if [ -z "${seed}" ]; then - if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then - shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" - fi - seed=$(cat "${datadir}/${selfname}-seed.txt") - fi + saveinterval=${saveinterval:-"0"} + serverlevel=${serverlevel:-"NOT SET"} + worldsize=${worldsize:-"0"} } fn_info_parms_samp(){ diff --git a/lgsm/functions/install_modules.sh b/lgsm/functions/install_modules.sh deleted file mode 100755 index af1050a949..0000000000 --- a/lgsm/functions/install_modules.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# LinuxGSM install_modules.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Downloads all modules on install. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Downloading LinuxGSM Modules${default}" -echo -e "=================================" - -fn_fetch_file "https://github.com/GameServerManagers/LinuxGSM/archive/master.tar.gz" "${tmpdir}" "master.tar.gz" "nochmodx" "norun" "noforce" "nohash" -fn_dl_extract "${tmpdir}" "master.tar.gz" "${tmpdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.sh "${functionsdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.py "${functionsdir}" -chmod +x "${functionsdir}"/* -command_update_linuxgsm.sh -fn_firstcommand_reset diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index bf0233177c..b6b9f5240f 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -27,7 +27,7 @@ fn_install_server_files(){ elif [ "${shortname}" == "codwaw" ]; then remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.77-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.77-i386-et-260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7f301708f5bb1272c243f9e2d1b735dc" + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.77.1-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.77.1-i386-et-260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="cc307a9232abd3999be499b42d8e4ea8" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" elif [ "${shortname}" == "ns" ]; then diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 4d479a4c03..123d8c86c8 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -46,7 +46,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # maxplayers. gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers') if [ "${gdmaxplayers}" == "null" ]; then - unset maxplayers + unset gdmaxplayers elif [ "${gdmaxplayers}" == "[]" ]; then gdmaxplayers=0 fi @@ -68,5 +68,11 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then unset gdbots fi + + # server version. + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + if [ "${gdversion}" == "null" ]||[ "${gdversion}" == "0" ]; then + unset gdversion + fi fi fi diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index ae512c0ba9..2e669d93db 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -74,7 +74,7 @@ fn_update_papermc_remotebuild(){ fn_update_papermc_compare(){ fn_print_dots "Checking for update: ${remotelocation}" sleep 0.5 - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available for version ${paperversion}" diff --git a/linuxgsm.sh b/linuxgsm.sh index 08bb0975f2..c4df710378 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.3" shortname="core" gameservername="core" commandname="CORE" @@ -478,7 +478,7 @@ else elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/_default.cfg"; then eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi - + # For legacy configs that still use parms= 15.03.21 if grep -qE "^[[:blank:]]*parms=" "${configdirserver}/secrets-${selfname}.cfg"; then eval parms="$(sed -nr 's/^ *parms=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" @@ -497,7 +497,6 @@ else fi } - fn_reload_startparameters # Load the linuxgsm.sh in to tmpdir. If missing download it. if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index c4a716aa95..f31d4ac964 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.3" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index ff1eec5472..7203ac0d28 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.3" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index ce24f3df04..4207328391 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.3" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d867b41ac5..afc68811a5 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.3" shortname="ts3" gameservername="ts3server" commandname="CORE"