Просмотр исходного кода

feat(newserver): Mordhau (#2333)

Co-authored-by: Christian Birk <chris.h3o66@gmail.com>
Christian 7 лет назад
Родитель
Сommit
66e0bd9fea

+ 129 - 0
lgsm/config-default/config-lgsm/mhserver/_default.cfg

@@ -0,0 +1,129 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
+ip="0.0.0.0"
+port="7777"
+queryport="27015"
+# Maps: FFA_Camp, FFA_Contraband, FFA_Grad, FFA_MountainPeak, FFA_Taiga, FFA_ThePit, FFA_Tourney, SKM_Camp, SKM_Contraband, SKM_Grad, SKM_MountainPeak, SKM_Taiga, SKM_ThePit, SKM_Tourney, TDM_Camp, TDM_Contraband, TDM_Grad, TDM_MountainPeak, TDM_Taiga, TDM_ThePit, TDM_Tourney
+defaultmap="FFA_ThePit"
+
+## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
+fn_parms(){
+parms="Mordhau ${defaultmap} -log -MultiHome=${ip} -MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport}"
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# More info | https://docs.linuxgsm.com/alerts#more-info
+postalert="off"
+postdays="7"
+posttarget="https://hastebin.com"
+
+# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://docs.linuxgsm.com/alerts/email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
+mailgunalert="off"
+mailguntoken="accesstoken"
+mailgundomain="example.com"
+mailgunemailfrom="alert@example.com"
+mailgunemail="email@myemail.com"
+
+# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+
+# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
+# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
+# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
+# any custom string in curl - simple ignore this parameter.
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+curlcustomstring=""
+
+## Updating | https://docs.linuxgsm.com/commands/update
+updateonstart="off"
+
+## Backup | https://docs.linuxgsm.com/commands/backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://docs.linuxgsm.com/features/logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+# ANSI Colors
+ansi="on"
+
+## SteamCMD Settings
+# Server appid
+appid="629800"
+# Steam App Branch Select
+# Allows to opt into the various Steam app branches. Default branch is "".
+# Example: "-beta latest_experimental"
+branch=""
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="MORDHAU"
+engine="unreal4"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}/Mordhau"
+executabledir="${systemdir}/Binaries/Linux"
+executable="./MordhauServer-Linux-Shipping"
+servercfgdir="${systemdir}/Saved/Config/LinuxServer"
+servercfg="Game.ini"
+servercfgdefault="Game.ini"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${lgsmdir}/backup"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${systemdir}/Saved/Logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+lgsmlog="${lgsmlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+alertlog="${lgsmlogdir}/${servicename}-alert.log"
+postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

+ 1 - 0
lgsm/data/serverlist.csv

@@ -46,6 +46,7 @@ kf2,kf2server,Killing Floor 2
 l4d,l4dserver,Left 4 Dead
 l4d2,l4d2server,Left 4 Dead 2
 mc,mcserver,Minecraft
+mh,mhserver,Mordhau
 mta,mtaserver,Multi Theft Auto
 mumble,mumbleserver,Mumble
 nd,ndserver,Nuclear Dawn

+ 22 - 0
lgsm/functions/info_config.sh

@@ -1146,6 +1146,26 @@ fn_info_config_stationeers(){
 	fi
 }
 
+fn_info_config_mordhau() {
+	if [ ! -f "${servercfgfullpath}" ]; then
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		rconpassword="${unavailable}"
+		maxplayers="${unavailable}"
+	else
+		servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+		serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+		rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+		maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+
+		# Not set
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		rconpassword=${rconpassword:-"NOT SET"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
+
 # ARK: Survival Evolved
 if [ "${shortname}" == "ark" ]; then
 	fn_info_config_ark
@@ -1276,4 +1296,6 @@ elif [ "${shortname}" == "squad" ]; then
 # Stationeers
 elif [ "${shortname}" == "st" ]; then
 	fn_info_config_stationeers
+elif [ "${shortname}" == "mh" ]; then
+	fn_info_config_mordhau
 fi

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -147,6 +147,9 @@ elif [ "${gamename}" == "NS2: Combat" ]; then
 elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
+elif [ "${gamename}" == "Mordhau" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"
 elif [ "${gamename}" == "Mumble" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"

+ 16 - 0
lgsm/functions/info_messages.sh

@@ -1179,6 +1179,20 @@ fn_info_message_mta(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_mordhau(){
+	echo -e "netstat -atunp | grep Mord"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\ttcp"
+		# Don't do arithmetics if ever the port wasn't a numeric value
+		if [ "${port}" -eq "${port}" ]; then
+			echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
+		fi
+		echo -e "> Query\tINBOUND\t${queryport}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_select_engine(){
 	# Display details depending on game or engine.
 	if [ "${gamename}" == "7 Days To Die" ]; then
@@ -1241,6 +1255,8 @@ fn_info_message_select_engine(){
 		fn_info_message_towerunite
 	elif [ "${shortname}" == "unt" ]; then
 		fn_info_message_unturned
+	elif [ "${shortname}" == "mh" ]; then
+		fn_info_message_mordhau
 	elif [ "${gamename}" == "Multi Theft Auto" ]; then
 		fn_info_message_mta
 	elif [ "${gamename}" == "Mumble" ]; then

+ 7 - 0
lgsm/functions/info_parms.sh

@@ -146,6 +146,11 @@ fn_info_config_towerunite(){
 	queryport=${queryport:-"0"}
 }
 
+fn_info_config_mordhau(){
+	port=${port:-"0"}
+	queryport=${queryport:-"0"}
+}
+
 fn_info_parms_unreal(){
 	defaultmap=${defaultmap:-"NOT SET"}
 	queryport=$((port + 1))
@@ -221,6 +226,8 @@ elif [ "${engine}" == "spark" ]; then
 	fn_info_parms_spark
 elif [ "${shortname}" == "tu" ]; then
 	fn_info_config_towerunite
+elif [ "${shortname}" == "mh" ]; then
+	fn_info_config_mordhau
 # Unreal/Unreal 2 engine
 elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
 	fn_info_parms_unreal

+ 7 - 0
lgsm/functions/install_config.sh

@@ -427,6 +427,13 @@ elif [ "${gamename}" == "Minecraft" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Mordhau" ]; then
+	gamedirname="Mordhau"
+	fn_check_cfgdir
+	array_configs+=( Game.ini )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Natural Selection" ]; then
 	gamedirname="NaturalSelection"
 	array_configs+=( server.cfg )