Преглед изворни кода

Merge branch 'release/v20.6.0'

Daniel Gibbs пре 5 година
родитељ
комит
01f8265e83
45 измењених фајлова са 603 додато и 529 уклоњено
  1. 4 5
      .github/workflows/git-sync.yml
  2. 4 1
      lgsm/config-default/config-lgsm/mcserver/_default.cfg
  3. 22 23
      lgsm/config-default/config-lgsm/pvrserver/_default.cfg
  4. 0 181
      lgsm/config-default/config-lgsm/ss3server/_default.cfg
  5. 1 2
      lgsm/data/serverlist.csv
  6. 1 1
      lgsm/functions/alert_discord.sh
  7. 1 1
      lgsm/functions/alert_ifttt.sh
  8. 1 1
      lgsm/functions/alert_mailgun.sh
  9. 1 1
      lgsm/functions/alert_pushbullet.sh
  10. 1 1
      lgsm/functions/alert_pushover.sh
  11. 1 1
      lgsm/functions/alert_rocketchat.sh
  12. 1 1
      lgsm/functions/alert_slack.sh
  13. 1 1
      lgsm/functions/alert_telegram.sh
  14. 13 10
      lgsm/functions/check_deps.sh
  15. 3 0
      lgsm/functions/check_system_requirements.sh
  16. 2 0
      lgsm/functions/command_debug.sh
  17. 23 0
      lgsm/functions/command_mods_install.sh
  18. 25 6
      lgsm/functions/command_mods_remove.sh
  19. 4 2
      lgsm/functions/command_monitor.sh
  20. 2 0
      lgsm/functions/command_start.sh
  21. 14 14
      lgsm/functions/command_update_linuxgsm.sh
  22. 11 7
      lgsm/functions/core_dl.sh
  23. 5 10
      lgsm/functions/core_functions.sh
  24. 1 1
      lgsm/functions/core_getopt.sh
  25. 3 5
      lgsm/functions/fix.sh
  26. 0 10
      lgsm/functions/fix_ges.sh
  27. 33 0
      lgsm/functions/fix_samp.sh
  28. 1 1
      lgsm/functions/fix_squad.sh
  29. 0 23
      lgsm/functions/fix_ss3.sh
  30. 2 0
      lgsm/functions/fix_steamcmd.sh
  31. 17 79
      lgsm/functions/info_config.sh
  32. 3 3
      lgsm/functions/info_distro.sh
  33. 13 14
      lgsm/functions/info_messages.sh
  34. 7 23
      lgsm/functions/info_parms.sh
  35. 7 21
      lgsm/functions/install_config.sh
  36. 2 4
      lgsm/functions/install_server_files.sh
  37. 248 0
      lgsm/functions/mods_core.sh
  38. 80 19
      lgsm/functions/mods_list.sh
  39. 1 1
      lgsm/functions/query_gamedig.sh
  40. 20 45
      lgsm/functions/update_minecraft.sh
  41. 4 3
      linuxgsm.sh
  42. 5 2
      tests/tests_fctrserver.sh
  43. 5 2
      tests/tests_jc2server.sh
  44. 5 2
      tests/tests_mcserver.sh
  45. 5 2
      tests/tests_ts3server.sh

+ 4 - 5
.github/workflows/git-sync.yml

@@ -11,17 +11,16 @@ jobs:
   repo-sync:
     runs-on: ubuntu-latest
     steps:
-    - name: ssh
-      uses: webfactory/ssh-agent@v0.2.0
+    - name: webfactory/ssh-agent
+      uses: webfactory/ssh-agent@v0.4.1
       with:
         ssh-private-key: ${{ secrets.BITBUCKET_SECRET }}
-        ssh_private_key: ${{ secrets.BITBUCKET_SECRET }}
 
     - name: repo-sync
-      uses: wei/git-sync@v2
+      uses: wei/git-sync@v2.1.0
       with:
+        ssh_private_key: ${{ secrets.BITBUCKET_SECRET }}
         source_repo: "https://github.com/GameServerManagers/LinuxGSM"
         source_branch: "refs/heads/*"
         destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git"
         destination_branch: "refs/heads/*"
-        ssh_private_key: ${{ secrets.BITBUCKET_SECRET }}

+ 4 - 1
lgsm/config-default/config-lgsm/mcserver/_default.cfg

@@ -16,8 +16,11 @@ fn_parms(){
 parms="nogui"
 }
 
-## Branch, "snapshot" include snapshot and pre-release versions. | (release|snapshot)
+## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings
+# Branch (release|snapshot)
 branch="release"
+# Version (latest|1.16)
+mcversion="latest"
 
 #### LinuxGSM Settings ####
 

+ 22 - 23
lgsm/config-default/config-lgsm/gesserver/_default.cfg → lgsm/config-default/config-lgsm/pvrserver/_default.cfg

@@ -10,15 +10,14 @@
 
 ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
 ip="0.0.0.0"
-port="27015"
-clientport="27005"
-sourcetvport="27020"
-defaultmap="ge_archives"
-maxplayers="16"
+port="7777"
+
+# Maps: bridge, datacenter, sand
+defaultmap="datacenter"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
 fn_parms(){
-parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+parms="${defaultmap} -log -MultiHome=${ip} -Port=${port}"
 }
 
 #### LinuxGSM Settings ####
@@ -113,12 +112,12 @@ sleeptime="0.5"
 
 ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
 # Server appid
-appid="310" # Source 2007 SDK
+appid="622970"
 # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
 branch=""
 betapassword=""
 # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
-steammaster="true"
+steammaster="false"
 
 ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
 # 1: tmux kill
@@ -132,7 +131,7 @@ steammaster="true"
 # 9: GoldSrc
 # 10: Avorion
 # 11: end
-stopmode="3"
+stopmode="2"
 
 ## Query mode
 # 1: session only
@@ -140,29 +139,29 @@ stopmode="3"
 # 3: gamedig
 # 4: gsquery
 # 5: tcp
-querymode="2"
-querytype="protocol-valve"
+querymode="1"
+querytype=""
 
 ## Console type
-consoleverbose="yes"
-consoleinteract="yes"
+consoleverbose="no"
+consoleinteract="no"
 
 ## Game Server Details
 # Do not edit
-gamename="GoldenEye: Source"
-engine="source"
-glibc="2.15"
+gamename="Pavlov VR"
+engine="unreal4"
+glibc="2.17"
 
 #### Directories ####
 # Edit with care
 
 ## Game Server Directories
-systemdir="${serverfiles}/gesource"
-executabledir="${serverfiles}"
-executable="./srcds_run"
-servercfgdir="${systemdir}/cfg"
-servercfg="${selfname}.cfg"
-servercfgdefault="server.cfg"
+systemdir="${serverfiles}/Pavlov"
+executabledir="${systemdir}/Binaries/Linux"
+executable="./PavlovServer"
+servercfgdir="${systemdir}/Saved/Config/LinuxServer"
+servercfg="Game.ini"
+servercfgdefault="Game.ini"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 
 ## Backup Directory
@@ -170,7 +169,7 @@ backupdir="${lgsmdir}/backup"
 
 ## Logging Directories
 logdir="${rootdir}/log"
-gamelogdir="${systemdir}/logs"
+gamelogdir="${systemdir}/Saved/Logs"
 lgsmlogdir="${logdir}/script"
 consolelogdir="${logdir}/console"
 lgsmlog="${lgsmlogdir}/${selfname}-script.log"

+ 0 - 181
lgsm/config-default/config-lgsm/ss3server/_default.cfg

@@ -1,181 +0,0 @@
-##################################
-######## Default Settings ########
-##################################
-# DO NOT EDIT, ANY CHANGES 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.
-
-#### Game Server Settings ####
-
-## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
-ip="0.0.0.0"
-
-## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-# Edit with care | https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt
-fn_parms(){
-parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}"
-}
-
-#### LinuxGSM Settings ####
-
-## LinuxGSM Stats
-# Send useful stats to LinuxGSM developers.
-# https://docs.linuxgsm.com/configuration/linuxgsm-stats
-# (on|off)
-stats="off"
-
-## 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"
-
-# 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"
-mailgunapiregion="us"
-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"
-pushoveruserkey="userkey"
-
-# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
-rocketchatalert="off"
-rocketchatwebhook="webhook"
-rocketchattoken=""
-
-# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
-slackalert="off"
-slackwebhook="webhook"
-
-# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
-# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
-# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
-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"
-
-## Monitor | https://docs.linuxgsm.com/commands/monitor
-# Query delay time
-querydelay="1"
-
-## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
-ansi="on"
-
-#### Advanced Settings ####
-
-## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
-sleeptime="0.5"
-
-## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
-# Server appid
-appid="41080"
-# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
-branch=""
-betapassword=""
-# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
-steammaster="false"
-
-## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
-# 1: tmux kill
-# 2: CTRL+c
-# 3: quit
-# 4: quit 120s
-# 5: stop
-# 6: q
-# 7: exit
-# 8: 7 Days to Die
-# 9: GoldSrc
-# 10: Avorion
-# 11: end
-stopmode="2"
-
-## Query mode
-# 1: session only
-# 2: gamedig (gsquery fallback)
-# 3: gamedig
-# 4: gsquery
-# 5: tcp
-querymode="2"
-querytype="protocol-valve"
-
-## Console type
-consoleverbose=""
-consoleinteract=""
-
-## Game Server Details
-# Do not edit
-gamename="Serious Sam 3: BFE"
-engine="seriousengine35"
-glibc="2.13"
-
-#### Directories ####
-# Edit with care
-
-## Game Server Directories
-systemdir="${serverfiles}/Bin"
-executabledir="${systemdir}"
-executable="./runSam3_DedicatedServer.sh"
-servercfgdir="${serverfiles}/Content/SeriousSam3/Config"
-servercfg="${selfname}.ini"
-servercfgdefault="server.ini"
-servercfgfullpath="${servercfgdir}/${servercfg}"
-
-## Backup Directory
-backupdir="${lgsmdir}/backup"
-
-## Logging Directories
-logdir="${rootdir}/log"
-gamelogdir="${logdir}/server"
-lgsmlogdir="${logdir}/script"
-consolelogdir="${logdir}/console"
-gamelog="${gamelogdir}/${selfname}-game.log"
-lgsmlog="${lgsmlogdir}/${selfname}-script.log"
-consolelog="${consolelogdir}/${selfname}-console.log"
-alertlog="${lgsmlogdir}/${selfname}-alert.log"
-postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
-
-## Logs Naming
-lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
-consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
-gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log"

+ 1 - 2
lgsm/data/serverlist.csv

@@ -37,7 +37,6 @@ em,emserver,Empires Mod
 etl,etlserver,ET: Legacy
 fctr,fctrserver,Factorio
 fof,fofserver,Fistful of Frags
-ges,gesserver,GoldenEye: Source
 gmod,gmodserver,Garrys Mod
 hl2dm,hl2dmserver,Half-Life 2: Deathmatch
 hldm,hldmserver,Half-Life: Deathmatch
@@ -70,6 +69,7 @@ opfor,opforserver,Opposing Force
 pc,pcserver,Project Cars
 pstbs,pstbsserver,Post Scriptum: The Bloody Seventh
 pvkii,pvkiiserver,Pirates Vikings & Knights II
+pvr,pvrserver,Pavlov VR
 pz,pzserver,Project Zomboid
 q2,q2server,Quake 2
 q3,q3server,Quake 3: Arena
@@ -88,7 +88,6 @@ sfc,sfcserver,SourceForts Classic
 sof2,sof2server,Soldier Of Fortune 2: Gold Edition
 sol,solserver,Soldat
 squad,squadserver,Squad
-ss3,ss3server,Serious Sam 3: BFE
 st,stserver,Stationeers
 sven,svenserver,Sven Co-op
 terraria,terrariaserver,Terraria

+ 1 - 1
lgsm/functions/alert_discord.sh

@@ -52,7 +52,7 @@ EOF
 
 fn_print_dots "Sending Discord alert"
 
-discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}")
+discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}")
 
 if [ -n "${discordsend}" ]; then
 	fn_print_fail_nl "Sending Discord alert: ${discordsend}"

+ 1 - 1
lgsm/functions/alert_ifttt.sh

@@ -16,7 +16,7 @@ EOF
 )
 
 fn_print_dots "Sending IFTTT alert"
-iftttsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request")
+iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request")
 
 if [ -n "${iftttsend}" ]; then
 	fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}"

+ 1 - 1
lgsm/functions/alert_mailgun.sh

@@ -14,7 +14,7 @@ fi
 
 fn_print_dots "Sending Email alert: Mailgun: ${email}"
 
-mailgunsend=$(curl -s --user "api:${mailguntoken}" \
+mailgunsend=$(curl --connect-timeout 10 -s --user "api:${mailguntoken}" \
 -F from="LinuxGSM <${mailgunemailfrom}>" \
 -F to="LinuxGSM Admin <${mailgunemail}>" \
 -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \

+ 1 - 1
lgsm/functions/alert_pushbullet.sh

@@ -17,7 +17,7 @@ EOF
 )
 
 fn_print_dots "Sending Pushbullet alert"
-pushbulletsend=$(curl -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.pushbullet.com/v2/pushes" | grep "error_code")
+pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.pushbullet.com/v2/pushes" | grep "error_code")
 
 if [ -n "${pushbulletsend}" ]; then
 	fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}"

+ 1 - 1
lgsm/functions/alert_pushover.sh

@@ -21,7 +21,7 @@ else
 	alertpriority="0"
 fi
 
-pushoversend=$(curl -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}"  -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Message</b><br>${alertbody}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${alertip}:${port}'>${alertip}:${port}</a><br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
+pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}"  -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Message</b><br>${alertbody}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${alertip}:${port}'>${alertip}:${port}</a><br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
 
 if [ -n "${pushoversend}" ]; then
 	fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"

+ 1 - 1
lgsm/functions/alert_rocketchat.sh

@@ -42,7 +42,7 @@ EOF
 
 fn_print_dots "Sending Rocketchat alert"
 
-rocketchatsend=$(curl -sSL -H "Content-Type:application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${rocketchatwebhook}")
+rocketchatsend=$(curl --connect-timeout 10 -sSL -H "Content-Type:application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${rocketchatwebhook}")
 
 if [ -n "${rocketchatsend}" ]; then
 	fn_print_ok_nl "Sending Rocketchat alert"

+ 1 - 1
lgsm/functions/alert_slack.sh

@@ -67,7 +67,7 @@ EOF
 
 fn_print_dots "Sending Slack alert"
 
-slacksend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${slackwebhook}")
+slacksend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${slackwebhook}")
 
 if [ "${slacksend}" == "ok" ]; then
 	fn_print_ok_nl "Sending Slack alert"

+ 1 - 1
lgsm/functions/alert_telegram.sh

@@ -16,7 +16,7 @@ EOF
 )
 
 fn_print_dots "Sending Telegram alert"
-telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code")
+telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code")
 
 if [ -n "${telegramsend}" ]; then
 	fn_print_fail_nl "Sending Telegram alert: ${telegramsend}"

+ 13 - 10
lgsm/functions/check_deps.sh

@@ -185,7 +185,7 @@ if [ "${javacheck}" == "1" ]; then
 		# Define required dependencies for SteamCMD.
 		if [ "${appid}" ]; then
 			# lib32gcc1 is now called lib32gcc-s1 in debian 11
-			if [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; then
+			if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }; then
 				if [ "${deptocheck}" ==  "glibc.i686" ]||[ "${deptocheck}" ==  "libstdc++64.i686" ]||[ "${deptocheck}" ==  "lib32gcc-s1" ]||[ "${deptocheck}" ==  "lib32stdc++6" ]; then
 					steamcmdfail=1
 				fi
@@ -349,7 +349,7 @@ fn_deps_build_debian(){
 	if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
 		if [ "${arch}" == "x86_64" ]; then
 			# lib32gcc1 is now called lib32gcc-s1 in debian 11
-			if [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; then
+			if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }|| { [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }; then
 				array_deps_required+=( lib32gcc-s1 lib32stdc++6 )
 			else
 				array_deps_required+=( lib32gcc1 lib32stdc++6 )
@@ -382,8 +382,11 @@ fn_deps_build_debian(){
 	# Battlefield: Vietnam
 	elif [ "${shortname}" == "bfv" ]; then
 		array_deps_required+=( libncurses5:i386 libstdc++5:i386 )
-	# Battlefield 1942, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source
-	elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then
+	# Battlefield 1942
+	elif [ "${shortname}" == "bf1942" ]; then
+		array_deps_required+=( libncurses5:i386 libtinfo5:i386 )
+	# Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source
+	elif [ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then
 		if [ "${arch}" == "x86_64" ]; then
 			array_deps_required+=( libtinfo5:i386 )
 		else
@@ -395,6 +398,9 @@ fn_deps_build_debian(){
 	# Call of Duty & Medal of Honor: Allied Assault
 	elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then
 		array_deps_required+=( libstdc++5:i386 )
+	# Barotrauma
+	elif [ "${shortname}" == "bt" ]; then
+		array_deps_required+=( libicu-dev )
 	# Ecoserver
 	elif [ "${shortname}" == "eco" ]; then
 		array_deps_required+=( libgdiplus )
@@ -425,9 +431,6 @@ fn_deps_build_debian(){
 		else
 			array_deps_required+=( default-jre rng-tools )
 		fi
-	# GoldenEye: Source
-	elif [ "${shortname}" == "ges" ]; then
-		array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 )
 	# Sven Co-op
 	elif [ "${shortname}" == "sven" ]; then
 		array_deps_required+=( libssl1.1:i386 zlib1g:i386 )
@@ -492,6 +495,9 @@ fn_deps_build_redhat(){
 	# 7 Days to Die
 	elif [ "${shortname}" == "sdtd" ]; then
 		array_deps_required+=( telnet expect )
+	# Barotrauma
+	elif [ "${shortname}" == "bt" ]; then
+		array_deps_required+=( libicu )
 	# Battlefield: Vietnam
 	elif [ "${shortname}" == "bfv" ]; then
 		array_deps_required+=( compat-libstdc++-33.i686 glibc.i686 )
@@ -534,9 +540,6 @@ fn_deps_build_redhat(){
 		else
 			array_deps_required+=( java-11-openjdk rng-tools )
 		fi
-	# GoldenEye: Source
-	elif [ "${shortname}" == "ges" ]; then
-		array_deps_required+=( zlib.i686 openldap.i686 )
 	# Sven Co-op
 	elif [ "${shortname}" == "sven" ]; then
 		: # not compatible

+ 3 - 0
lgsm/functions/check_system_requirements.sh

@@ -38,6 +38,9 @@ elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then
 elif [ "${shortname}" == "st" ]; then
 	ramrequirementmb="1000"
 	ramrequirementgb="1"
+elif [ "${shortname}" == "pvr" ];then
+	ramrequirementmb="2000"
+	ramrequirementgb="2"
 fi
 
 # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.

+ 2 - 0
lgsm/functions/command_debug.sh

@@ -95,6 +95,8 @@ fn_print_ok_nl "Starting debug"
 
 # Create lockfile.
 date '+%s' > "${lockdir}/${selfname}.lock"
+echo "${version}" >> "${lockdir}/${selfname}.lock"
+echo "${port}" >> "${lockdir}/${selfname}.lock"
 fn_script_log_info "Lockfile generated"
 fn_script_log_info "${lockdir}/${selfname}.lock"
 

+ 23 - 0
lgsm/functions/command_mods_install.sh

@@ -95,6 +95,18 @@ if [ -f "${modsinstalledlistfullpath}" ]; then
 fi
 
 ## Installation.
+# If amxmodx check if metamod exists first
+if [ "${modcommand}" == "amxmodx" ]; then
+	fn_mod_exist "metamod"
+fi
+
+if [ "${modcommand}" == "amxmodxcs"  ] ||
+   [ "${modcommand}" == "amxmodxdod" ] ||
+   [ "${modcommand}" == "amxmodxtfc" ] ||
+   [ "${modcommand}" == "amxmodxns"  ] ||
+   [ "${modcommand}" == "amxmodxts"  ]; then
+	fn_mod_exist "amxmodx"
+fi
 
 fn_create_mods_dir
 fn_mods_clear_tmp_dir
@@ -106,6 +118,17 @@ fn_mod_copy_destination
 fn_mod_add_list
 fn_mod_tidy_files_list
 fn_mods_clear_tmp_dir
+
+# Create/modify existing liblist.gam file for Metamod
+if [ "${modcommand}" == "metamod" ]; then
+	fn_mod_install_liblist_gam_file
+fi
+
+# Create/modify plugins.ini file for Metamod
+if [ "${modcommand}" == "amxmodx" ]; then
+	fn_mod_install_amxmodx_file
+fi
+
 echo -e "${modprettyname} installed"
 fn_script_log_pass "${modprettyname} installed."
 

+ 25 - 6
lgsm/functions/command_mods_remove.sh

@@ -37,7 +37,7 @@ while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do
 	read -r usermodselect
 	# Exit if user says exit or abort.
 	if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then
-			core_exit.sh
+		core_exit.sh
 	# Supplementary output upon invalid user input.
 	elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then
 		fn_print_error2_nl "${usermodselect} is not a valid addon/mod."
@@ -82,17 +82,25 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do
 	echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..."
 	((modfileline++))
 done
-if [ "${exitcode}" != 0 ]; then
-	fn_print_fail_eol_nl
-	core_exit.sh
+
+# Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will
+# not be found when removing the base (amxmodx) mod
+if [ "${modcommand}" != "amxmodx" ]; then
+	if [ "${exitcode}" != 0 ]; then
+		fn_print_fail_eol_nl
+		core_exit.sh
+	else
+		fn_print_ok_eol_nl
+	fi
 else
 	fn_print_ok_eol_nl
 fi
+
 # Remove file list.
 echo -en "removing ${modcommand}-files.txt..."
 fn_sleep_time
 rm -rf "${modsdir:?}/${modcommand}-files.txt"
-local exitcode=$?
+exitcode=$?
 if [ "${exitcode}" != 0 ]; then
 	fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt"
 	fn_print_fail_eol_nl
@@ -107,7 +115,7 @@ echo -en "removing ${modcommand} from ${modsinstalledlist}..."
 fn_sleep_time
 
 sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}"
-local exitcode=$?
+exitcode=$?
 if [ "${exitcode}" != 0 ]; then
 	fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}"
 	fn_print_fail_eol_nl
@@ -127,6 +135,17 @@ if [ "${engine}" == "unity3d" ]&&[[ "${modprettyname}" == *"Oxide"* ]]; then
 	fn_firstcommand_reset
 	unset exitbypass
 fi
+
+# Remove/modify existing liblist.gam file for Metamod
+if [ "${modcommand}" == "metamod" ]; then
+	fn_mod_remove_liblist_gam_file
+fi
+
+# Remove/modify plugins.ini file for AMX Mod X
+if [ "${modcommand}" == "amxmodx" ]; then
+	fn_mod_remove_amxmodx_file
+fi
+
 echo -e "${modprettyname} removed"
 fn_script_log "${modprettyname} removed"
 

+ 4 - 2
lgsm/functions/command_monitor.sh

@@ -25,8 +25,10 @@ fn_monitor_check_lockfile(){
 	fi
 
 	# Fix if lockfile is not unix time or contains letters
-	if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then
-			date '+%s' > "${lockdir}/${selfname}.lock"
+	if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then
+		date '+%s' > "${lockdir}/${selfname}.lock"
+		echo "${version}" >> "${lockdir}/${selfname}.lock"
+		echo "${port}" >> "${lockdir}/${selfname}.lock"
 	fi
 }
 

+ 2 - 0
lgsm/functions/command_start.sh

@@ -71,6 +71,8 @@ fn_start_tmux(){
 
 	# Create lockfile
 	date '+%s' > "${lockdir}/${selfname}.lock"
+	echo "${version}" >> "${lockdir}/${selfname}.lock"
+	echo "${port}" >> "${lockdir}/${selfname}.lock"
 	cd "${executabledir}" || exit
 	tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp"
 

+ 14 - 14
lgsm/functions/command_update_linuxgsm.sh

@@ -17,9 +17,9 @@ fn_script_log_info "Updating LinuxGSM"
 fn_print_dots "Selecting repo"
 fn_script_log_info "Selecting repo"
 # Select remotereponame
-curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
+curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
 if [ $? != "0" ]; then
-	curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
+	curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
 	if [ $? != "0" ]; then
 		fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
 		fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
@@ -36,9 +36,9 @@ fi
 # Check linuxsm.sh
 echo -en "checking ${remotereponame} linuxgsm.sh...\c"
 if [ "${remotereponame}" == "GitHub" ]; then
-	curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
+	curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
 else
-	curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
+	curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
 fi
 if [ $? != "0" ]; then
 	fn_print_fail_eol_nl
@@ -48,9 +48,9 @@ if [ $? != "0" ]; then
 fi
 
 if [ "${remotereponame}" == "GitHub" ]; then
-	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
+	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
 else
-	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh"))
+	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh"))
 fi
 
 if [ "${tmp_script_diff}" != "" ]; then
@@ -116,9 +116,9 @@ fi
 echo -en "checking ${remotereponame} config _default.cfg...\c"
 fn_script_log_info "Checking ${remotereponame} config _default.cfg"
 if [ "${remotereponame}" == "GitHub" ]; then
-	curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
+	curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
 else
-	curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
+	curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
 fi
 if [ $? != "0" ]; then
 	fn_print_fail_eol_nl
@@ -128,9 +128,9 @@ if [ $? != "0" ]; then
 fi
 
 if [ "${remotereponame}" == "GitHub" ]; then
-	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
+	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
 else
-	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
+	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
 fi
 
 if [ "${config_file_diff}" != "" ]; then
@@ -155,9 +155,9 @@ if [ -n "${functionsdir}" ]; then
 			echo -en "checking ${remotereponame} module ${functionfile}...\c"
 			github_file_url_dir="lgsm/functions"
 			if [ "${remotereponame}" == "GitHub" ]; then
-				curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
+				curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
 			else
-				curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
+				curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
 			fi
 			if [ $? != 0 ]; then
 				fn_print_error_eol_nl
@@ -174,9 +174,9 @@ if [ -n "${functionsdir}" ]; then
 			else
 				# compare file
 				if [ "${remotereponame}" == "GitHub" ]; then
-					function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
+					function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
 				else
-					function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}"))
+					function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}"))
 				fi
 
 				# results

+ 11 - 7
lgsm/functions/core_dl.sh

@@ -267,11 +267,11 @@ fn_fetch_file(){
 				echo -en "downloading ${local_filename}..."
 				fn_sleep_time
 				echo -en "\033[1K"
-				curlcmd=$(curl --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}")
+				curlcmd=$(curl --connect-timeout 10 --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}")
 				echo -en "downloading ${local_filename}..."
 			else
 				echo -en "fetching ${fileurl_name} ${local_filename}...\c"
-				curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1)
+				curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1)
 			fi
 			local exitcode=$?
 
@@ -349,11 +349,12 @@ fn_fetch_file(){
 fn_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
+	# For legacy versions - code can be removed at a future date
 	if [ "${legacymode}" == "1" ]; then
-		# For legacy versions - code can be removed at a future date
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
-	elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	elif [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -376,7 +377,8 @@ fn_fetch_file_github(){
 fn_fetch_config(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -399,7 +401,8 @@ fn_fetch_config(){
 fn_fetch_function(){
 	github_file_url_dir="lgsm/functions"
 	github_file_url_name="${functionfile}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+		# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -422,7 +425,8 @@ fn_fetch_function(){
 fn_update_function(){
 	github_file_url_dir="lgsm/functions"
 	github_file_url_name="${functionfile}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else

+ 5 - 10
lgsm/functions/core_functions.sh

@@ -7,7 +7,7 @@
 
 functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
-modulesversion="v20.5.1"
+modulesversion="v20.6.0"
 
 # Core
 
@@ -340,11 +340,6 @@ functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }
 
-fix_ges.sh(){
-functionfile="${FUNCNAME[0]}"
-fn_fetch_function
-}
-
 fix_hw.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
@@ -435,22 +430,22 @@ functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }
 
-fix_sdtd.sh(){
+fix_samp.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }
 
-fix_sof2.sh(){
+fix_sdtd.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }
 
-fix_squad.sh(){
+fix_sof2.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }
 
-fix_ss3.sh(){
+fix_squad.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -125,7 +125,7 @@ if [ "${shortname}" == "squad" ]; then
 fi
 
 ## Mods commands.
-if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then
+if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]||[ "${shortname}" == "cs" ]||[ "${shortname}" == "dod" ]||[ "${shortname}" == "tfc" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "hldm" ]; then
 	currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" )
 fi
 

+ 3 - 5
lgsm/functions/fix.sh

@@ -48,8 +48,6 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
 		fix_cmw.sh
 	elif [ "${shortname}" == "dst" ]; then
 		fix_dst.sh
-	elif [ "${shortname}" == "ges" ]; then
-		fix_ges.sh
 	elif [ "${shortname}" == "hw" ]; then
 		fix_hw.sh
 	elif [ "${shortname}" == "ins" ]; then
@@ -70,8 +68,6 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
 		fix_sof2.sh
 	elif [ "${shortname}" == "squad" ]; then
 		fix_squad.sh
-	elif [ "${shortname}" == "ss3" ]; then
-		fix_ss3.sh
 	elif [ "${shortname}" == "st" ]; then
 		fix_st.sh
 	elif [ "${shortname}" == "tf2" ]; then
@@ -95,7 +91,7 @@ fi
 
 # Fixes that are run on install only.
 if [ "${commandname}" == "INSTALL" ]; then
-		if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
+		if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
 			echo -e ""
 			echo -e "Applying Post-Install Fixes"
 			echo -e "================================="
@@ -109,6 +105,8 @@ if [ "${commandname}" == "INSTALL" ]; then
 				fix_kf2.sh
 			elif [ "${shortname}" == "ro" ]; then
 				fix_ro.sh
+			elif [ "${shortname}" == "samp" ]; then
+				fix_samp.sh
 			elif [ "${shortname}" == "ut2k4" ]; then
 				fix_ut2k4.sh
 			elif [ "${shortname}" == "ut" ]; then

+ 0 - 10
lgsm/functions/fix_ges.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-# LinuxGSM fix_ges.sh function
-# Author: Daniel Gibbs
-# Website: https://linuxgsm.com
-# Description: Resolves various issues with GoldenEye: Source.
-
-functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-
-# Fixes: MALLOC_CHECK_ needing to be set to 0.
-export MALLOC_CHECK_=0

+ 33 - 0
lgsm/functions/fix_samp.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+# LinuxGSM fix_sfc.sh function
+# Author: Christian Birk
+# Website: https://linuxgsm.com
+# Description: Resolves issue that the default rcon password is not changed
+
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
+if [ -f "${servercfgfullpath}" ]; then
+	# check if default password is set "changeme"
+	currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //' )
+	defaultpass="changeme"
+	# check if default password is set
+	if [ "${currentpass}" == "${defaultpass}" ]; then
+		fixname="change default rcon password"
+		fn_fix_msg_start
+		fn_script_log_info "changing rcon/admin password."
+	       	random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs)
+		rconpass="admin${random}"
+		sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}"
+		fn_fix_msg_end
+	fi
+	# check if the hostname is the default name
+	currenthostname=$(grep -E "^hostname" "${servercfgfullpath}" | sed 's/^hostname //')
+	defaulthostname="SA-MP 0.3 Server"
+	if [ "${currenthostname}" == "${defaulthostname}" ]; then
+		fixname="change default hostname"
+		fn_fix_msg_start
+		fn_script_log_info "changing default hostname to LinuxGSM"
+		sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}"
+		fn_fix_msg_end
+	fi
+fi

+ 1 - 1
lgsm/functions/fix_squad.sh

@@ -6,7 +6,7 @@
 
 # As the server base dir changed for the game, we need to migrate the default config from the old to the new location
 oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}"
-if [ -f "${oldservercfg}" ] && [ -f "${servercfgfullpath}" ]; then
+if [ -f "${oldservercfg}" ]&&[ -f "${servercfgfullpath}" ]; then
 	# diff old and new config - if it is different move the old config over the new one
 	if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then
 		fixname="Migrate server config to new Game folder"

+ 0 - 23
lgsm/functions/fix_ss3.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-# LinuxGSM fix_ss3.sh function
-# Author: Daniel Gibbs
-# Website: https://linuxgsm.com
-# Description: Resolves various issues with Serious Sam 3.
-
-functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-
-# Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/
-if [ -f "${serverfiles}/Bin/steamclient.so" ] && [ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then
-	# delete old steamclient.so file
-	rm -f "${serverfiles}/Bin/steamclient.so"
-	fn_fix_steamclient_so "32" "${serverfiles}/Bin"
-fi
-
-# Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory
-if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then
-	fixname="libsteam.so"
-	fn_fix_msg_start
-	mkdir -p "${HOME}/.steam/bin32"
-	cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so"
-	fn_fix_msg_end
-fi

+ 2 - 0
lgsm/functions/fix_steamcmd.sh

@@ -84,6 +84,8 @@ elif [ "${shortname}" == "ins" ]; then
 elif [ "${shortname}" == "pz" ]; then
 	fn_fix_steamclient_so "32" "${serverfiles}/linux32"
 	fn_fix_steamclient_so "64" "${serverfiles}/linux64"
+elif [ "${shortname}" == "pvr" ]; then
+	fn_fix_steamclient_so "64" "${executabledir}"
 elif [ "${shortname}" == "ss3" ]; then
 	fn_fix_steamclient_so "32" "${serverfiles}/Bin"
 elif [ "${shortname}" == "tu" ];then

+ 17 - 79
lgsm/functions/info_config.sh

@@ -188,7 +188,7 @@ fn_info_config_bf1942(){
 		queryport="${zero}"
 	else
 
-		servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs)
+		servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs)
 		serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs)
 		maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
@@ -827,29 +827,6 @@ fn_info_config_rtcw(){
 	fi
 }
 
-fn_info_config_seriousengine35(){
-	if [ ! -f "${servercfgfullpath}" ]; then
-		servername="${unavailable}"
-		rconpassword="${unavailable}"
-		gamemode="${unavailable}"
-		maxplayers="${zero}"
-		port="${zero}"
-	else
-		servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
-		rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
-		gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
-		maxplayers=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
-		port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
-
-		# Not Set
-		servername=${servername:-"NOT SET"}
-		rconpassword=${rconpassword:-"NOT SET"}
-		gamemode=${gamemode:-"NOT SET"}
-		maxplayers=${maxplayers:-"0"}
-		port=${port:-"0"}
-	fi
-}
-
 #StickyBots
 fn_info_config_sbots(){
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -1534,162 +1511,122 @@ fn_info_config_soldat(){
 	fi
 }
 
-# Assetto Corsa
+fn_info_config_pavlovvr(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		servername="${unavailable}"
+		maxplayers="${unavailable}"
+	else
+		servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+		maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}')
+
+		# Not set
+		servername=${servername:-"NOT SET"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
+
 if [ "${shortname}" == "ac" ]; then
 	fn_info_config_assettocorsa
-# ARK: Survival Evolved
 elif [ "${shortname}" == "ark" ]; then
 	fn_info_config_ark
-# Avorion
 elif [ "${shortname}" == "av" ]; then
 	fn_info_config_avorion
-# Ballistic Overkill
 elif [ "${shortname}" == "bo" ]; then
 	fn_info_config_ballistic_overkill
-# Barotrauma
 elif [ "${shortname}" == "bt" ]; then
 	fn_info_config_barotrauma
-# Battalion 1944
 elif [ "${shortname}" == "bt1944" ]; then
 	fn_info_config_battalion1944
-# Battlefield: 1942
 elif [ "${shortname}" == "bf1942" ]; then
 	fn_info_config_bf1942
-# Battlefield: Vietnam
 elif [ "${shortname}" == "bfv" ]; then
 	fn_info_config_bfv
-# Chivalry: Medieval Warfare
 elif [ "${shortname}" == "cmw" ]; then
 	fn_info_config_chivalry
-# Call of Duty
 elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then
 	fn_info_config_cod
-# Call of Duty 2
 elif [ "${shortname}" == "cod2" ]; then
 	fn_info_config_cod2
-# Call of Duty 4
 elif [ "${shortname}" == "cod4" ]; then
 	fn_info_config_cod4
-# Call of Duty: World at War
 elif [ "${shortname}" == "codwaw" ]; then
 	fn_info_config_codwaw
-# Dont Starve Together
 elif [ "${shortname}" == "dst" ]; then
 	fn_info_config_dontstarve
-# Eco
 elif [ "${shortname}" == "eco" ]; then
 	fn_info_config_eco
-# Factorio
 elif [ "${shortname}" == "fctr" ]; then
 	fn_info_config_factorio
-# Insurgency: Sandstorm
 elif [ "${shortname}" == "inss" ]; then
 	fn_info_config_inss
-# Just Cause 2
 elif [ "${shortname}" == "jc2" ]; then
 	fn_info_config_justcause2
-# Just Cause 3
 elif [ "${shortname}" == "jc3" ]; then
 	fn_info_config_justcause3
-# Killing Floor 2
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_config_kf2
-# Medal of Honor: Allied Assault
 elif [ "${shortname}" == "mohaa" ]; then
 	fn_info_config_mohaa
-# Memories of Mars
 elif [ "${shortname}" == "mofm" ]; then
 	fn_info_config_mofm
-# QuakeWorld
 elif [ "${shortname}" == "qw" ]; then
 	fn_info_config_quakeworld
-# Quake 2
 elif [ "${shortname}" == "q2" ]; then
 	fn_info_config_quake2
-# Quake 3
 elif [ "${shortname}" == "q3" ]; then
 	fn_info_config_quake3
-# Quake Live
 elif [ "${shortname}" == "ql" ]; then
 	fn_info_config_quakelive
-# Jedi Knight II: Jedi Outcast
 elif [ "${shortname}" == "jk2" ]; then
 	fn_info_config_jk2
-# Minecraft
 elif [ "${shortname}" == "mc" ]; then
 	fn_info_config_minecraft
-# Minecraft Bedrock
 elif [ "${shortname}" == "mcb" ]; then
 	fn_info_config_minecraft_bedrock
-# Onset
 elif [ "${shortname}" == "onset" ]; then
 	fn_info_config_onset
-# Post Scriptum: The Bloody Seventh
 elif [ "${shortname}" == "pstbs" ]; then
 	fn_info_config_pstbs
-# Project Cars
 elif [ "${shortname}" == "pc" ]; then
 	fn_info_config_projectcars
-# Project Zomboid
 elif [ "${shortname}" == "pz" ]; then
 	fn_info_config_projectzomboid
-# ARMA 3
 elif [ "${shortname}" == "arma3" ]; then
 	fn_info_config_realvirtuality
-# Return to Castle Wolfenstein
 elif [ "${shortname}" == "rtcw" ]; then
 	fn_info_config_rtcw
-# Rising World
 elif [ "${shortname}" == "rw" ]; then
 	fn_info_config_risingworld
-# Serious Sam
-elif [ "${shortname}" == "ss3" ]; then
-	fn_info_config_seriousengine35
-# Soldat
 elif [ "${shortname}" == "sol" ]; then
 	fn_info_config_soldat
-# Soldier Of Fortune 2: Gold Edition
 elif [ "${shortname}" == "sof2" ]; then
 	fn_info_config_sof2
-# Source Engine Games
 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then
 	fn_info_config_source
-# Starbound
 elif [ "${shortname}" == "sb" ]; then
 	fn_info_config_starbound
-# Teamspeak 3
 elif [ "${shortname}" == "ts3" ]; then
 	fn_info_config_teamspeak3
-# Mumble
 elif [ "${shortname}" == "mumble" ]; then
 	fn_info_config_mumble
-# San Andreas Multiplayer
 elif [ "${shortname}" == "samp" ]; then
 	fn_info_config_samp
-# StickyBots
 elif [ "${shortname}" == "pstbs" ]; then
 	fn_info_config_sbots
-# Teeworlds
 elif [ "${shortname}" == "tw" ]; then
 	fn_info_config_teeworlds
-# Terraria
 elif [ "${shortname}" == "terraria" ]; then
 	fn_info_config_terraria
-# Tower Unite
 elif [ "${shortname}" == "tu" ]; then
 	fn_info_config_towerunite
-# Unreal engine
 elif [ "${engine}" == "unreal" ]; then
 	fn_info_config_unreal
-# Unreal 2 engine
 elif [ "${engine}" == "unreal2" ]; then
 	fn_info_config_unreal2
-# Unreal 3 engine
 elif [ "${engine}" == "unreal3" ]; then
 	fn_info_config_unreal3
 elif [ "${shortname}" == "ut" ]; then
 	fn_info_config_ut
-# 7 Day To Die (unity3d)
 elif [ "${shortname}" == "sdtd" ]; then
 	fn_info_config_sdtd
 elif [ "${shortname}" == "wet" ]; then
@@ -1704,9 +1641,10 @@ elif [ "${shortname}" == "mta" ]; then
 	fn_info_config_mta
 elif [ "${shortname}" == "squad" ]; then
 	fn_info_config_squad
-# Stationeers
 elif [ "${shortname}" == "st" ]; then
 	fn_info_config_stationeers
 elif [ "${shortname}" == "mh" ]; then
 	fn_info_config_mordhau
+elif [ "${shortname}" == "pvr" ];then
+	fn_info_config_pavlovvr
 fi

+ 3 - 3
lgsm/functions/info_distro.sh

@@ -227,7 +227,7 @@ netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}')
 
 # External IP address
 if [ -z "${extip}" ]; then
-	extip=$(curl -s https://api.ipify.org 2>/dev/null)
+	extip=$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)
 	exitcode=$?
 	# Should ifconfig.co return an error will use last known IP.
 	if [ ${exitcode} -eq 0 ]; then
@@ -264,11 +264,11 @@ if [ "$(command -v jq 2>/dev/null)" ]; then
 		if [ "${steammaster}" == "true" ]; then
 			# Will query server IP addresses first.
 			for queryip in "${queryips[@]}"; do
-				masterserver="$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)"
+				masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)"
 			done
 			# Should that not work it will try the external IP.
 			if [ "${masterserver}" == "0" ]; then
-				masterserver="$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)"
+				masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)"
 			fi
 			if [ "${masterserver}" == "0" ]; then
 				displaymasterserver="false"

+ 13 - 14
lgsm/functions/info_messages.sh

@@ -572,7 +572,7 @@ fn_info_message_ports(){
 
 	parmslocation="${red}UNKNOWN${default}"
 	# engines/games that require editing in the config file.
-	local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm")
+	local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm")
 	for port_edit in "${ports_edit_array[@]}"; do
 		if [ "${shortname}" == "ut3" ]; then
 			parmslocation="${servercfgdir}/UTWeb.ini"
@@ -1081,17 +1081,6 @@ fn_info_message_samp(){
 	} | column -s $'\t' -t
 }
 
-
-fn_info_message_ss3(){
-	echo -e "netstat -atunp | grep Sam3_Ded"
-	echo -e ""
-	{
-		echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
-		echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
-		echo -e "> Query\tINBOUND\t${queryport}\tudp"
-	} | column -s $'\t' -t
-}
-
 fn_info_message_sbots(){
 	echo -e "netstat -atunp | grep blank1"
 	echo -e ""
@@ -1446,6 +1435,16 @@ fn_info_message_warfork(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_pavlovvr(){
+	echo "netstat -atunp | grep Pavlov"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+		echo -e "> Game\tINBOUND\t$((port+400))\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_select_engine(){
 	# Display details depending on game or engine.
 	if [ "${shortname}" == "ac" ]; then
@@ -1530,8 +1529,6 @@ fn_info_message_select_engine(){
 		fn_info_message_starbound
 	elif [ "${shortname}" == "sbots" ]; then
 		fn_info_message_sbots
-	elif [ "${shortname}" == "ss3" ]; then
-		fn_info_message_ss3
 	elif [ "${shortname}" == "terraria" ]; then
 		fn_info_message_terraria
 	elif [ "${shortname}" == "ts3" ]; then
@@ -1560,6 +1557,8 @@ fn_info_message_select_engine(){
 		fn_info_message_bfv
 	elif [ "${shortname}" == "rtcw" ]; then
 		fn_info_message_rtcw
+	elif [ "${shortname}" == "pvr" ]; then
+		fn_info_message_pavlovvr
 	elif [ "${shortname}" == "rust" ]; then
 		fn_info_message_rust
 	elif [ "${shortname}" == "wf" ]; then

+ 7 - 23
lgsm/functions/info_parms.sh

@@ -187,11 +187,6 @@ fn_info_parms_sof2(){
 	defaultmap=${defaultmap:-"NOT SET"}
 }
 
-fn_info_parms_ss3(){
-	port=${port:-"0"}
-	queryport=$((port + 1))
-}
-
 fn_info_parms_towerunite(){
 	port=${port:-"0"}
 	queryport=${queryport:-"0"}
@@ -201,6 +196,11 @@ fn_info_parms_teeworlds(){
   queryport=${port:-"0"}
 }
 
+fn_info_parms_pavlovvr(){
+	port=${port:-"0"}
+	queryport=${queryport:-"0"}
+}
+
 fn_info_parms_unreal(){
 	defaultmap=${defaultmap:-"NOT SET"}
 	queryport=$((port + 1))
@@ -233,19 +233,14 @@ fn_info_parms_wf(){
 	webadminport=${webadminport:-"0"}
 }
 
-# ARK: Survival Evolved
 if [ "${shortname}" == "ark" ]; then
 	fn_info_parms_ark
-# ARMA 3
 elif [ "${shortname}" == "arma3" ]; then
 	fn_info_parms_realvirtuality
-# Barotrauma
 elif [ "${shortname}" == "bt" ]; then
 	fn_info_parms_barotrauma
-# Call of Duty
 elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then
 	fn_info_parms_cod
-# Factorio
 elif [ "${shortname}" == "fctr" ]; then
 	fn_info_parms_factorio
 elif [ "${shortname}" == "inss" ]; then
@@ -256,38 +251,30 @@ elif [ "${shortname}" == "kf2" ]; then
 	fn_info_parms_kf2
 elif [ "${shortname}" == "mohaa" ]; then
 	fn_info_parms_mohaa
-#Memories of Mars
 elif [ "${shortname}" == "mom" ]; then
 	fn_info_parms_mom
-# Project Zomboid
 elif [ "${shortname}" == "pz" ]; then
 	fn_info_parms_projectzomboid
+elif [ "${shortname}" == "pvr" ]; then
+	fn_info_parms_pavlovvr
 elif [ "${shortname}" == "qw" ]; then
 	fn_info_parms_quakeworld
 elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then
 	fn_info_parms_quake2
 elif [ "${shortname}" == "rtcw" ]; then
 	fn_info_parms_rtcw
-# Rust
 elif [ "${shortname}" == "rust" ]; then
 	fn_info_parms_rust
 elif [ "${shortname}" == "samp" ]; then
   fn_info_parms_samp
-# Rising World
 elif [ "${shortname}" == "rw" ]; then
 	fn_info_parms_risingworld
-# Soldier Of Fortune 2: Gold Edition
 elif [ "${shortname}" == "sof2" ]; then
 	fn_info_parms_sof2
-# Sticky Bots
 elif [ "${shortname}" == "sbots" ]; then
 	fn_info_parms_stickybots
-# Serious Sam
-elif [ "${shortname}" == "ss3" ]; then
-	fn_info_parms_ss3
 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then
 	fn_info_parms_source
-# Spark
 elif [ "${engine}" == "spark" ]; then
 	fn_info_parms_spark
 elif [ "${shortname}" == "tu" ]; then
@@ -298,17 +285,14 @@ elif [ "${shortname}" == "mh" ]; then
 	fn_info_parms_mordhau
 elif [ "${shortname}" == "mta" ]; then
 	fn_info_parms_mta
-# Unreal/Unreal 2 engine
 elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
 	fn_info_parms_unreal
-# Unreal 3 engine
 elif [ "${engine}" == "unreal3" ]; then
 	fn_info_parms_unreal3
 elif [ "${shortname}" == "unt" ]; then
 	fn_info_parms_unturned
 elif [ "${shortname}" == "ut" ]; then
 	fn_info_parms_ut
-# Warfork
 elif [ "${shortname}" == "wf" ]; then
 	fn_info_parms_wf
 fi

+ 7 - 21
lgsm/functions/install_config.sh

@@ -429,13 +429,6 @@ elif [ "${shortname}" == "gmod" ]; then
 	fn_default_config_remote
 	fn_set_config_vars
 	fn_list_config_locations
-elif [ "${shortname}" == "ges" ]; then
-	gamedirname="GoldenEyeSource"
-	array_configs+=( server.cfg )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
-	fn_list_config_locations
 elif [ "${shortname}" == "hldm" ]; then
 	gamedirname="HalfLifeDeathmatch"
 	array_configs+=( server.cfg )
@@ -583,6 +576,13 @@ elif [ "${shortname}" == "mumble" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_list_config_locations
+elif [ "${shortname}" == "pvr" ]; then
+	gamedirname="PavlovVR"
+	fn_check_cfgdir
+	array_configs+=( Game.ini )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${shortname}" == "pvkii" ]; then
 	gamedirname="PiratesVikingandKnightsII"
 	array_configs+=( server.cfg )
@@ -660,20 +660,6 @@ elif [ "${shortname}" == "rust" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_list_config_locations
-elif [ "${shortname}" == "samp" ]; then
-	gamedirname="SanAndreasMultiplayer"
-	array_configs+=( server.cfg )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
-	fn_list_config_locations
-elif [ "${shortname}" == "ss3" ]; then
-	gamedirname="SeriousSam3BFE"
-	array_configs+=( server.ini )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
-	fn_list_config_locations
 elif [ "${shortname}" == "sol" ]; then
 	gamedirname="Soldat"
 	array_configs+=( soldat.ini )

+ 2 - 4
lgsm/functions/install_server_files.sh

@@ -27,8 +27,6 @@ fn_install_server_files(){
 		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.76-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="178a00233cec1e25b69d130107ce1a79"
-	elif [ "${shortname}" == "ges" ]; then
-		remote_fileurl="http://linuxgsm.download/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.xz"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e31481f280eed40c9145816bd4f6dc45"
 	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
@@ -50,7 +48,7 @@ fn_install_server_files(){
 	elif [ "${shortname}" == "ut2k4" ]; then
 		remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9fceaab68554749f4b45be66613b9a15"
 	elif [ "${shortname}" == "ut99" ]; then
-		remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-451-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-451-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="42c6839f8cb95907eeef71a1838aa1f7"
+		remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469a-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-469a-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3f2ffaab8e23b98d9e825d0244e8b9d"
 	elif [ "${shortname}" == "ut" ]; then
 		remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz";  chmodx="noexecute" run="norun"; force="noforce"; md5="41dd92015713a78211eaccf503b72393"
 	elif [ "${shortname}" == "ut3" ]; then
@@ -93,7 +91,7 @@ elif [ "${shortname}" == "fctr" ]; then
 	install_factorio_save.sh
 elif [ "${shortname}" == "jk2" ]; then
 	update_jediknight2.sh
-elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then
+elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then
 	if [ "${shortname}" == "ut" ]; then
 		install_eula.sh
 	fi

+ 248 - 0
lgsm/functions/mods_core.sh

@@ -495,6 +495,254 @@ fn_check_mod_files_list(){
 	fi
 }
 
+fn_mod_exist(){
+	modreq=$1
+	# requires one parameter, the mod
+	if [ -f "${modsdir}/${modreq}-files.txt" ]; then
+		# how many lines is the file list
+		modsfilelistsize=$(wc -l < "${modsdir}/${modreq}-files.txt")
+		# if file list is empty
+		if [ "${modsfilelistsize}" -eq 0 ]; then
+			fn_mod_required_fail_exist "${modreq}"
+		fi
+	else
+		fn_mod_required_fail_exist "${modreq}"
+	fi
+}
+
+fn_mod_required_fail_exist(){
+	modreq=$1
+	# requires one parameter, the mod
+	fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed"
+	echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..."
+	fn_print_fail_eol_nl
+	core_exit.sh
+}
+
+fn_mod_liblist_gam_filenames(){
+	# clear variables just in case
+	moddll=""
+	modso=""
+	moddylib=""
+
+	# default libraries
+	case ${gamename} in
+		"Counter-Strike 1.6")
+			moddll="mp.dll"
+			modso="cs.so"
+			moddylib="cs.dylib"
+		;;
+		"Day of Defeat")
+			moddll="dod.dll"
+			modso="dod.so"
+			moddylib="dod.dylib"
+		;;
+		"Team Fortress Classic")
+			moddll="tfc.dll"
+			modso="tfc.so"
+			moddylib="tfc.dylib"
+		;;
+		"Natural Selection")
+			moddll="ns.dll"
+			modso="ns_i386.so"
+			moddylib=""
+		;;
+		"The Specialists")
+			moddll="mp.dll"
+			modso="ts_i386.so"
+			moddylib=""
+		;;
+		"Half-Life: Deathmatch")
+			moddll="hl.dll"
+			modso="hl.so"
+			moddylib="hl.dylib"
+		;;
+	esac
+}
+
+# modifers for liblist.gam to add/remote metamod binaries
+fn_mod_install_liblist_gam_file(){
+
+	fn_mod_liblist_gam_filenames
+
+	if [ -f "${modinstalldir}/liblist.gam" ]; then
+		# modify the liblist.gam file to initialize Metamod
+		logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam"
+		echo -en "modifying gamedll in liblist.gam..."
+		rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g"
+		sed -i $rpldll "${modinstalldir}/liblist.gam"
+		grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam"
+		exitcode=$?
+		# if replacement back didn't happen, error out.
+		if [ "${exitcode}" != 0 ]; then
+			fn_script_log_fatal "${logentry}"
+			fn_print_fail_eol_nl
+		else
+			fn_script_log_pass "${logentry}"
+			fn_print_ok_eol_nl
+		fi
+
+		# modify the liblist.gam file to initialize metamod
+		logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam"
+		echo -en "modifying gamedll_linux in liblist.gam..."
+		rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g"
+		sed -i $rplso "${modinstalldir}/liblist.gam"
+		grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam"
+		exitcode=$?
+		# if replacement back didn't happen, error out
+		if [ "${exitcode}" != 0 ]; then
+			fn_script_log_fatal "${logentry}"
+			fn_print_fail_eol_nl
+		else
+			fn_script_log_pass "${logentry}"
+			fn_print_ok_eol_nl
+		fi
+
+		# mac os needs to be checked not all mods support mac os
+		if [ -n "${moddylib}" ]; then
+			# modify the liblist.gam file to initialize metamod
+			logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam"
+			echo -en "modifying gamedll_osx in liblist.gam..."
+			rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g"
+			sed -i $rpldylib "${modinstalldir}/liblist.gam"
+			grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam"
+			exitcode=$?
+			# if replacement back didn't happen, error out.
+			if [ "${exitcode}" != 0 ]; then
+				fn_script_log_fatal "${logentry}"
+				fn_print_fail_eol_nl
+			else
+				fn_script_log_pass ${logentry}
+				fn_print_ok_eol_nl
+			fi
+		fi
+	fi
+}
+
+fn_mod_remove_liblist_gam_file(){
+
+	fn_mod_liblist_gam_filenames
+
+	if [ -f "${modinstalldir}/liblist.gam" ]; then
+		# modify the liblist.gam file back to defaults
+		logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam"
+		echo -en "modifying gamedll in liblist.gam..."
+		rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g"
+		sed -i $rpldll "${modinstalldir}/liblist.gam"
+		grep -q "${moddll}" "${modinstalldir}/liblist.gam"
+		exitcode=$?
+		# if replacement back didn't happen, error out.
+		if [ "${exitcode}" != 0 ]; then
+			fn_script_log_fatal "${logentry}"
+			fn_print_fail_eol_nl
+		else
+			fn_script_log_pass ${logentry}
+			fn_print_ok_eol_nl
+		fi
+
+		# modify the liblist.gam file back to defaults
+		logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam"
+		echo -en "modifying gamedll_linux in liblist.gam..."
+		rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g"
+		sed -i $rplso "${modinstalldir}/liblist.gam"
+		grep -q "${modso}" "${modinstalldir}/liblist.gam"
+		exitcode=$?
+		# if replacement back didn't happen, error out
+		if [ "${exitcode}" != 0 ]; then
+			fn_script_log_fatal "${logentry}"
+			fn_print_fail_eol_nl
+		else
+			fn_script_log_pass ${logentry}
+			fn_print_ok_eol_nl
+		fi
+
+		# mac os needs to be checked not all mods support mac os
+		if [ -n "${moddylib}" ]; then
+			# modify the liblist.gam file back to defaults
+			logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam"
+			echo -en "modifying gamedll_osx in liblist.gam..."
+			rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g"
+			sed -i $rpldylib "${modinstalldir}/liblist.gam"
+			grep -q "${moddylib}" "${modinstalldir}/liblist.gam"
+			# if replacement back didn't happen, error out.
+			exitcode=$?
+			if [ "${exitcode}" != 0 ]; then
+				fn_script_log_fatal "${logentry}"
+				fn_print_fail_eol_nl
+			else
+				fn_script_log_pass ${logentry}
+				fn_print_ok_eol_nl
+			fi
+		fi
+	fi
+}
+
+fn_mod_install_amxmodx_file(){
+	# does plugins.ini exist?
+	if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then
+		# since it does exist, is the entry already in plugins.ini
+		logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini"
+		echo -en "adding amxmodx_mm_i386.so in plugins.ini..."
+		grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"
+		exitcode=$?
+		if [ "${exitcode}" != 0 ]; then
+			# file exists but the entry does not, let's add it
+			echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini"
+			exitcode=$?
+			if [ "${exitcode}" != 0 ]; then
+				fn_script_log_fatal "${logentry}"
+				fn_print_fail_eol_nl
+			else
+				fn_script_log_pass ${logentry}
+				fn_print_ok_eol_nl
+			fi
+		fi
+	else
+		# create new file and add the mod to it
+		echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini"
+		exitcode=$?
+		if [ "${exitcode}" != 0 ]; then
+			fn_script_log_fatal "${logentry}"
+			fn_print_fail_eol_nl
+			core_exit.sh
+		else
+			fn_script_log_pass ${logentry}
+			fn_print_ok_eol_nl
+		fi
+	fi
+}
+
+fn_mod_remove_amxmodx_file(){
+	if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then
+	    # since it does exist, is the entry already in plugins.ini
+		logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini"
+		echo -en "removing amxmodx_mm_i386.so in plugins.ini..."
+		grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"
+		# iIs it found? If so remove it and clean up
+		exitcode=$?
+		if [ "${exitcode}" == 0 ]; then
+			# delete the line we inserted
+			sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini"
+			# remove empty lines
+			sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini"
+			exitcode=$?
+			if [ "${exitcode}" != 0 ]; then
+				fn_script_log_fatal "${logentry}"
+				fn_print_fail_eol_nl
+			else
+				fn_script_log_pass ${logentry}
+				fn_print_ok_eol_nl
+			fi
+
+			# if file is empty, remove it.
+			if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then
+				rm "${modinstalldir}/addons/metamod/plugins.ini"
+				fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty"
+			fi
+		fi
+	fi
+}
+
 ## Database initialisation.
 
 mods_list.sh

+ 80 - 19
lgsm/functions/mods_list.sh

@@ -12,35 +12,77 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Get a proper URL for mods that don't provide a good one (optional)
 fn_script_log_info "Retrieving latest mods URLs"
-# Metamod
-metamodmversion="1.10"
-metamodscrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodmversion}/mmsource-latest-linux"
-metamodlatestfile=$(wget "${metamodscrapeurl}" -q -O -)
-metamoddownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodmversion}"
+
+# Metamod (Half-life 1 Classic Engine)
+metamodversion="1.21.1-am"
+metamodlatestfile="metamod-${metamodversion}.zip"
+metamoddownloadurl="https://www.amxmodx.org/release/${metamodlatestfile}"
 metamodurl="${metamoddownloadurl}"
+# AMX Mod X: Base
+amxxbaseversion="1.8.2"
+amxxbasemod="base"
+amxxbaselatestfile="amxmodx-${amxxbaseversion}-${amxxbasemod}-linux.tar.gz"
+amxxbasedownloadurl="https://www.amxmodx.org/release/${amxxbaselatestfile}"
+amxxbaseurl="${amxxbasedownloadurl}"
+# AMX Mod X: Counter-Strike
+amxxcsversion="1.8.2"
+amxxcsmod="cstrike"
+amxxcslatestfile="amxmodx-${amxxbaseversion}-${amxxcsmod}-linux.tar.gz"
+amxxcsdownloadurl="https://www.amxmodx.org/release/${amxxcslatestfile}"
+amxxcsurl="${amxxcsdownloadurl}"
+# AMX Mod X: Day of Defeat
+amxxdodversion="1.8.2"
+amxxdodmod="dod"
+amxxdodlatestfile="amxmodx-${amxxdodversion}-${amxxdodmod}-linux.tar.gz"
+amxxdoddownloadurl="https://www.amxmodx.org/release/${amxxdodlatestfile}"
+amxxdodurl="${amxxdoddownloadurl}"
+# AMX Mod X: Team Fortress Classic
+amxxtfcversion="1.8.2"
+amxxtfcmod="tfc"
+amxxtfclatestfile="amxmodx-${amxxtfcversion}-${amxxtfcmod}-linux.tar.gz"
+amxxtfcdownloadurl="https://www.amxmodx.org/release/${amxxtfclatestfile}"
+amxxtfcurl="${amxxtfcdownloadurl}"
+# AMX Mod X: Natural Selection
+amxxnsversion="1.8.2"
+amxxnsmod="ns"
+amxxnslatestfile="amxmodx-${amxxnsversion}-${amxxnsmod}-linux.tar.gz"
+amxxnsdownloadurl="https://www.amxmodx.org/release/${amxxnslatestfile}"
+amxxnsurl="${amxxnsdownloadurl}"
+# AMX Mod X: The Specialists
+amxxtsversion="1.8.2"
+amxxtsmod="ts"
+amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz"
+amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}"
+amxxtsurl="${amxxtsdownloadurl}"
+# Metamod:Source
+metamodsourceversion="1.10"
+metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux"
+metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -)
+metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}"
+metamodsourceurl="${metamodsourcedownloadurl}"
 # Sourcemod
-sourcemodmversion="1.10"
-sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/sourcemod-latest-linux"
+sourcemodversion="1.10"
+sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux"
 sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -)
-sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodmversion}"
+sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}"
 sourcemodurl="${sourcemoddownloadurl}"
 # Steamworks
 steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks"
