ソースを参照

feat(newserver): Medal of Honor: Allied Assault (#2539)

Frisasky 6 年 前
コミット
7a3fa84fa6

+ 144 - 0
lgsm/config-default/config-lgsm/mohaaserver/_default.cfg

@@ -0,0 +1,144 @@
+##################################
+######## 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="12203"
+defaultmap="dm/mohdm1"
+
+## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
+fn_parms(){
+parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_outputpath ${gamelogdir} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}"
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# Display IP | https://docs.linuxgsm.com/alerts#display-ip
+displayip=""
+
+# 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"
+
+# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
+slackalert="off"
+slackwebhook="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=""
+
+## Backup | https://docs.linuxgsm.com/commands/backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://docs.linuxgsm.com/features/logging
+consolelogging="on"
+logdays="7"
+
+## Monitor | https://docs.linuxgsm.com/commands/monitor
+# Query delay time
+querydelay="1"
+
+#### LinuxGSM Advanced Settings ####
+
+# ANSI Colors
+ansi="on"
+
+# Message Display Time
+sleeptime="0.5"
+
+# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode
+# 1: tmux kill
+# 2: CTRL+c
+# 3: quit
+# 4: quit 120s
+# 5: stop
+# 6: q
+# 7: exit
+# 8: 7 Days to Die
+# 9: Gold Source
+# 10: Teamspeak 3
+stopmode="3"
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Medal of Honor: Allied Assault"
+engine="idtech3"
+glibc="2.3"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}/main"
+executabledir="${serverfiles}"
+executable="./mohaa_lnxded"
+servercfg="${servicename}.cfg"
+servercfgdefault="server.cfg"
+servercfgdir="${serverfiles}"
+servercfgfullpath="${serverfiles}/${servercfg}"
+
+## Backup Directory
+backupdir="${lgsmdir}/backup"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${serverfiles}/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

@@ -50,6 +50,7 @@ l4d,l4dserver,Left 4 Dead
 l4d2,l4d2server,Left 4 Dead 2
 mc,mcserver,Minecraft
 mh,mhserver,MORDHAU
+mohaa,mohaaserver,Medal of Honor: Allied Assault
 mta,mtaserver,Multi Theft Auto
 mumble,mumbleserver,Mumble
 nd,ndserver,Nuclear Dawn

+ 3 - 0
lgsm/functions/check_deps.sh

@@ -400,6 +400,9 @@ fn_deps_build_debian(){
 		else
 			array_deps_required+=( openjdk-8-jre-headless )
 		fi
+	# Medal of Honor: Allied Assault 
+	elif [ "${shortname}" == "mohaa" ]; then
+		array_deps_required+=( libstdc++5:i386 )
 	# Project Zomboid
 	elif [ "${shortname}" == "pz" ]; then
 		if [ -n "$(java -version 2>&1 | grep "version")" ]; then

+ 3 - 0
lgsm/functions/command_monitor.sh

@@ -209,6 +209,9 @@ if [ "${shortname}" == "sb" ]; then
 	fi
 elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then
 	fn_monitor_query_tcp
+elif [ "${shortname}" == "mohaa" ]; then
+	# prevent game from using query. Only used if specific game server cant query but engine can
+	:
 else
 	fn_monitor_query
 fi

+ 23 - 0
lgsm/functions/info_config.sh

@@ -386,6 +386,26 @@ fn_info_config_minecraft(){
 	fi
 }
 
+fn_info_config_mohaa(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		rconpassword="${unavailable}"
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		maxplayers="${zero}"
+	else
+		rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
+		# Not Set
+		rconpassword=${rconpassword:-"NOT SET"}
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
+
 #Post Scriptum: The bloody Seventh
 fn_info_config_pstbs(){
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -1290,6 +1310,9 @@ elif [ "${shortname}" == "jc3" ]; then
 # Killing Floor 2
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_config_kf2
+# Medal of Honor: Allied Assault
+elif [ "${shortname}" == "mohaa" ]; then
+  fn_info_config_mohaa
 # QuakeWorld
 elif [ "${shortname}" == "qw" ]; then
 	fn_info_config_quakeworld

+ 3 - 3
lgsm/functions/info_distro.sh

@@ -101,7 +101,7 @@ cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)
 cpufreqency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
 # CPU usage of the game server pid
 if [ "${status}" == "1" ]; then
-	cpuused=$(ps --forest -o pcpu -g "$(ps -o sid= -p "${gameserverpid}")"|awk '{s+=$1} END {print s}')
+	cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}')
 fi
 
 ## Memory information
@@ -139,9 +139,9 @@ if [ -n "$(command -v numfmt 2>/dev/null)" ]; then
 	# RAM usage of the game server pid
 	# MB
 	if [ "${status}" == "1" ]; then
-		memused=$(ps --forest -o rss -g "$(ps -o sid= -p "${gameserverpid}")"|awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}')
+		memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}')
 	# %
-		pmemused=$(ps --forest -o %mem -g "$(ps -o sid= -p "${gameserverpid}")"|awk '{s+=$1} END {print s}')
+		pmemused=$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}')
 	fi
 else
 # Older distros will need to use free.

+ 12 - 1
lgsm/functions/info_messages.sh

@@ -397,7 +397,7 @@ fn_info_message_script(){
 	# LinuxGSM version:     v19.9.0
 	# glibc required:         2.15
 	# Discord alert:          off
-	# Slack alert:			  off
+	# Slack alert:            off
 	# Email alert:            off
 	# Pushbullet alert:       off
 	# IFTTT alert:            off
@@ -811,6 +811,15 @@ fn_info_message_minecraft(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_mohaa(){
+	echo -e "netstat -atunp | grep mohaa_lnxded"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_mumble(){
 	echo -e "netstat -atunp | grep murmur"
 	echo -e ""
@@ -1363,6 +1372,8 @@ fn_info_message_select_engine(){
 		fn_info_message_towerunite
 	elif [ "${shortname}" == "unt" ]; then
 		fn_info_message_unturned
+	elif [ "${shortname}" == "mohaa" ]; then
+		fn_info_message_mohaa
 	elif [ "${shortname}" == "mh" ]; then
 		fn_info_message_mordhau
 	elif [ "${shortname}" == "mta" ]; then

+ 8 - 0
lgsm/functions/info_parms.sh

@@ -83,6 +83,12 @@ fn_info_parms_mordhau(){
 	beaconport=${beaconport:-"0"}
 }
 
+fn_info_parms_mohaa(){
+	port=${port:-"0"}
+	queryport=${port:-"0"}
+	defaultmap=${defaultmap:-"NOT SET"}
+}
+
 fn_info_parms_projectzomboid(){
 	adminpassword=${adminpassword:-"NOT SET"}
 }
@@ -235,6 +241,8 @@ elif [ "${shortname}" == "inss" ]; then
 	fn_info_parms_inss
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_parms_kf2
+elif [ "${shortname}" == "mohaa" ]; then
+	fn_info_parms_mohaa
 # Project Zomboid
 elif [ "${shortname}" == "pz" ]; then
 	fn_info_parms_projectzomboid

+ 6 - 0
lgsm/functions/install_config.sh

@@ -440,6 +440,12 @@ elif [ "${shortname}" == "mc" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${shortname}" == "mohaa" ]; then
+	gamedirname="MedalOfHonorAlliedAssault"
+	array_configs+=( server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${shortname}" == "mh" ]; then
 	gamedirname="Mordhau"
 	fn_check_cfgdir

+ 2 - 0
lgsm/functions/install_server_files.sh

@@ -29,6 +29,8 @@ fn_install_server_files(){
 		remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/etlegacy-v2.75-i386-et-260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="92d7d4c26e0a295daed78cef623eeabb"
 	elif [ "${shortname}" == "ges" ]; then
 		remote_fileurl="https://files.linuxgsm.com/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.bz2"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="c45c16293096706e8b5e2cd64a6f2931"
+	elif [ "${shortname}" == "mohaa" ]; then
+		remote_fileurl="https://files.linuxgsm.com/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9d5924486a0cf5e46dd063216aad05c1"
 	elif [ "${shortname}" == "ns" ]; then
 		remote_fileurl="https://files.linuxgsm.com/NaturalSelection/ns_dedicated_server_v32.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="499cf63324b76925ada6baf5f2eacd67"
 	elif [ "${shortname}" == "q2" ]; then