Daniel Gibbs 10 лет назад
Родитель
Сommit
c7f26352e9
3 измененных файлов с 245 добавлено и 0 удалено
  1. 101 0
      CodenameCURE/cfg/lgsm-default.cfg
  2. 138 0
      CodenameCURE/cssserver
  3. 6 0
      functions/install_config.sh

+ 101 - 0
CodenameCURE/cfg/lgsm-default.cfg

@@ -0,0 +1,101 @@
+// ****************************************************************************
+//                                                                            *
+//     CodenameCURE - server.cfg                                              *
+//     Version 100216                                                         *
+//                                                                            *
+// ****************************************************************************
+
+// ............................. Basic Settings ............................. //
+
+// Hostname for server.
+hostname "<hostname>"
+
+// RCON - remote console password.
+rcon_password "<rconpassword>"
+
+// Server password - for private servers.
+sv_password ""
+
+// Contact email for server sysop.
+sv_contact "email@example.com"
+
+// LAN Mode - If set the server will not show on the internet.
+// Default: sv_lan 0
+sv_lan 0
+
+// ............................... Map Cycles ............................... //
+// info: There are several predefined mapcycles available that are listed below.
+// You can also create your own custom mapcycle. 
+
+// "mapcycle.txt" - all maps
+// "mapcycle_objective.txt" - objective maps only
+// "mapcycle_survival.txt" - survival maps only
+//
+mapcyclefile "mapcycle.txt"
+
+// ........................ Game Specific Commands ........................ //
+// info: any commands that only apply to this game.
+
+// Difficulty
+// 0 - Easy 
+// 1 - Average 
+// 2 - Skilled 
+// 3 - Insane
+sv_difficulty "1"
+
+// ............................. Communication ............................. //
+
+// Enable communication over voice via microphone.
+// Default: sv_voiceenable 1
+sv_voiceenable 1
+
+// Players can hear all other players, no team restrictions.
+// Default: sv_alltalk 0
+sv_alltalk 1
+
+// ............................. Fast Download .............................. //
+// info: Allows custom maps to be downloaded to the client.
+
+// Allows clients to download custom maps and textures etc. from the server at 20 kbps.
+// Default: sv_allowdownload 1
+sv_allowdownload 1
+
+// Allows clients to download custom maps, textures etc. from a web server with no transfer limit.
+// Example:
+// 		server location: maps/custommap.bsp
+// 		web server location: http://example.com/custom/maps/custommap.bsp
+//		sv_downloadurl "http://example.com/custom"
+// Default: sv_downloadurl ""
+sv_downloadurl ""
+
+// ................................ Ban List ............................... //
+
+// personal banlist based on user IDs.
+exec banned_user.cfg
+
+// personal banlist based on user IPs.	
+exec banned_ip.cfg
+
+writeid
+writeip
+
+// ............................. Server Logging ............................. //
+
+//Enables logging to file, console, and udp < on | off >.
+log on
+
+// Log server bans in the server logs.
+// Default: sv_logbans 1
+sv_logbans 1
+
+// Echo log information to the console.
+// Default: sv_logecho 1
+sv_logecho 1
+
+// Log server information in the log file.
+// Default: sv_logfile 1
+sv_logfile 1
+
+// Log server information to only one file.
+// Default: sv_log_onefile 0
+sv_log_onefile 0

+ 138 - 0
CodenameCURE/cssserver

@@ -0,0 +1,138 @@
+#!/bin/bash
+# Codename CURE
+# Server Management Script
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="271215"
+
+#### Variables ####
+
+# Notification Email
+# (on|off)
+emailnotification="off"
+email="email@example.com"
+
+# Steam login
+steamuser="anonymous"
+steampass=""
+
+# Start Variables
+defaultmap="cbe_bunker"
+maxplayers="6"
+port="27015"
+sourcetvport="27058"
+clientport="27005"
+ip="0.0.0.0"
+updateonstart="off"
+
+# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
+fn_parms(){
+parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+}
+
+#### 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"
+
+# Steam
+appid="383410"
+
+# Server Details
+servicename="cc-server"
+gamename="Codename Cure"
+engine="source"
+
+# Directories
+rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
+selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+lockselfname=".${servicename}.lock"
+filesdir="${rootdir}/serverfiles"
+systemdir="${filesdir}/cure"
+executabledir="${filesdir}"
+executable="./srcds_run"
+servercfg="${servicename}.cfg"
+servercfgdir="${systemdir}/cfg"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.cfg"
+backupdir="${rootdir}/backups"
+
+# Logging
+logdays="7"
+gamelogdir="${systemdir}/logs"
+scriptlogdir="${rootdir}/log/script"
+consolelogdir="${rootdir}/log/console"
+
+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
+
+fn_getgithubfile(){
+filename=$1
+exec=$2
+fileurl=${3:-$filename}
+filepath="${rootdir}/${filename}"
+filedir=$(dirname "${filepath}")
+# If the function file is missing, then download
+if [ ! -f "${filepath}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir "${filedir}"
+	fi
+	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
+	echo -e "    fetching ${filename}...\c"
+	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
+		:
+	else	
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit
+	fi
+	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
+	if [ $? -ne 0 ]; then
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "${curl}"
+		echo -e "${githuburl}\n"
+		exit
+	else
+		echo -e "\e[0;32mOK\e[0m"
+	fi	
+	if [ "${exec}" ]; then
+		chmod +x "${filepath}"
+	fi
+fi
+if [ "${exec}" ]; then
+	source "${filepath}"
+fi
+}
+
+fn_runfunction(){
+	fn_getgithubfile "functions/${functionfile}" 1
+}
+
+core_functions.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_runfunction
+}
+
+core_functions.sh
+
+getopt=$1
+core_getopt.sh

+ 6 - 0
functions/install_config.sh

@@ -180,6 +180,12 @@ elif [ "${gamename}" == "Blade Symphony" ]; then
 	wget -N /dev/null ${githuburl}/BladeSymphony/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
 	sleep 1
 	fn_goldsourceconfig
+elif [ "${gamename}" == "Codename CURE" ]; then
+	echo -e "downloading lgsm-default.cfg...\c"
+	wget -N /dev/null ${githuburl}/Codename CURE/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
+	sleep 1
+	fn_sourceconfig
+
 elif [ "${gamename}" == "Counter Strike 1.6" ]; then
 	echo -e "downloading lgsm-default.cfg...\c"
 	wget -N /dev/null ${githuburl}/CounterStrike/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq