Browse Source

feat(newserver): return to castle wolfenstein server added

tkrn 7 years ago
parent
commit
f9d93a03b2

+ 116 - 0
lgsm/config-default/config-lgsm/rtcwserver/_default.cfg

@@ -0,0 +1,116 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
+ip="0.0.0.0"
+port="27960"
+defaultmap="mp_beach"
+
+## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
+fn_parms(){
+parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}"
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# More info | https://docs.linuxgsm.com/alerts#more-info
+postalert="off"
+postdays="7"
+posttarget="https://hastebin.com"
+
+# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://docs.linuxgsm.com/alerts/email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
+mailgunalert="off"
+mailguntoken="accesstoken"
+mailgundomain="example.com"
+mailgunemailfrom="alert@example.com"
+mailgunemail="email@myemail.com"
+
+# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+
+# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
+# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
+# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
+# any custom string in curl - simple ignore this parameter.
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+curlcustomstring=""
+
+## Backup | https://docs.linuxgsm.com/commands/backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://docs.linuxgsm.com/features/logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+# ANSI Colors
+ansi="on"
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Return to Castle Wolfenstein"
+engine="ioquake3"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}/main"
+executabledir="${serverfiles}"
+executable="./iowolfded.x86_64"
+servercfg="${servicename}.cfg"
+servercfgdefault="server.cfg"
+servercfgdir="${systemdir}"
+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 - 0
lgsm/data/serverlist.csv

@@ -61,6 +61,7 @@ ql,qlserver,Quake Live
 qw,qwserver,Quake World
 ro,roserver,Red Orchestra: Ostfront 41-45
 ricochet,ricochetserver,Ricochet
+rtcw,rtcwserver,Return to Castle Wolfenstein
 rust,rustserver,Rust
 rw,rwserver, Rising World
 samp,sampserver,San Andreas Multiplayer

+ 24 - 1
lgsm/functions/info_config.sh

@@ -318,7 +318,7 @@ fn_info_config_inss(){
 		rconenabled=${rconenabled:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
 		rconport=${rconport:-"0"}
-	fi	
+	fi
 }
 fn_info_config_minecraft(){
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -589,6 +589,26 @@ fn_info_config_risingworld(){
 	fi
 }
 
+fn_info_config_rtcw(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		rconpassword="${unavailable}"
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		maxplayers="${zero}"
+	else
+		rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
+		# Not Set
+		rconpassword=${rconpassword:-"NOT SET"}
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
+
 fn_info_config_seriousengine35(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
@@ -1198,6 +1218,9 @@ elif [ "${shortname}" == "pz" ]; then
 # 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

+ 6 - 3
lgsm/functions/info_glibc.sh

@@ -77,7 +77,7 @@ elif [ "${shortname}" == "kf2" ]; then
 	glibcfix="no"
 elif [ "${shortname}" == "tu" ]; then
 	glibcrequired="2.15"
-	glibcfix="no"	
+	glibcfix="no"
 elif [ "${gamename}" == "Mumble" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
@@ -102,6 +102,9 @@ elif [ "${gamename}" == "Quake 3: Arena" ]; then
 elif [ "${gamename}" == "Quake Live" ]; then
 	glibcrequired="2.15"
 	glibcfix="no"
+elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+	glibcrequired="2.1"
+	glibcfix="no"
 elif [ "${shortname}" == "rw" ]; then
 	glibcrequired="2.14"
 	glibcfix="no"
@@ -116,7 +119,7 @@ elif [ "${gamename}" == "Sven Co-op" ]; then
 	glibcfix="no"
 elif [ "${shortname}" == "sbots" ]; then
 	glibcrequired="2.17"
-	glibcfix="no"		
+	glibcfix="no"
 elif [ "${gamename}" == "Team Fortress 2" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"
@@ -206,7 +209,7 @@ elif [ "${engine}" == "source" ]; then
 	glibcfix="no"
 elif [ "${engine}" == "goldsource" ]; then
 	glibcrequired="2.3.4"
-	glibcfix="no"	
+	glibcfix="no"
 else
 	glibcrequired="UNKNOWN"
 	glibcfix="no"

+ 13 - 2
lgsm/functions/info_messages.sh

@@ -489,7 +489,7 @@ fn_info_message_ports(){
 		fi
 	done
 	# engines/games that require editing the parms
-	local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
+	local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
 	for port_edit in "${ports_edit_array[@]}"
 	do
 		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
@@ -858,6 +858,15 @@ fn_info_message_risingworld(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_rtcw(){
+	echo -e "netstat -atunp | grep iowolfded"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_rust(){
 	echo -e "netstat -atunp | grep Rust"
 	echo -e ""
@@ -1209,7 +1218,7 @@ fn_info_message_select_engine(){
 	elif [ "${gamename}" == "Stationeers" ]; then
 		fn_info_message_stationeers
 	elif [ "${shortname}" == "sbots" ]; then
-		fn_info_message_sbots	
+		fn_info_message_sbots
 	elif [ "${gamename}" == "TeamSpeak 3" ]; then
 		fn_info_message_teamspeak3
 	elif [ "${gamename}" == "Tower Unite" ]; then
@@ -1218,6 +1227,8 @@ fn_info_message_select_engine(){
 		fn_info_message_mta
 	elif [ "${gamename}" == "Mumble" ]; then
 		fn_info_message_mumble
+	elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+		fn_info_message_rtcw
 	elif [ "${gamename}" == "Rust" ]; then
 		fn_info_message_rust
 	elif [ "${gamename}" == "Wurm Unlimited" ]; then

+ 7 - 0
lgsm/functions/info_parms.sh

@@ -92,6 +92,11 @@ fn_info_parms_risingworld(){
 
 }
 
+fn_info_parms_rtcw(){
+	port=${port:-"0"}
+	defaultmap=${defaultmap:-"NOT SET"}
+}
+
 fn_info_parms_rust(){
 	servername=${servername:-"NOT SET"}
 	port=${port:-"0"}
@@ -188,6 +193,8 @@ 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

+ 7 - 1
lgsm/functions/install_config.sh

@@ -55,7 +55,7 @@ fn_default_config_remote(){
 
 # Copys local default config to server config location
 fn_default_config_local(){
-	echo "copying ${servercfgdefault} config file."	
+	echo "copying ${servercfgdefault} config file."
 	cp -nv "${servercfgfullpathdefault}" "${servercfgfullpath}"
 	sleep 0.5
 }
@@ -487,6 +487,12 @@ elif [ "${gamename}" == "Ricochet" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+	gamedirname="ReturnToCastleWolfenstein"
+	array_configs+=( server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Rust" ]; then
 	gamedirname="Rust"
 	fn_check_cfgdir

+ 2 - 0
lgsm/functions/install_server_files.sh

@@ -35,6 +35,8 @@ fn_install_server_files(){
 		remote_fileurl="http://files.linuxgsm.com/Quake3/quake3-1.32c-x86-full-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="fd7258d827474f67663dda297bff4306"
 	elif [ "${gamename}" == "QuakeWorld" ]; then
 		remote_fileurl="http://files.linuxgsm.com/QuakeWorld/nquake.server.linux.083116.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.083116.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="75a409cf08d808f075e4dacdc7b21b78"
+	elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+		remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7e555481a3b98e168dfb5e6ddc2fb879"
 	elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
 		remote_fileurl="http://files.linuxgsm.com/UnrealTournament2004/ut2004-server-3369-2-ultimate-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-2-ultimate-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54"
 	elif [ "${gamename}" == "Unreal Tournament 99" ]; then