-steamworkslatestfile=$(curl -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4)
+steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4)
 steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}"
 steamworksurl="${steamworksdownloadurl}"
 # CS:GO Mods
-get5lastbuild=$(curl -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]')
+get5lastbuild=$(curl --connect-timeout 10 -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]')
 get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.fileName')
 get5latestfilepath=$(echo -e "${get5lastbuild}" | jq -r '.relativePath')
 get5url="https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/${get5latestfilepath}"
-csgopuglatest=$(curl -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]')
+csgopuglatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]')
 csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name')
 csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url')
 # Oxide
-oxiderustlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url')
-oxidehurtworldlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url')
-oxidesdtdlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' )
+oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url')
+oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url')
+oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' )
 
 # Define mods information (required)
 
@@ -67,14 +109,34 @@ modseparator="MOD"
 # [12]	| "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install
 # [13]	| "Short Description" a description showed to the user upon installation/removal
 
+# Half-life 1 Engine Mods
+mod_info_metamod=( MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework" )
+mod_info_base_amxx=( MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)" )
+
+# CS 1.6 (HL1) Engine Mods
+mod_info_cs_amxx=( MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" )
+
+# DOD (HL1) Engine Mods
+mod_info_dod_amxx=( MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" )
+
+# TFC (HL1) Engine Mods
+mod_info_tfc_amxx=( MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" )
+
+# NS (Natural Selection) (HL1) Engine Mods
+mod_info_ns_amxx=( MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" )
+
+# TS (The Specialists) (HL1) Engine Mods
+mod_info_ts_amxx=( MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" )
+
 # Source mods
-mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" )
-mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" )
+mod_info_metamodsource=( MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" )
+mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)" )
 mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" )
+mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)")
 
 # CS:GO Mods
 mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" )
-mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" )
+mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" )
 mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" )
 mod_info_pug=( MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games" )
 
@@ -92,11 +154,10 @@ mod_info_wiremodextras=( MOD "wiremod-extras" "Wiremod Extras" "https://github.c
 mod_info_darkrp=( MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode" )
 mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings" )
 
-
 # Oxidemod
 mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins" )
 mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins" )
 mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" )
 
 # REQUIRED: Set all mods info into the global array
-mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )
+mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )

+ 1 - 1
lgsm/functions/query_gamedig.sh

@@ -38,7 +38,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 		fi
 		if [ "${gdplayers}" == "null" ]; then
 			unset gdplayers
-		elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then
+		elif [ "${gdplayers}" == "[]" ]||[ "${gdplayers}" == "-1" ]; then
 			gdplayers=0
 		fi
 

+ 20 - 45
lgsm/functions/update_minecraft.sh

@@ -7,14 +7,12 @@
 functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_update_minecraft_dl(){
-	if [ "${branch}" == "release" ]; then
-		latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release as $latest | .versions[] | select(.id == $latest) | .url')
-	else
-		latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].url')
-	fi
+	# Generate link to version manifest json.
+	remotebuildlink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${remotebuild} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url')
+	# Generate link to server.jar
+	remotebuildurl=$(curl -s "${remotebuildlink}" | jq -r '.downloads.server.url')
 
-	latestmcbuildurl=$(curl -s "${latestmcreleaselink}" | jq -r '.downloads.server.url')
-	fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5"
+	fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5"
 	echo -e "copying to ${serverfiles}...\c"
 	cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar"
 	local exitcode=$?
@@ -34,53 +32,30 @@ fn_update_minecraft_dl(){
 fn_update_minecraft_localbuild(){
 	# Gets local build info.
 	fn_print_dots "Checking local build: ${remotelocation}"
-	# Uses log file to gather info.
-	localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null)
-	if [ -z "${localbuild}" ]; then
-		fn_print_error "Checking local build: ${remotelocation}"
-		fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info"
-		fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart"
-		fn_script_log_error "No log files containing version info"
-		fn_script_log_info "Forcing server restart"
-		exitbypass=1
-		command_stop.sh
-		fn_firstcommand_reset
-		exitbypass=1
-		command_start.sh
-		fn_firstcommand_reset
-		totalseconds=0
-		localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null)
-		while [ -z "${localbuild}" ]; do
-			sleep 1
-			fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}"
-			if [ -v "${loopignore}" ]; then
-				loopignore=1
-				fn_script_log_info "Waiting for log file to generate"
-			fi
-
-			localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null)
-			if [ "${totalseconds}" -gt "120" ]; then
-				localbuild="0"
-				fn_print_error "Checking local build: ${remotelocation}: waiting for log file"
-				fn_script_log_error "Local build did not generate"
-				fn_script_log_error "Required log file may be missing"
-				fn_script_log_error "Local build set to 0"
-			fi
-			totalseconds=$((totalseconds + 1))
-		done
-	fi
-	if [ "${localbuild}" != "0" ]; then
+	# Uses executable to find local build.
+	cd "${executabledir}" || exit
+	if [ -f "minecraft_server.jar" ]; then
+		localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id')
 		fn_print_ok "Checking local build: ${remotelocation}"
 		fn_script_log_pass "Checking local build"
+	else
+		localbuild="0"
+		fn_print_error "Checking local build: ${remotelocation}"
+		fn_script_log_error "Checking local build"
 	fi
 }
 
 fn_update_minecraft_remotebuild(){
 	# Gets remote build info.
-	if [ "${branch}" == "release" ]; then
+	# Latest release.
+	if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then
 		remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release')
+	# Latest snapshot.
+	elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then
+		remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.snapshot')
+	# Specific release/snapshot.
 	else
-		remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].id')
+		remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${mcversion} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id')
 	fi
 
 	if [ "${firstcommandname}" != "INSTALL" ]; then

+ 4 - 3
linuxgsm.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.5.1"
+version="v20.6.0"
 shortname="core"
 gameservername="core"
 commandname="CORE"
@@ -99,7 +99,7 @@ fn_bootstrap_fetch_file(){
 			# Larger files show a progress bar.
 
 			echo -en "fetching ${fileurl_name} ${local_filename}...\c"
-			curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1)
+			curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1)
 
 			local exitcode=$?
 
@@ -160,7 +160,8 @@ fn_bootstrap_fetch_file(){
 fn_bootstrap_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else

+ 5 - 2
tests/tests_fctrserver.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.5.1"
+version="v20.6.0"
 shortname="fctr"
 gameservername="fctrserver"
 commandname="CORE"
@@ -167,7 +167,8 @@ fn_bootstrap_fetch_file(){
 fn_bootstrap_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -937,6 +938,8 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "creating lockfile."
 date '+%s' > "${lockdir}/${selfname}.lock"
+echo "${version}" >> "${lockdir}/${selfname}.lock"
+echo "${port}" >> "${lockdir}/${selfname}.lock"
 (
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"

+ 5 - 2
tests/tests_jc2server.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.5.1"
+version="v20.6.0"
 shortname="jc2"
 gameservername="jc2server"
 commandname="CORE"
@@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){
 fn_bootstrap_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -1096,6 +1097,8 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "creating lockfile."
 date '+%s' > "${lockdir}/${selfname}.lock"
+echo "${version}" >> "${lockdir}/${selfname}.lock"
+echo "${port}" >> "${lockdir}/${selfname}.lock"
 (
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"

+ 5 - 2
tests/tests_mcserver.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.5.1"
+version="v20.6.0"
 shortname="mc"
 gameservername="mcserver"
 commandname="CORE"
@@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){
 fn_bootstrap_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -969,6 +970,8 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "creating lockfile."
 date '+%s' > "${lockdir}/${selfname}.lock"
+echo "${version}" >> "${lockdir}/${selfname}.lock"
+echo "${port}" >> "${lockdir}/${selfname}.lock"
 (
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"

+ 5 - 2
tests/tests_ts3server.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.5.1"
+version="v20.6.0"
 shortname="ts3"
 gameservername="ts3server"
 commandname="CORE"
@@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){
 fn_bootstrap_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
+	if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else
@@ -936,6 +937,8 @@ requiredstatus="OFFLINE"
 fn_setstatus
 fn_print_info_nl "creating lockfile."
 date '+%s' > "${lockdir}/${selfname}.lock"
+echo "${version}" >> "${lockdir}/${selfname}.lock"
+echo "${port}" >> "${lockdir}/${selfname}.lock"
 (
 	exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
 	BASH_XTRACEFD="5"