Skip to content

Commit 7a3fa84

Browse files
Frisaskydgibbs64
authored andcommitted
feat(newserver): Medal of Honor: Allied Assault (#2539)
1 parent 63dffc5 commit 7a3fa84

File tree

10 files changed

+205
-4
lines changed

10 files changed

+205
-4
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
##################################
2+
######## Default Settings ########
3+
##################################
4+
# DO NOT EDIT WILL BE OVERWRITTEN!
5+
# Copy settings from here and use them in either
6+
# common.cfg - applies settings to every instance
7+
# [instance].cfg - applies settings to a specific instance
8+
9+
#### Server Settings ####
10+
11+
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
12+
ip="0.0.0.0"
13+
port="12203"
14+
defaultmap="dm/mohdm1"
15+
16+
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
17+
fn_parms(){
18+
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}"
19+
}
20+
21+
#### LinuxGSM Settings ####
22+
23+
## Notification Alerts
24+
# (on|off)
25+
26+
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
27+
displayip=""
28+
29+
# More info | https://docs.linuxgsm.com/alerts#more-info
30+
postalert="off"
31+
postdays="7"
32+
posttarget="https://hastebin.com"
33+
34+
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
35+
discordalert="off"
36+
discordwebhook="webhook"
37+
38+
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
39+
slackalert="off"
40+
slackwebhook="webhook"
41+
42+
# Email Alerts | https://docs.linuxgsm.com/alerts/email
43+
emailalert="off"
44+
45+
emailfrom=""
46+
47+
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
48+
iftttalert="off"
49+
ifttttoken="accesstoken"
50+
iftttevent="linuxgsm_alert"
51+
52+
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
53+
mailgunalert="off"
54+
mailguntoken="accesstoken"
55+
mailgundomain="example.com"
56+
mailgunemailfrom="[email protected]"
57+
mailgunemail="[email protected]"
58+
59+
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
60+
pushbulletalert="off"
61+
pushbullettoken="accesstoken"
62+
channeltag=""
63+
64+
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
65+
pushoveralert="off"
66+
pushovertoken="accesstoken"
67+
68+
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
69+
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
70+
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
71+
# any custom string in curl - simple ignore this parameter.
72+
telegramalert="off"
73+
telegramtoken="accesstoken"
74+
telegramchatid=""
75+
curlcustomstring=""
76+
77+
## Backup | https://docs.linuxgsm.com/commands/backup
78+
maxbackups="4"
79+
maxbackupdays="30"
80+
stoponbackup="on"
81+
82+
## Logging | https://docs.linuxgsm.com/features/logging
83+
consolelogging="on"
84+
logdays="7"
85+
86+
## Monitor | https://docs.linuxgsm.com/commands/monitor
87+
# Query delay time
88+
querydelay="1"
89+
90+
#### LinuxGSM Advanced Settings ####
91+
92+
# ANSI Colors
93+
ansi="on"
94+
95+
# Message Display Time
96+
sleeptime="0.5"
97+
98+
# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode
99+
# 1: tmux kill
100+
# 2: CTRL+c
101+
# 3: quit
102+
# 4: quit 120s
103+
# 5: stop
104+
# 6: q
105+
# 7: exit
106+
# 8: 7 Days to Die
107+
# 9: Gold Source
108+
# 10: Teamspeak 3
109+
stopmode="3"
110+
111+
## LinuxGSM Server Details
112+
# Do not edit
113+
gamename="Medal of Honor: Allied Assault"
114+
engine="idtech3"
115+
glibc="2.3"
116+
117+
#### Directories ####
118+
# Edit with care
119+
120+
## Server Specific Directories
121+
systemdir="${serverfiles}/main"
122+
executabledir="${serverfiles}"
123+
executable="./mohaa_lnxded"
124+
servercfg="${servicename}.cfg"
125+
servercfgdefault="server.cfg"
126+
servercfgdir="${serverfiles}"
127+
servercfgfullpath="${serverfiles}/${servercfg}"
128+
129+
## Backup Directory
130+
backupdir="${lgsmdir}/backup"
131+
132+
## Logging Directories
133+
logdir="${rootdir}/log"
134+
gamelogdir="${serverfiles}/Logs"
135+
lgsmlogdir="${logdir}/script"
136+
consolelogdir="${logdir}/console"
137+
lgsmlog="${lgsmlogdir}/${servicename}-script.log"
138+
consolelog="${consolelogdir}/${servicename}-console.log"
139+
alertlog="${lgsmlogdir}/${servicename}-alert.log"
140+
postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
141+
142+
## Logs Naming
143+
lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
144+
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

