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

feat (game server): StickyBots Server (#2096)

Daniel Gibbs 7 лет назад
Родитель
Сommit
a3f411fa43

+ 0 - 1
lgsm/config-default/config-lgsm/pstbsserver/_default.cfg

@@ -9,7 +9,6 @@
 #### Server Settings ####
 
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
-
 ip="0.0.0.0"
 randommap="ALWAYS"
 port="10027"

+ 127 - 0
lgsm/config-default/config-lgsm/sbotsserver/_default.cfg

@@ -0,0 +1,127 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+port="7777"
+queryport="27015"
+defaultmap="StationKappa"
+servername="LinuxGSM Server"
+serverpassword="NOT SET" # Can't be adjusted currently
+maxplayers="8" # Can't be adjusted currently
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+fn_parms(){
+parms="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\""
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# More info | https://github.com/GameServerManagers/LinuxGSM/wiki/Alerts#more-info
+postalert="off"
+postdays="7"
+posttarget="https://hastebin.com"
+
+# Discord Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# IFTTT Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/IFTTT
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# Mailgun Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/mailgun
+mailgunalert="off"
+mailguntoken="accesstoken"
+mailgundomain="example.com"
+mailgunemailfrom="alert@example.com"
+mailgunemail="email@myemail.com"
+
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+
+# Telegram Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Telegram
+# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
+# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
+# any custom string in curl - simple ignore this parameter.
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+curlcustomstring=""
+
+## Backup | https://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 ####
+
+# ANSI Colors
+ansi="on"
+
+## SteamCMD Settings
+# Server appid
+appid="974130"
+# 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="StickyBots"
+engine="unreal4"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}"
+executabledir="${systemdir}/blank1/Binaries/Linux"
+executable="./blank1Server-Linux-Shipping"
+servercfg="Game.ini"
+servercfgdefault="Game.ini"
+servercfgdir="${systemdir}/blank1/Saved/Config/Windows"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${rootdir}/backups"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${serverfiles}/Logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+lgsmlog="${lgsmlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+alertlog="${lgsmlogdir}/${servicename}-alert.log"
+postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

+ 1 - 1
lgsm/config-default/config-lgsm/squadserver/_default.cfg

@@ -9,10 +9,10 @@
 #### Server Settings ####
 
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+ip="0.0.0.0"
 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(){

+ 1 - 0
lgsm/data/serverlist.csv

@@ -64,6 +64,7 @@ ricochet,ricochetserver,Ricochet
 rust,rustserver,Rust
 rw,rwserver, Rising World
 samp,sampserver,San Andreas Multiplayer
+sbot,sbotserver, StickyBots
 ss3,ss3server,Serious Sam 3: BFE
 sb,sbserver,Starbound
 st,stserver,Stationeers

+ 18 - 0
lgsm/functions/info_config.sh

@@ -612,6 +612,21 @@ fn_info_config_seriousengine35(){
 	fi
 }
 
+#StickyBots
+fn_info_config_sbots(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		servername="${unavailable}"
+		maxplayers="${unavailable}"
+	else
+		servername="$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//')"
+		maxplayers="$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')"
+	fi
+
+	servername=${servername:-"NOT SET"}
+	serverpassword=${serverpassword:-"NOT SET"}
+	maxplayers=${maxplayers:-"0"}
+}
+
 fn_info_config_source(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
@@ -1204,6 +1219,9 @@ elif [ "${shortname}" == "mumble" ]; then
 # 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

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -114,6 +114,9 @@ elif [ "${gamename}" == "Squad" ]; then
 elif [ "${gamename}" == "Sven Co-op" ]; then
 	glibcrequired="2.18"
 	glibcfix="no"
+elif [ "${shortname}" == "sbots" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"		
 elif [ "${gamename}" == "Team Fortress 2" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"

+ 18 - 3
lgsm/functions/info_messages.sh

@@ -231,7 +231,10 @@ fn_info_message_gameserver(){
 				echo -e "${blue}Current Scenario:\t${default}${gdgamemode}"
 			fi
 		else
-			echo -e "${blue}Current Game Mode:\t${default}${gdgamemode}"
+			# Current Scenario
+			if [ -n "${gdgamemode}" ]; then
+				echo -e "${blue}Current Game Mode:\t${default}${gdgamemode}"
+			fi
 		fi
 
 		# Default Map
@@ -746,7 +749,7 @@ fn_info_message_mumble(){
 		echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
 	} | column -s $'\t' -t
 }
-fn_info_Message_pstbs(){
+fn_info_message_pstbs(){
 	echo -e "netstat -atunp | grep PostScriptum"
 	echo -e ""
 	{
@@ -889,6 +892,16 @@ fn_info_message_seriousengine35(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_sbots(){
+	echo -e "netstat -atunp | grep blank1"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+		echo -e "> Query\tINBOUND\t${queryport}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_sdtd(){
 	fn_info_message_password_strip
 	echo -e "netstat -atunp | grep 7DaysToDie"
@@ -1182,7 +1195,7 @@ fn_info_message_select_engine(){
 	elif [ "${shortname}" == "kf2" ]; then
 		fn_info_message_kf2
 	elif [ "${shortname}" == "pstbs" ]; then
-		fn_info_Message_pstbs
+		fn_info_message_pstbs
 	elif [ "${gamename}" == "Project Cars" ]; then
 		fn_info_message_projectcars
 	elif [ "${gamename}" == "QuakeWorld" ]; then
@@ -1199,6 +1212,8 @@ fn_info_message_select_engine(){
 		fn_info_message_squad
 	elif [ "${gamename}" == "Stationeers" ]; then
 		fn_info_message_stationeers
+	elif [ "${shortname}" == "sbots" ]; then
+		fn_info_message_sbots	
 	elif [ "${gamename}" == "TeamSpeak 3" ]; then
 		fn_info_message_teamspeak3
 	elif [ "${gamename}" == "Tower Unite" ]; then

+ 12 - 0
lgsm/functions/info_parms.sh

@@ -125,6 +125,15 @@ fn_info_parms_spark(){
 	mods=${mods:-"NOT SET"}
 }
 
+fn_info_parms_stickybots(){
+	port=${port:-"0"}
+	queryport=${queryport:-"0"}
+	servername=${servername:-"NOT SET"}
+	serverpassword=${serverpassword:-"NOT SET"}
+	defaultmap=${defaultmap:-"NOT SET"}
+	maxplayers=${maxplayers:-"0"}
+}
+
 fn_info_config_towerunite(){
 	port=${port:-"0"}
 	queryport=${queryport:-"0"}
@@ -185,6 +194,9 @@ elif [ "${shortname}" == "rust" ]; then
 # Rising World
 elif [ "${shortname}" == "rw" ]; then
 	fn_info_parms_risingworld
+# Sticky Bots
+elif [ "${shortname}" == "sbots" ]; then
+	fn_info_parms_stickybots
 # Serious Sam
 elif [ "${shortname}" == "ss3" ]; then
 	fn_info_config_seriousengine35

+ 6 - 6
lgsm/functions/query_gamedig.sh

@@ -89,37 +89,37 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 		# server name
 		gdname=$(echo "${gamedigraw}" | jq -re '.name')
 		if [ "${gdname}" == "null" ]; then
-			gdname=
+			unset gdname
 		fi
 
 		# numplayers
 		gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length')
 		if [ "${gdplayers}" == "null" ]; then
-			gdplayers=
+			unset gdplayers
 		fi
 
 		# maxplayers
 		gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length')
 		if [ "${gdmaxplayers}" == "null" ]; then
-			maxplayers=
+			unset maxplayers
 		fi
 
 		# current map
 		gdmap=$(echo "${gamedigraw}" | jq -re '.map')
 		if [ "${gdmap}" == "null" ]; then
-			gdmap=
+			unset gdmap
 		fi
 
 		# current gamemode
 		gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s')
 		if [ "${gdgamemode}" == "null" ]; then
-			gdgamemode=
+			unset gdgamemode
 		fi
 
 		# numbots
 		gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots')
 		if [ "${gdbots}" == "null" ]; then
-			gdbots=
+			unset gdbots
 		fi
 	fi
 fi