Răsfoiți Sursa

Merge branch 'feature/squadserver-refresh' into develop

Daniel Gibbs 8 ani în urmă
părinte
comite
a83da19d68

+ 92 - 0
lgsm/config-default/config-lgsm/squadserver/_default.cfg

@@ -0,0 +1,92 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+port="7787"
+queryport="27165"
+randommap="ALWAYS"
+ip="0.0.0.0"
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+fn_parms(){
+parms="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport}"
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
+updateonstart="off"
+
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+## SteamCMD Settings
+# Server appid
+appid="403240"
+# Steam App Branch Select
+# Allows to opt into the various Steam app branches. Default branch is "".
+# Example: "-beta latest_experimental"
+branch=""
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Squad"
+engine="unreal4"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}/Squad"
+executabledir="${serverfiles}"
+executable="./SquadServer.sh"
+servercfg="${servicename}.cfg"
+servercfgdefault="Server.cfg"
+servercfgdir="${systemdir}/ServerConfig"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${lgsmdir}/backup"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${logdir}/server"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+gamelog="${gamelogdir}/${servicename}-game.log"
+lgsmlog="${lgsmlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+emaillog="${lgsmlogdir}/${servicename}-email.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

+ 1 - 0
lgsm/data/serverlist.csv

@@ -55,6 +55,7 @@ ricochet,ricochetserver,Ricochet
 rust,rustserver,Rust
 ss3,ss3server,Serious Sam 3: BFE
 sb,sbserver,Starbound
+squad,squadserver,Squad
 sven,svenserver,Sven Co-op
 tf2,tf2server,Team Fortress 2
 tfc,tfcserver,Team Fortress Classic

+ 2 - 2
lgsm/functions/command_details.sh

@@ -209,8 +209,8 @@ fn_details_gameserver(){
 		fi
 
 		# Random map rotation mode (Squad)
-		if [ -n "${randommapmode}" ]; then
-			echo -e "${blue}Map rotation:\t${default}${randommapmode}"
+		if [ -n "${randommap}" ]; then
+			echo -e "${blue}Map rotation:\t${default}${randommap}"
 		fi
 
 		# Online status

+ 12 - 7
lgsm/functions/info_config.sh

@@ -753,20 +753,25 @@ fn_info_config_squad(){
 		servername="${unavailable}"
 		maxplayers="${unavailable}"
 	else
-		servername="$(cat ${servercfgfullpath} | grep "ServerName=" | cut -c13- | rev | cut -c3- | rev)"
-		maxplayers="$(cat ${servercfgfullpath} | grep "MaxPlayers=" | cut -c12- | tr -cd '[:digit:]')"
+		servername="$(cat ${servercfgfullpath} | grep "ServerName=" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')"
+		maxplayers="$(cat ${servercfgfullpath} | grep "MaxPlayers=" | tr -cd '[:digit:]')"
 	fi
 
 	if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then
 		rconport=${unavailable}
 		rconpassword=${unavailable}
 	else
-		rconport=$(cat ${servercfgdir}/Rcon.cfg | grep "Port=" | cut -c6- | tr -cd '[:digit:]')
-		rconpassword=$(cat ${servercfgdir}/Rcon.cfg | grep "Password=" | cut -c10-)
-		if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then
-			rconpassword="${yellow}DISABLED${default}"
-		fi
+		rconport=$(cat ${servercfgdir}/Rcon.cfg | grep "Port=" | tr -cd '[:digit:]')
+		rconpassword=$(cat ${servercfgdir}/Rcon.cfg | grep "Password=" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+	fi
+
+	rconport=${rconport:-"0"}
+	if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then
+		rconpassword="NOT SET"
 	fi
+	servername=${servername:-"NOT SET"}
+	serverpassword=${serverpassword:-"NOT SET"}
+	maxplayers=${maxplayers:-"0"}
 }
 
 # Just Cause 2

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -86,6 +86,9 @@ elif [ "${gamename}" == "Quake 3: Arena" ]; then
 elif [ "${gamename}" == "Quake Live" ]; then
 	glibcrequired="2.15"
 	glibcfix="no"
+elif [ "${gamename}" == "Squad" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"
 elif [ "${gamename}" == "Sven Co-op" ]; then
 	glibcrequired="2.18"
 	glibcfix="no"

+ 6 - 0
lgsm/functions/install_config.sh

@@ -450,6 +450,12 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Squad" ]; then
+	gamedirname="Squad"
+	array_configs+=( Server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Starbound" ]; then
 	gamedirname="Starbound"
 	array_configs+=( starbound_server.config )