lgsm/data/serverlist.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ l4d,l4dserver,Left 4 Dead
5050
l4d2,l4d2server,Left 4 Dead 2
5151
mc,mcserver,Minecraft
5252
mh,mhserver,MORDHAU
53+
mohaa,mohaaserver,Medal of Honor: Allied Assault
5354
mta,mtaserver,Multi Theft Auto
5455
mumble,mumbleserver,Mumble
5556
nd,ndserver,Nuclear Dawn

lgsm/functions/check_deps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ fn_deps_build_debian(){
400400
else
401401
array_deps_required+=( openjdk-8-jre-headless )
402402
fi
403+
# Medal of Honor: Allied Assault
404+
elif [ "${shortname}" == "mohaa" ]; then
405+
array_deps_required+=( libstdc++5:i386 )
403406
# Project Zomboid
404407
elif [ "${shortname}" == "pz" ]; then
405408
if [ -n "$(java -version 2>&1 | grep "version")" ]; then

lgsm/functions/command_monitor.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ if [ "${shortname}" == "sb" ]; then
209209
fi
210210
elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then
211211
fn_monitor_query_tcp
212+
elif [ "${shortname}" == "mohaa" ]; then
213+
# prevent game from using query. Only used if specific game server cant query but engine can
214+
:
212215
else
213216
fn_monitor_query
214217
fi

lgsm/functions/info_config.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,26 @@ fn_info_config_minecraft(){
386386
fi
387387
}
388388

389+
fn_info_config_mohaa(){
390+
if [ ! -f "${servercfgfullpath}" ]; then
391+
rconpassword="${unavailable}"
392+
servername="${unavailable}"
393+
serverpassword="${unavailable}"
394+
maxplayers="${zero}"
395+
else
396+
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]*$//')
397+
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]*$//')
398+
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]*$//')
399+
maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
400+
401+
# Not Set
402+
rconpassword=${rconpassword:-"NOT SET"}
403+
servername=${servername:-"NOT SET"}
404+
serverpassword=${serverpassword:-"NOT SET"}
405+
maxplayers=${maxplayers:-"0"}
406+
fi
407+
}
408+
389409
#Post Scriptum: The bloody Seventh
390410
fn_info_config_pstbs(){
391411
if [ ! -f "${servercfgfullpath}" ]; then
@@ -1290,6 +1310,9 @@ elif [ "${shortname}" == "jc3" ]; then
12901310
# Killing Floor 2
12911311
elif [ "${shortname}" == "kf2" ]; then
12921312
fn_info_config_kf2
1313+
# Medal of Honor: Allied Assault
1314+
elif [ "${shortname}" == "mohaa" ]; then
1315+
fn_info_config_mohaa
12931316
# QuakeWorld
12941317
elif [ "${shortname}" == "qw" ]; then
12951318
fn_info_config_quakeworld

lgsm/functions/info_distro.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)
101101
cpufreqency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
102102
# CPU usage of the game server pid
103103
if [ "${status}" == "1" ]; then
104-
cpuused=$(ps --forest -o pcpu -g "$(ps -o sid= -p "${gameserverpid}")"|awk '{s+=$1} END {print s}')
104+
cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}')
105105
fi
106106

