diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 4b45ab417..c3a23b900 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -356,6 +356,35 @@ fn_info_game_col(){ fi } +fn_info_game_dayz(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + adminpassword="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"2302"} + voiceport=${port:-"2302"} + queryport=$((port+1)) + steammasterport=$((port+2)) + voiceunusedport=$((port+3)) + battleeyeport=$((port+4)) +} + fn_info_game_dst(){ # Config if [ ! -f "${clustercfgfullpath}" ]; then @@ -2036,6 +2065,8 @@ elif [ "${shortname}" == "codwaw" ]; then fn_info_game_codwaw elif [ "${shortname}" == "col" ]; then fn_info_game_col +elif [ "${shortname}" == "dayz" ]; then + fn_info_game_dayz elif [ "${shortname}" == "dst" ]; then fn_info_game_dst elif [ "${shortname}" == "eco" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 984db5b80..6dcc705c6 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -921,6 +921,18 @@ fn_info_message_csgo(){ } | column -s $'\t' -t } +fn_info_message_dayz(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Voice" voiceport udp + fn_port "Query Steam" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Voice (unused)" voiceunusedport udp + fn_port "BattleEye" battleeyeport udp + } | column -s $'\t' -t +} + fn_info_message_dst(){ { fn_port "header" @@ -1597,6 +1609,8 @@ fn_info_message_select_engine(){ fn_info_message_codwaw elif [ "${shortname}" == "col" ]; then fn_info_message_col + elif [ "${shortname}" == "dayz" ]; then + fn_info_message_dayz elif [ "${shortname}" == "dst" ]; then fn_info_message_dst elif [ "${shortname}" == "eco" ]; then