4
0
Эх сурвалжийг харах

Merge pull request #1014 from hurdad/master

adding Enemy Territory
Daniel Gibbs 9 жил өмнө
parent
commit
8489e79d81

+ 125 - 0
EnemyTerritory/cfg/lgsm-default.cfg

@@ -0,0 +1,125 @@
+set dedicated "2"				// 1: dedicated server for lan 2: dedicated server for internet
+// set net_ip ""				// set to override the default IP ET uses
+// set net_port "27960"				// set to override the default port ET uses
+
+// PASSWORDS & CLIENTS 
+
+set sv_maxclients "20"				// number of players including private slots
+set g_password ""				// set to password protect the server
+set sv_privateclients "4"			// if set > 0, then this number of client slots will be reserved for connections
+set sv_privatepassword ""			// that have "password" set to the value of "sv_privatePassword"
+set rconpassword "<rconpassword>"				// remote console access password
+set refereePassword ""				// referee status password
+
+// DL, RATE
+
+set sv_maxRate "13000"				// 10000 standard but poor for ET 
+set sv_dl_maxRate "42000"			// increase/decerease if you have plenty/little spare bandwidth 
+set sv_allowDownload "0"        			// global toggle for both legacy download and web download
+set sv_wwwDownload "0"				// toggle to enable web download
+set sv_wwwBaseURL "" 				// base URL for redirection
+set sv_wwwDlDisconnected "0"			// tell clients to perform their downloads while disconnected from the server
+set sv_wwwFallbackURL ""			// URL to send to if an http/ftp fails or is refused client side
+
+// MOTD ETC
+
+set sv_hostname "<hostname>" 			// name of server here
+set server_motd0 " ^NEnemy Territory ^7MOTD "	// message in right corner of join screen here
+set server_motd1 ""
+set server_motd2 ""
+set server_motd3 ""
+set server_motd4 ""
+set server_motd5 ""
+
+// MISC SETTINGS
+
+set g_heavyWeaponRestriction "100"
+set g_antilag "1"
+set g_altStopwatchMode "0"
+set g_autofireteams "1"
+set g_complaintlimit "6"
+set g_ipcomplaintlimit "3"
+set g_fastres "0"
+set g_friendlyFire "1"
+//set g_gametype "4"				// Game type should be set from map rotation script
+set g_minGameClients "8"
+set g_maxlives "0"
+set g_alliedmaxlives "0"
+set g_axismaxlives "0"
+set g_teamforcebalance "1"
+set g_noTeamSwitching "0"
+set g_voiceChatsAllowed "4"
+set g_doWarmup "0"
+set g_warmup "30"
+set g_spectatorInactivity "0"
+set sv_floodProtect "1"
+set sv_allowDownload "1"
+set sv_pure "1"
+set sv_minping "0"
+set sv_maxping "0"
+set match_latejoin "1"
+set match_minplayers "4"
+set match_mutespecs "0"
+set match_readypercent "100"
+set match_timeoutcount "0"
+set match_warmupDamage "1"
+set team_maxplayers "0"
+set team_nocontrols "1"
+set pmove_fixed "0"
+set pmove_msec "8"
+
+// LMS ONLY SETTINGS
+
+set g_lms_teamForceBalance "1"
+set g_lms_roundlimit "3"
+set g_lms_matchlimit "2"
+set g_lms_currentMatch "0"
+set g_lms_lockTeams "0"
+set g_lms_followTeamOnly "1"
+
+// VOTING
+
+set g_allowVote "1"
+set vote_limit "5"
+set vote_percent "50"
+set vote_allow_comp "1"
+set vote_allow_gametype "1"
+set vote_allow_kick "1"
+set vote_allow_map "1"
+set vote_allow_matchreset "1"
+set vote_allow_mutespecs "1"
+set vote_allow_nextmap "1"
+set vote_allow_pub "1"
+set vote_allow_referee "0"
+set vote_allow_shuffleteams "1"
+set vote_allow_swapteams "1"
+set vote_allow_friendlyfire "1"
+set vote_allow_timelimit "0"
+set vote_allow_warmupdamage "1"
+set vote_allow_antilag "1"
+set vote_allow_balancedteams "1"
+set vote_allow_muting "1"
+
+// PUNKBUSTER
+
+// sv_punkbuster is a readonly variable. Use +set sv_punkbuster on command line or use the command pb_sv_enable in the console
+//pb_sv_enable
+
+// LOGGING
+
+set g_log "etserver.log" 			// Game logging
+set g_logsync 0
+set logfile 0 					// Console logging ( 1: enable 2: enable and sync )
+
+// MAP ROTATION
+
+exec campaigncycle.cfg				// Campaign mode
+//exec objectivecycle.cfg			// Objective mode
+//exec lmscycle.cfg				// Last Man Standing mode
+
+// WATCHDOG
+
+// in case the game dies with an ERR_DROP
+// or any situation leading to server running with no map
+//set com_watchdog 10				// defaults 60
+set com_watchdog_cmd "exec campaigncycle.cfg"	// defaults to quit

+ 143 - 0
EnemyTerritory/etserver

@@ -0,0 +1,143 @@
+#!/bin/bash
+# Enemy Territory
+# Server Management Script
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="210516"
+
+#### Variables ####
+
+# Notification Alerts
+# (on|off)
+
+# Email
+emailalert="off"
+email="email@example.com"
+
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
+# Start Variables
+ip="0.0.0.0"
+port="27960"
+
+fn_parms(){
+	parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${port} +set fs_homepath ${filesdir} +exec ${servicename}.cfg"
+}
+
+#### Advanced Variables ####
+
+# Github Branch Select
+# Allows for the use of different function files
+# from a different repo and/or branch.
+githubuser="dgibbs64"
+githubrepo="linuxgsm"
+githubbranch="master"
+
+# Server Details
+servicename="et-server"
+gamename="Enemy Territory"
+engine="idtech3"
+
+# Directories
+rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
+selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
+libdir="${lgsmdir}/lib"
+filesdir="${rootdir}/serverfiles"
+systemdir="${filesdir}"
+executabledir="${systemdir}"
+executable="./etded"
+servercfg="${servicename}.cfg"
+servercfgdir="${systemdir}/etmain"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.cfg"
+backupdir="${rootdir}/backups"
+
+# Logging
+logdays="7"
+gamelogdir="${filesdir}/Logs"
+scriptlogdir="${rootdir}/log/script"
+consolelogdir="${rootdir}/log/console"
+consolelogging="on"
+
+scriptlog="${scriptlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+emaillog="${scriptlogdir}/${servicename}-email.log"
+
+scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
+
+##### Script #####
+# Do not edit
+
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir -p "${filedir}"
+	fi
+	echo -e "    fetching ${filename}...\c"
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit 1
+	fi
+	chmod +x "${filedir}/${filename}"
+fi
+source "${filedir}/${filename}"
+}
+
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_functions.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_dl.sh
+core_functions.sh
+
+getopt=$1
+core_getopt.sh

+ 1 - 1
lgsm/functions/command_install.sh

@@ -18,7 +18,7 @@ check_deps.sh
 if [ "${gamename}" == "Unreal Tournament 2004" ]; then
 	install_server_files.sh
 	install_ut2k4_key.sh
-elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then
+elif [ "${gamename}" == "Enemy Territory" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then
 	installer=1
 	install_server_files.sh
 elif [ -n "${appid}" ]; then

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -80,6 +80,9 @@ elif [ "${gamename}" == "TeamSpeak 3" ]; then
 elif [ "${gamename}" == "Mumble" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
+elif [ "${engine}" == "idtech3" ]; then
+	glibcrequired="2.0"
+	glibcfix="no"
 else
 	glibcrequired="UNKNOWN"
 	glibcfix="no"

+ 7 - 0
lgsm/functions/install_config.sh

@@ -281,6 +281,13 @@ elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
 	fn_sourceconfig
 elif [ "${gamename}" == "Empires Mod" ]; then
 	fn_defaultconfig
+elif [ "${gamename}" == "Enemy Territory" ]; then
+	echo -e "downloading lgsm-default.cfg...\c"
+	wget -N /dev/null ${githuburl}/EnemyTerritory/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
+	sleep 1
+	fn_defaultconfig
+	fn_userinputconfig
+	echo ""
 elif [ "${gamename}" == "Fistful of Frags" ]; then
 	echo -e "downloading lgsm-default.cfg...\c"
 	wget -N /dev/null ${githuburl}/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq

+ 2 - 0
lgsm/functions/install_server_files.sh

@@ -13,6 +13,8 @@ fn_install_server_files(){
 		fileurl="https://gameservermanagers.com/files/UnrealTournament99/ut99-server-451-ultimate-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="ut99-server-451-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="49cb24d0550ff6ddeaba6007045c6edd"
 	elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
 		fileurl="https://gameservermanagers.com/files/UnrealTournament2004/ut2004-server-3339-ultimate-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="ut2004-server-3339-ultimate-linux.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54"
+	elif [ "${gamename}" == "Enemy Territory" ]; then
+		fileurl="https://s3.amazonaws.com/linuxgsm/enemy-territory.260b.tar.gz"; filedir="${lgsmdir}/tmp"; filename="enemy-territory.260b.tar.gz";  executecmd="noexecute" run="norun"; force="noforce"; md5="ded32053e470fe15d9403ec4a0ab7e89"
 	elif [ "${gamename}" == "Unreal Tournament" ]; then
 		fileurl="https://s3.amazonaws.com/unrealtournament/UnrealTournament-Server-XAN-3045522-Linux.zip"; filedir="${lgsmdir}/tmp"; filename="UnrealTournament-Server-XAN-3045522-Linux.zip";  executecmd="noexecute" run="norun"; force="noforce"; md5="553fed5645a9fc623e92563049bf79f6"
 	elif [ "${gamename}" == "GoldenEye: Source" ]; then