107107
## Memory information
@@ -139,9 +139,9 @@ if [ -n "$(command -v numfmt 2>/dev/null)" ]; then
139139
# RAM usage of the game server pid
140140
# MB
141141
if [ "${status}" == "1" ]; then
142-
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}')
142+
memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}')
143143
# %
144-
pmemused=$(ps --forest -o %mem -g "$(ps -o sid= -p "${gameserverpid}")"|awk '{s+=$1} END {print s}')
144+
pmemused=$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}')
145145
fi
146146
else
147147
# Older distros will need to use free.

lgsm/functions/info_messages.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ fn_info_message_script(){
397397
# LinuxGSM version: v19.9.0
398398
# glibc required: 2.15
399399
# Discord alert: off
400-
# Slack alert: off
400+
# Slack alert: off
401401
# Email alert: off
402402
# Pushbullet alert: off
403403
# IFTTT alert: off
@@ -811,6 +811,15 @@ fn_info_message_minecraft(){
811811
} | column -s $'\t' -t
812812
}
813813

814+
fn_info_message_mohaa(){
815+
echo -e "netstat -atunp | grep mohaa_lnxded"
816+
echo -e ""
817+
{
818+
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
819+
echo -e "> Game\tINBOUND\t${port}\tudp"
820+
} | column -s $'\t' -t
821+
}
822+
814823
fn_info_message_mumble(){
815824
echo -e "netstat -atunp | grep murmur"
816825
echo -e ""
@@ -1363,6 +1372,8 @@ fn_info_message_select_engine(){
13631372
fn_info_message_towerunite
13641373
elif [ "${shortname}" == "unt" ]; then
13651374
fn_info_message_unturned
1375+
elif [ "${shortname}" == "mohaa" ]; then
1376+
fn_info_message_mohaa
13661377
elif [ "${shortname}" == "mh" ]; then
13671378
fn_info_message_mordhau
13681379
elif [ "${shortname}" == "mta" ]; then

lgsm/functions/info_parms.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ fn_info_parms_mordhau(){
8383
beaconport=${beaconport:-"0"}
8484
}
8585

86+
fn_info_parms_mohaa(){
87+
port=${port:-"0"}
88+
queryport=${port:-"0"}
89+
defaultmap=${defaultmap:-"NOT SET"}
90+
}
91+
8692
fn_info_parms_projectzomboid(){
8793
adminpassword=${adminpassword:-"NOT SET"}
8894
}
@@ -235,6 +241,8 @@ elif [ "${shortname}" == "inss" ]; then
235241
fn_info_parms_inss
236242
elif [ "${shortname}" == "kf2" ]; then
237243
fn_info_parms_kf2
244+
elif [ "${shortname}" == "mohaa" ]; then
245+
fn_info_parms_mohaa
238246
# Project Zomboid
239247
elif [ "${shortname}" == "pz" ]; then
240248
fn_info_parms_projectzomboid

lgsm/functions/install_config.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ elif [ "${shortname}" == "mc" ]; then
440440
fn_fetch_default_config
441441
fn_default_config_remote
442442
fn_set_config_vars
443+
elif [ "${shortname}" == "mohaa" ]; then
444+
gamedirname="MedalOfHonorAlliedAssault"
445+
array_configs+=( server.cfg )
446+
fn_fetch_default_config
447+
fn_default_config_remote
448+
fn_set_config_vars
443449
elif [ "${shortname}" == "mh" ]; then
444450
gamedirname="Mordhau"
445451
fn_check_cfgdir

lgsm/functions/install_server_files.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ fn_install_server_files(){
2929
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"
3030
elif [ "${shortname}" == "ges" ]; then
3131
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"
32+
elif [ "${shortname}" == "mohaa" ]; then
33+
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"
3234
elif [ "${shortname}" == "ns" ]; then
3335
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"
3436
elif [ "${shortname}" == "q2" ]; then

0 commit comments

Comments
 (0)