100 changed files with 2413 additions and 329 deletions
@ -1,2 +1,6 @@ |
|||
*.db |
|||
.idea |
|||
*/functions/* |
|||
*/cfg/servers/* |
|||
*/lgsm/* |
|||
|
|||
|
@ -0,0 +1,125 @@ |
|||
#!/bin/bash |
|||
# |
|||
# This is a temporary tool which I am using to look into Git cloning of addons. |
|||
# The list lives in this script for the time being, and this is not ready for production! |
|||
|
|||
# Root directory where addons live. Create it if missing. |
|||
addons_root=~/serverfiles/garrysmod/addons |
|||
if [ ! -e $addons_root ] |
|||
then |
|||
mkdir -p $addons_root |
|||
fi |
|||
|
|||
# Git protocol to use for fetching repos, options are "ssh" and "https" |
|||
git_protocol="ssh" |
|||
|
|||
# List of addons to manage, an array of comma-delimted strings. Format is user,repo,branch,method |
|||
addons_list=( |
|||
"nrlulz,ACF,master,zip", |
|||
"wiremod,advdupe2,master,tarball", |
|||
"wiremod,wire,master,clone" |
|||
) |
|||
|
|||
# Program flow |
|||
|
|||
for addon_data in ${addons_list[@]} |
|||
do |
|||
# Split addon data into separate fields |
|||
IFS=, read githubuser githubrepo githubbranch gitmethod <<< "${addon_data}" |
|||
echo "Managing ${githubuser}/${githubrepo}..." |
|||
|
|||
# Get current release |
|||
current_release_url="https://api.github.com/repos/${githubuser}/${githubrepo}/git/refs/heads/${githubbranch}" |
|||
current_release=$(curl -s -L $current_release_url | grep '"sha"' | cut -d'"' -f4) |
|||
|
|||
# Addon path has the repo name in lower-case for gmod linux weirdness |
|||
addon_lcase=$(echo $githubrepo | tr '[:upper:]' '[:lower:]') |
|||
addon_path="${addons_root}/${addon_lcase}" |
|||
|
|||
# Archive type to download |
|||
# Do the update/install |
|||
case "${gitmethod}" in |
|||
# Allow archive download/deployment as one method of installation |
|||
tar|tarball|archive|download|zip|zipfile|zipball) |
|||
if [ "${gitmethod}" == "zip" ] || [ "${gitmethod}" == "zipfile" ] || [ "${gitmethod}" == "zipball" ] |
|||
then |
|||
archive_format="zipball" |
|||
else |
|||
archive_format="tarball" |
|||
fi |
|||
|
|||
echo "Using archive (${archive_format})" |
|||
# Download archive if it's not present. This will require we leave the archives in place, so we need to think about that |
|||
archive_url="https://github.com/${githubuser}/${githubrepo}/${archive_format}/${githubbranch}" |
|||
|
|||
# Get filename of latest archive, this includes the commit hash |
|||
archive_file="${addons_root}/$(curl -sLI $archive_url | grep -o -E '^Content-Disp.*filename=.*$' | sed -e 's/.*filename=//' -e 's/[\x01-\x1F\x7F]//g')" |
|||
archive_unpack=$(echo $archive_file | sed -e 's/\.\(tar\.gz\|tar\|zip\)$//g') |
|||
archive_linktarget=$(basename $archive_unpack) |
|||
# If the unpacked directory isn't there, download and deploy |
|||
# FIXME: There needs to be a better way of tracking installs that doesn't require leaving archives lying around. Cleanup would be good. |
|||
if [ ! -e $archive_unpack ] |
|||
then |
|||
# TODO: Should we uninstall or delete the old addon? Any configs or other data that need to be retained? |
|||
# TODO: Checksum the downloaded files and remove/retry if corrupt |
|||
echo "Fetching ${githubrepo} ($(basename $archive_file))..." |
|||
curl -s -L -o $archive_file $archive_url |
|||
if [ "${archive_format}" == "zipfile" ] |
|||
then |
|||
# Unzip file |
|||
unzip $archive_file -d $addons_path |
|||
else |
|||
# Untar. FIXME: Assuming gzip, should probably have a little logic here. |
|||
# This descends one directory so we get rid of the directory with the same name as the archive |
|||
tar xzvpf $archive_file -C $addons_path |
|||
fi |
|||
fi |
|||
|
|||
# Update symlink. This will BLOW AWAY a real directory, may want to adjust that behavior. |
|||
if [ "$(basename $(readlink -f $addon_path))" != "${archive_linktarget}" ] |
|||
then |
|||
echo "Pointing ${addon_lcase} to ${archive_linktarget}" |
|||
ln -nsf $archive_linktarget "${addon_path}" |
|||
fi |
|||
;; |
|||
# Otherwise, use Git natively |
|||
*) |
|||
echo "Using Native Git" |
|||
# Get repo URL based upon our protocol |
|||
if [ "${git_protocol}" == "ssh" ] |
|||
then |
|||
repo_url="[email protected]:${githubuser}/${githubrepo}.git" |
|||
else |
|||
repo_url="https://github.com/${githubuser}/${githubrepo}.git" |
|||
fi |
|||
|
|||
# Clone repo if it does not exist |
|||
if [ ! -e $addon_path ] |
|||
then |
|||
cd $addons_root && git clone $repo_url $addon_lcase |
|||
fi |
|||
|
|||
# Init repo if directory has no .git subdirectory |
|||
if [ ! -e $addon_path ] |
|||
then |
|||
cd $addons_root && git init |
|||
fi |
|||
|
|||
# Check to make sure we have the right remote |
|||
repo_remote=$(cd $addon_path && git remote -v | grep '^origin' | grep '\(fetch\)' | awk '{print $2}') |
|||
if [ "${repo_remote}" != "${repo_url}" ] |
|||
then |
|||
# TODO: Possibly delete incorrect remotes? |
|||
cd $addon_path && git remote add -f -t $githubbranch -m $githubbranch origin $repo_url |
|||
fi |
|||
|
|||
# Check to make sure we are on the latest commit |
|||
repo_commit=$(cd $addon_path && git show | head -n1 | awk '{print $2}') |
|||
if [ "${repo_commit}" != "${current_release}" ] |
|||
then |
|||
cd $addon_path && git pull origin $githubbranch |
|||
fi |
|||
;; |
|||
esac |
|||
echo "Up to date" |
|||
done |
@ -3,137 +3,163 @@ |
|||
# 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 protected]" |
|||
|
|||
# Steam login |
|||
steamuser="anonymous" |
|||
steampass="" |
|||
|
|||
# Start Variables |
|||
defaultmap="ministry" |
|||
maxplayers="16" |
|||
tickrate="64" |
|||
port="27015" |
|||
sourcetvport="27020" |
|||
clientport="27005" |
|||
ip="0.0.0.0" |
|||
updateonstart="off" |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
|
|||
#### Advanced Variables #### |
|||
version="190116" |
|||
|
|||
# File fetching settings |
|||
# Github Branch Select |
|||
# Allows for the use of different function files |
|||
# from a different repo and/or branch. |
|||
githubuser="dgibbs64" |
|||
githubuser="jaredballou" |
|||
githubrepo="linuxgsm" |
|||
githubbranch="master" |
|||
|
|||
# Steam |
|||
appid="237410" |
|||
# Update stale files on the fly using Git |
|||
git_update=0 |
|||
|
|||
#### Variables #### |
|||
|
|||
# The name of this script file, used to show the LGSM link properly |
|||
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
|||
|
|||
# Server Details |
|||
servicename="ins-server" |
|||
gamename="Insurgency" |
|||
engine="source" |
|||
# Name of this service (for symlinked instances) |
|||
servicename="$(basename $0)" |
|||
|
|||
# Directories |
|||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
|||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|||
lockselfname=".${servicename}.lock" |
|||
filesdir="${rootdir}/serverfiles" |
|||
systemdir="${filesdir}/insurgency" |
|||
executabledir="${filesdir}" |
|||
executable="./srcds_linux" |
|||
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 root |
|||
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
|||
# LGSM Support Files - set ro rootdir for old behavior |
|||
lgsmdir="${rootdir}/lgsm" |
|||
# Temporary path to store and manipulate settings |
|||
settingsdir="${lgsmdir}/settings.tmp" |
|||
# Supported Game Data |
|||
gamedatadir="${lgsmdir}/cfg/gamedata" |
|||
# Config path for local instances |
|||
scriptcfgdir="${lgsmdir}/cfg/servers" |
|||
# Temporary cache location |
|||
cachedir="${lgsmdir}/tmp" |
|||
|
|||
# Git last commit file (for tracking updates) |
|||
lastcommit_file="${cachedir}/lastcommit" |
|||
|
|||
|
|||
# Debugging, if debugflag exists send output to $debuglog |
|||
debugflag="${lgsmdir}/.dev-debug" |
|||
debuglog="${lgsmdir}/dev-debug.log" |
|||
if [ -f "${debugflag}" ]; then |
|||
exec 5>${debuglog} |
|||
BASH_XTRACEFD="5" |
|||
set -x |
|||
fi |
|||
|
|||
#ipaddr=$(ip addr show $(ip route | grep '^default' | awk '{print $NF}') | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') |
|||
|
|||
##### Script ##### |
|||
# Do not edit |
|||
|
|||
# fn_colortext color msg |
|||
# Display a message with a color code |
|||
# Paremeters: |
|||
# color: Numeric color code |
|||
# msg: Message. This includes all further paremeters, so there is no need to quote a message with spaces in it. |
|||
fn_colortext(){ |
|||
#Black 0;30 Dark Gray 1;30 |
|||
#Red 0;31 Light Red 1;31 |
|||
#Green 0;32 Light Green 1;32 |
|||
#Brown/Orange 0;33 Yellow 1;33 |
|||
#Blue 0;34 Light Blue 1;34 |
|||
#Purple 0;35 Light Purple 1;35 |
|||
#Cyan 0;36 Light Cyan 1;36 |
|||
#Light Gray 0;37 White 1;37 |
|||
case "${1}" in |
|||
green) |
|||
color="\033[0;32m";; |
|||
yellow) |
|||
color="\033[0;33m";; |
|||
reset) |
|||
color="\033[0m";; |
|||
red) |
|||
color="\033[0;31m";; |
|||
*) |
|||
color="\033[0;${1}m";; |
|||
esac |
|||
echo -e "[${color}${@:2}\e[0m]" |
|||
} |
|||
|
|||
# Set fetchcmd to the full path of whatever command we can to fetch files |
|||
for fetchcmd in curl wget |
|||
do |
|||
paths="$(command -v ${fetchcmd} 2>/dev/null) $(which ${fetchcmd} >/dev/null 2>&1) /usr/bin/${fetchcmd} /bin/${fetchcmd} /usr/sbin/${fetchcmd} /sbin/${fetchcmd} $(echo $PATH | sed "s/\([:]\|\$\)/\/${fetchcmd} /g")" |
|||
for tp in $paths |
|||
do |
|||
if [ -x $tp ]; then |
|||
fetchcmd=$tp |
|||
break 2 |
|||
fi |
|||
done |
|||
done |
|||
# If we have no executable fetchcmd, fail script execution |
|||
if [ ! -x "${fetchcmd}" ]; then |
|||
fn_colortext 31 FAIL |
|||
echo "Cannot find curl or wget!" |
|||
exit 1 |
|||
fi |
|||
|
|||
# fn_getgithubfile filename [exec] [url] |
|||
# Download file from Github |
|||
# Parameters: |
|||
# filename: The path of the file in reference to the repository root |
|||
# exec: Optional, set to 1 to make file executable |
|||
# url: Optional, set to full path under repository root if different than filename |
|||
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}" |
|||
filename=$1 |
|||
exec=$2 |
|||
fileurl=${3:-$filename} |
|||
force=$4 |
|||
filepath="${lgsmdir}/${filename}" |
|||
filedir=$(dirname "${filepath}") |
|||
|
|||
# If the function file is missing, then download |
|||
if [ ! -f "${filepath}" ] || [ "${force}" != "" ]; then |
|||
if [ ! -d "${filedir}" ]; then |
|||
mkdir -p "${filedir}" |
|||
fi |
|||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|||
echo -ne " fetching ${filename} (${githuburl})... " |
|||
if [ "$(basename ${fetchcmd})" == "curl" ]; then |
|||
cmd="$fetchcmd -s --fail -o" |
|||
elif [ "$(basename ${fetchcmd})" == "wget" ]; then |
|||
cmd="$fetchcmd -O" |
|||
fi |
|||
fetch=$($cmd "${filepath}" "${githuburl}" 2>&1) |
|||
if [ "${exec}" != "" ]; then |
|||
chmod +x "${filepath}" |
|||
fi |
|||
fn_colortext 32 "DONE" |
|||
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 |
|||
if [ "${exec}" == "1" ]; then |
|||
source "${filepath}" |
|||
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_runfunction(){ |
|||
scriptfile=${1:-$functionfile} |
|||
functionfile=$scriptfile |
|||
fn_getgithubfile "functions/${functionfile}" 1 |
|||
fn_check_github_files "${lgsmdir}" "${lgsmdir}/functions/${functionfile}" |
|||
} |
|||
|
|||
core_functions.sh(){ |
|||
# Functions are defined in core_functions.sh. |
|||
functionfile="${FUNCNAME}" |
|||
fn_runfunction |
|||
} |
|||
# Load GitHub hashing and updating functions |
|||
fn_runfunction github_hash.sh |
|||
|
|||
# Process game configs and load variables needed to run script |
|||
fn_runfunction game_settings.sh |
|||
|
|||
core_functions.sh |
|||
# Load core functions |
|||
fn_runfunction core_functions.sh |
|||
|
|||
# Get option from command line and run option parser |
|||
getopt=$1 |
|||
core_getopt.sh |
|||
|
@ -0,0 +1,91 @@ |
|||
#!/bin/bash |
|||
# LGSM git manifest functions |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
# |
|||
# This is another one of my POC tools. Eventually I want to have a pretty robust update/download system here |
|||
# Goals: |
|||
# * Keep function files up to date on client machines |
|||
# * Deploy other programs or support tools |
|||
# * Learn more about GitHub API |
|||
# * Parse JSON in Bash |
|||
|
|||
# fn_getgithash filename |
|||
# Calculate the Git hash for a file |
|||
function fn_get_git_hash(){ |
|||
filename=$1 |
|||
if [ -e $filename ] |
|||
then |
|||
filesize=$(stat --format='%s' $filename) |
|||
if [ "$(tail -c1 $filename)" == "" ]; then |
|||
printf "blob %d\0%s\n" "${filesize}" "$(cat $filename)" | sha1sum | awk '{print $1}' |
|||
else |
|||
printf "blob %d\0%s" "${filesize}" "$(cat $filename)" | sha1sum | awk '{print $1}' |
|||
fi |
|||
# printf "blob %d\0%s" "$(stat --format='%s' $filename)" "$(awk '{print $0}' $filename)" | sha1sum | awk '{print $1}' |
|||
fi |
|||
} |
|||
|
|||
|
|||
fn_githget_ub_manifest(){ |
|||
# Create cache directory if missing |
|||
if [ ! -e "${cachedir}" ] |
|||
then |
|||
mkdir -p "${cachedir}" |
|||
fi |
|||
# Get latest commit from GitHub. Cache file for 60 minutes |
|||
if [ -e $lastcommit_file ]; then |
|||
if [ $(($(date +%s) - $(date -r ${lastcommit_file} +%s))) -gt 3600 ]; then |
|||
fetch=1 |
|||
else |
|||
fetch=0 |
|||
fi |
|||
else |
|||
fetch=1 |
|||
fi |
|||
if [ $fetch -eq 1 ]; then |
|||
echo "Fetching ${lastcommit_file}" |
|||
curl -s "https://api.github.com/repos/${githubuser}/${githubrepo}/git/refs/heads/${githubbranch}" -o "${lastcommit_file}.json" |
|||
${lgsmdir}/functions/jq-linux64 -r '.object.sha' "${lastcommit_file}.json" > "${lastcommit_file}" |
|||
fi |
|||
# Get manifest of all files at this revision in GitHub. These hashes are what we use to compare and select files that need to be updated. |
|||
manifest="${cachedir}/$(cat "${lastcommit_file}").manifest" |
|||
if [ ! -e "${manifest}.json" ]; then |
|||
curl -Ls "https://api.github.com/repos/${githubuser}/${githubrepo}/git/trees/${githubbranch}?recursive=1" -o "${manifest}.json" |
|||
fi |
|||
if [ ! -e "${manifest}" ]; then |
|||
${lgsmdir}/functions/jq-linux64 -r '.tree[] | .path + " " + .sha' "${manifest}.json" > "${manifest}" |
|||
fi |
|||
} |
|||
# Check files against manifest |
|||
fn_github_checkfiles(){ |
|||
prefix=$1 |
|||
files=${@:2} |
|||
fn_github_manifest |
|||
manifest="${cachedir}/$(cat "${lastcommit_file}").manifest" |
|||
# Check all files in functions for updates |
|||
for file in $files |
|||
do |
|||
if [ -d $file ]; then |
|||
echo "Descending into ${file}..." |
|||
fn_github_checkfiles "${prefix}" ${file}/* |
|||
else |
|||
myhash=$(fn_getgithash $file) |
|||
repofile=$(echo $file | sed -e "s|${1}[/]*||g") |
|||
githash=$(grep "^$repofile " $manifest 2>/dev/null| cut -d" " -f2) |
|||
if [ "${githash}" == "" ] |
|||
then |
|||
echo "Can't find ${repofile} in git!" |
|||
elif [ "${myhash}" != "${githash}" ] |
|||
then |
|||
echo "Would fetch ${repofile}: have ${myhash}, expected ${githash}" |
|||
else |
|||
echo "${repofile} is OK" |
|||
fi |
|||
fi |
|||
done |
|||
} |
|||
lgsmdir="./lgsm" |
|||
cachedir="${lgsmdir}/tmp" |
|||
lastcommit_file="${cachedir}/lastcommit" |
|||
fn_github_checkfiles $lgsmdir ${lgsmdir}/functions |
@ -0,0 +1,177 @@ |
|||
#!/bin/bash |
|||
# Insurgency |
|||
# Server Management Script |
|||
# Author: Daniel Gibbs |
|||
# Website: http://gameservermanagers.com |
|||
|
|||
version="200116" |
|||
|
|||
# File fetching settings |
|||
# Github Branch Select |
|||
# Allows for the use of different function files |
|||
# from a different repo and/or branch. |
|||
githubuser="jaredballou" |
|||
githubrepo="linuxgsm" |
|||
githubbranch="master" |
|||
|
|||
# Update stale files on the fly using Git |
|||
git_update=0 |
|||
|
|||
#### Variables #### |
|||
|
|||
# The name of this script file, used to show the LGSM link properly |
|||
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
|||
|
|||
# Name of this service (for symlinked instances) |
|||
servicename="$(basename $0)" |
|||
|
|||
# Directories |
|||
|
|||
# Script root |
|||
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
|||
# LGSM Support Files - set ro rootdir for old behavior |
|||
lgsmdir="${rootdir}/lgsm" |
|||
# Temporary path to store and manipulate settings |
|||
settingsdir="${lgsmdir}/settings.tmp" |
|||
# Supported Game Data |
|||
gamedatadir="${lgsmdir}/gamedata" |
|||
# Config path for local instances |
|||
scriptcfgdir="${lgsmdir}/cfg/servers" |
|||
# Temporary cache location |
|||
cachedir="${lgsmdir}/tmp" |
|||
|
|||
# Create all the directories we need |
|||
for dir in $(grep '^[a-zA-Z0-9]*dir=' $0 | cut -d'=' -f1); do |
|||
if [ ! -e "${!dir}" ]; then |
|||
echo "Creating ${dir} at ${!dir}" |
|||
mkdir -p "${!dir}" |
|||
fi |
|||
done |
|||
# Git last commit file (for tracking updates) |
|||
lastcommit_file="${cachedir}/lastcommit" |
|||
|
|||
|
|||
# Debugging, if debugflag exists send output to $debuglog |
|||
debugflag="${lgsmdir}/.dev-debug" |
|||
debuglog="${lgsmdir}/dev-debug.log" |
|||
if [ -f "${debugflag}" ]; then |
|||
exec 5>${debuglog} |
|||
BASH_XTRACEFD="5" |
|||
set -x |
|||
fi |
|||
|
|||
#ipaddr=$(ip addr show $(ip route | grep '^default' | awk '{print $NF}') | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') |
|||
|
|||
##### Script ##### |
|||
# Do not edit |
|||
|
|||
# fn_colortext color msg |
|||
# Display a message with a color code |
|||
# Paremeters: |
|||
# color: Numeric color code |
|||
# msg: Message. This includes all further paremeters, so there is no need to quote a message with spaces in it. |
|||
fn_colortext(){ |
|||
#Black 0;30 Dark Gray 1;30 |
|||
#Red 0;31 Light Red 1;31 |
|||
#Green 0;32 Light Green 1;32 |
|||
#Brown/Orange 0;33 Yellow 1;33 |
|||
#Blue 0;34 Light Blue 1;34 |
|||
#Purple 0;35 Light Purple 1;35 |
|||
#Cyan 0;36 Light Cyan 1;36 |
|||
#Light Gray 0;37 White 1;37 |
|||
case "${1}" in |
|||
green) |
|||
color="\033[0;32m";; |
|||
yellow) |
|||
color="\033[0;33m";; |
|||
reset) |
|||
color="\033[0m";; |
|||
red) |
|||
color="\033[0;31m";; |
|||
*) |
|||
color="\033[0;${1}m";; |
|||
esac |
|||
echo -e "[${color}${@:2}\e[0m]" |
|||
} |
|||
|
|||
# Set fetchcmd to the full path of whatever command we can to fetch files |
|||
for fetchcmd in curl wget |
|||
do |
|||
paths="$(command -v ${fetchcmd} 2>/dev/null) $(which ${fetchcmd} >/dev/null 2>&1) /usr/bin/${fetchcmd} /bin/${fetchcmd} /usr/sbin/${fetchcmd} /sbin/${fetchcmd} $(echo $PATH | sed "s/\([:]\|\$\)/\/${fetchcmd} /g")" |
|||
for tp in $paths |
|||
do |
|||
if [ -x $tp ]; then |
|||
fetchcmd=$tp |
|||
break 2 |
|||
fi |
|||
done |
|||
done |
|||
# If we have no executable fetchcmd, fail script execution |
|||
if [ ! -x "${fetchcmd}" ]; then |
|||
fn_colortext 31 FAIL |
|||
echo "Cannot find curl or wget!" |
|||
exit 1 |
|||
fi |
|||
|
|||
# fn_getgithubfile filename [exec] [url] |
|||
# Download file from Github |
|||
# Parameters: |
|||
# filename: The path of the file in reference to the repository root |
|||
# exec: Optional, set to 1 to make file executable |
|||
# url: Optional, set to full path under repository root if different than filename |
|||
fn_getgithubfile(){ |
|||
filename=$1 |
|||
exec=$2 |
|||
fileurl=${3:-$filename} |
|||
force=$4 |
|||
filepath="${lgsmdir}/${filename}" |
|||
filedir=$(dirname "${filepath}") |
|||
|
|||
# If the function file is missing, then download |
|||
if [ ! -f "${filepath}" ] || [ "${force}" != "" ]; then |
|||
if [ ! -d "${filedir}" ]; then |
|||
mkdir -p "${filedir}" |
|||
fi |
|||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|||
echo -ne " fetching ${filename} (${githuburl})... " |
|||
if [ "$(basename ${fetchcmd})" == "curl" ]; then |
|||
cmd="$fetchcmd -s --fail -o" |
|||
elif [ "$(basename ${fetchcmd})" == "wget" ]; then |
|||
cmd="$fetchcmd -O" |
|||
fi |
|||
fetch=$($cmd "${filepath}" "${githuburl}" 2>&1) |
|||
if [ "${exec}" != "" ]; then |
|||
chmod +x "${filepath}" |
|||
fi |
|||
fn_colortext 32 "DONE" |
|||
fi |
|||
if [ "${exec}" == "1" ]; then |
|||
source "${filepath}" |
|||
fi |
|||
} |
|||
|
|||
# fn_runfunction |
|||
fn_runfunction(){ |
|||
scriptfile=${1:-$functionfile} |
|||
functionfile=$scriptfile |
|||
fn_getgithubfile "functions/${functionfile}" 1 |
|||
fn_check_github_files "${lgsmdir}" "${lgsmdir}/functions/${functionfile}" |
|||
} |
|||
|
|||
# Load GitHub hashing and updating functions |
|||
fn_runfunction github_hash.sh |
|||
|
|||
# Load core functions |
|||
fn_runfunction core_functions.sh |
|||
|
|||
if [ "${selfname}" == "lgsm-core" ]; |
|||
then |
|||
fn_runfunction install_lgsm.sh |
|||
else |
|||
# Process game configs and load variables needed to run script |
|||
fn_runfunction game_settings.sh |
|||
|
|||
# Get option from command line and run option parser |
|||
getopt=$1 |
|||
core_getopt.sh |
|||
fi |
@ -0,0 +1,146 @@ |
|||
#!/bin/bash |
|||
# LGSM game_settings.sh function |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
lgsm_version="180116" |
|||
|
|||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|||
local modulename="Settings" |
|||
|
|||
# Config files |
|||
cfg_file_default="${scriptcfgdir}/_default.cfg" |
|||
cfg_file_common="${scriptcfgdir}/_common.cfg" |
|||
cfg_file_instance="${scriptcfgdir}/${servicename}.cfg" |
|||
|
|||
# Config file headers |
|||
cfg_header_all="# Your settings for all servers go in _common.cfg\n# Server-specific settings go into \$SERVER.cfg" |
|||
cfg_header_default="# Default config - Changes will be overwritten by updates.\n${cfg_header_all}" |
|||
cfg_header_common="# Common config - Will not be overwritten by script.\n${cfg_header_all}" |
|||
cfg_header_instance="# Instance Config for ${servicename} - Will not be overwritten by script.\n${cfg_header_all}" |
|||
|
|||
|
|||
# If default config does not exist, create it. This should come from Git, and will be overwritten by updates. |
|||
# Rather than try to wget it from Github or other fancy ways to get it, the simplest way to ensure it works is to simply create it here. |
|||
fn_update_config() |
|||
{ |
|||
key=$1 |
|||
val=$2 |
|||
cfg_file=${3:-$cfg_file_default} |
|||
comment=${4:-""} |
|||
|
|||
# Get current key/value pair from file |
|||
exists=$(grep "^${key}=" $cfg_file 2>/dev/null) |
|||
exists_comment=$(echo $(echo $exists | cut -d'#' -f2-)) |
|||
case "${val}" in |
|||
""|"--UNSET--") |
|||
if [ "${exists}" != "" ]; then |
|||
echo "Removing ${key} from ${cfg_file}" |
|||
sed "/${key}=.*/d" -i $cfg_file |
|||
fi |
|||
return |
|||
;; |
|||
"--EMPTY--") |
|||
val="" |
|||
;; |
|||
esac |
|||
# Put " # " at beginning of comment if not empty |
|||
if [ "${comment}" != "" ] |
|||
then |
|||
comment=" # ${comment}" |
|||
else |
|||
if [ "${exists_comment}" != "" ]; then |
|||
comment=" # ${exists_comment}" |
|||
fi |
|||
fi |
|||
|
|||
# Line to be put in |
|||
data="${key}=\"${val}\"${comment}" |
|||
|
|||
# Check if key exists in config |
|||
if [ "${exists}" != "" ]; then |
|||
# If the line isn't the same as the parsed data line, replace it |
|||
if [ "${exists}" != "${data}" ]; then |
|||
#echo "Updating ${data} in ${cfg_file}" |
|||
sed -e "s%^${key}=.*\$%${data}%g" -i $cfg_file |
|||
#sed "/${key}=.*/${data}/" -i $cfg_file |
|||
fi |
|||
else |
|||
# If value does not exist, append to file |
|||
#echo "Adding ${data} to ${cfg_file}" |
|||
echo -ne "${data}\n" >> $cfg_file |
|||
fi |
|||
} |
|||
|
|||
fn_create_config(){ |
|||
cfg_type=${1:-default} |
|||
cfg_force=$2 |
|||
cfg_file="cfg_file_${cfg_type}" |
|||
cfg_header="cfg_header_${cfg_type}" |
|||
|
|||
cfg_dir=$(dirname ${!cfg_file}) |
|||
#If config directory does not exist, create it |
|||
if [ ! -e $cfg_dir ]; then mkdir -p $cfg_dir; fi |
|||
|
|||
# Create file header if needed |
|||
if [ ! -e ${!cfg_file} ] || [ "${cfg_force}" != "" ]; then |
|||
echo "Creating ${cfg_type} config at ${!cfg_file}" |
|||
echo -ne "${!cfg_header}\n\n" > ${!cfg_file} |
|||
# Dump in defaults for this game |
|||
if [ "${cfg_type}" == "default" ]; then |
|||
cat ${settingsdir}/settings >> ${!cfg_file} |
|||
fi |
|||
fi |
|||
} |
|||
|
|||
fn_flush_game_settings(){ |
|||
if [ -e $settingsdir ]; then |
|||
rm -rf $settingsdir > /dev/null |
|||
fi |
|||
mkdir -p $settingsdir |
|||
} |
|||
|
|||
fn_import_game_settings(){ |
|||
import="${gamedatadir}/${1}" |
|||
importdir=$(echo "${gamedatadir}" | sed -e "s|${lgsmdir}/||g") |
|||
#echo $importdir |
|||
if [ ! -e $import ]; then |
|||
fn_getgithubfile "${importdir}/${1}" 1 "gamedata/${1}" |
|||
fi |
|||
source $import |
|||
} |
|||
|
|||
fn_set_game_params(){ |
|||
param_set=$1 |
|||
param_name=$2 |
|||
param_value=$3 |
|||
param_comment=$4 |
|||
fn_update_config "${param_name}" "${param_value}" "${settingsdir}/${param_set}" "${param_comment}" |
|||
} |
|||
|
|||
|
|||
fn_get_game_params(){ |
|||
param_set=$1 |
|||
param_name=$2 |
|||
param_default=$3 |
|||
} |
|||
|
|||
# Flush old setings buffer |
|||
fn_flush_game_settings |
|||
|
|||
# Import this game's settings |
|||
fn_import_game_settings $selfname |
|||
|
|||
# New method is to always run this function, it will overwrite defaults with whatever the new script values are |
|||
cfg_version_default=$(grep '^lgsm_version="' "${cfg_file_default}" 2>&1 | cut -d'"' -f2) |
|||
if [ "${cfg_version_default}" != "${version}" ]; then |
|||
fn_create_config default 1 |
|||
fi |
|||
|
|||
# Load defaults |
|||
source $cfg_file_default |
|||
|
|||
# Load sitewide common settings (so that Git updates can safely overwrite default.cfg) |
|||
if [ ! -f $cfg_file_common ]; then fn_create_config common; else source $cfg_file_common; fi |
|||
|
|||
# Load instance specific settings |
|||
if [ ! -f $cfg_file_instance ]; then fn_create_config instance; else source $cfg_file_instance; fi |
@ -0,0 +1,91 @@ |
|||
#!/bin/bash |
|||
# LGSM git manifest functions |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
# |
|||
# This is another one of my POC tools. Eventually I want to have a pretty robust update/download system here |
|||
# Goals: |
|||
# * Keep function files up to date on client machines |
|||
# * Deploy other programs or support tools |
|||
# * Learn more about GitHub API |
|||
# * Parse JSON in Bash |
|||
|
|||
# fn_get_git_hash $filename |
|||
# Calculate the Git hash for a file |
|||
function fn_get_git_hash(){ |
|||
filename=$1 |
|||
if [ -e $filename ]; then |
|||
gitcmd="$(which git)" |
|||
if [ -x "${gitcmd}" ]; then |
|||
$gitcmd hash-object "${filename}" |
|||
else |
|||
filesize=$(stat --format='%s' $filename) |
|||
if [ "$(tail -c1 $filename)" == "" ]; then |
|||
printf "blob %d\0%s\n" "${filesize}" "$(cat $filename)" | sha1sum | awk '{print $1}' |
|||
else |
|||
printf "blob %d\0%s" "${filesize}" "$(cat $filename)" | sha1sum | awk '{print $1}' |
|||
fi |
|||
fi |
|||
fi |
|||
} |
|||
|
|||
fn_get_github_manifest(){ |
|||
# Create cache directory if missing |
|||
if [ ! -e "${cachedir}" ]; then |
|||
mkdir -p "${cachedir}" |
|||
fi |
|||
fn_getgithubfile "functions/jq-linux64" |
|||
jq_path="${lgsmdir}/functions/jq-linux64" |
|||
chmod +x "${jq_path}" |
|||
# Get latest commit from GitHub. Cache file for 60 minutes |
|||
if [ -e $lastcommit_file ]; then |
|||
if [ $(($(date +%s) - $(date -r ${lastcommit_file} +%s))) -gt 3600 ]; then |
|||
fetch=1 |
|||
else |
|||
fetch=0 |
|||
fi |
|||
else |
|||
fetch=1 |
|||
fi |
|||
if [ $fetch -eq 1 ]; then |
|||
echo "Fetching ${lastcommit_file}" |
|||
curl -s "https://api.github.com/repos/${githubuser}/${githubrepo}/git/refs/heads/${githubbranch}" -o "${lastcommit_file}.json" |
|||
"${jq_path}" -r '.object.sha' "${lastcommit_file}.json" > "${lastcommit_file}" |
|||
fi |
|||
# Get manifest of all files at this revision in GitHub. These hashes are what we use to compare and select files that need to be updated. |
|||
manifest="${cachedir}/$(cat "${lastcommit_file}").manifest" |
|||
if [ ! -e "${manifest}.json" ]; then |
|||
curl -Ls "https://api.github.com/repos/${githubuser}/${githubrepo}/git/trees/${githubbranch}?recursive=1" -o "${manifest}.json" |
|||
fi |
|||
if [ ! -e "${manifest}" ]; then |
|||
"${jq_path}" -r '.tree[] | .path + " " + .sha' "${manifest}.json" > "${manifest}" |
|||
fi |
|||
} |
|||
|
|||
# Check files against manifest |
|||
fn_check_github_files(){ |
|||
# Return unless turned on |
|||
if [ "${git_update}" != "1" ]; then return; fi |
|||
|
|||
prefix=$1 |
|||
files=${@:2} |
|||
fn_get_github_manifest |
|||
manifest="${cachedir}/$(cat "${lastcommit_file}").manifest" |
|||
# Check all files in functions for updates |
|||
for file in $files; do |
|||
if [ -d $file ]; then |
|||
#echo "Descending into ${file}..." |
|||
fn_check_github_files "${prefix}" ${file}/* |
|||
else |
|||
myhash=$(fn_get_git_hash $file) |
|||
repofile=$(echo $file | sed -e "s|${1}[/]*||g") |
|||
githash=$(grep "^$repofile " $manifest 2>/dev/null| cut -d" " -f2) |
|||
if [ "${githash}" == "" ]; then |
|||
echo "Can't find ${repofile} in git!" |
|||
elif [ "${myhash}" != "${githash}" ]; then |
|||
#echo "Would fetch ${repofile}: have ${myhash}, expected ${githash}" |
|||
fn_getgithubfile "${repofile}" 0 "${repofile}" 1 |
|||
fi |
|||
fi |
|||
done |
|||
} |
@ -0,0 +1,45 @@ |
|||
#!/bin/bash |
|||
# LGSM install_lgsm function |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
lgsm_version="200116" |
|||
|
|||
# Description: Display menu of available games and install the one selected |
|||
|
|||
# Perform installation |
|||
fn_runfunction menu.sh |
|||
# Listing of available games |
|||
gamelist="gamedata/__game_list" |
|||
# Installation path |
|||
installpath=$(cd ~ && pwd) |
|||
# Get game list |
|||
fn_getgithubfile $gamelist |
|||
# Display installer menu |
|||
fn_menu result "Linux Game Server Manager" "Select game to install" "${lgsmdir}/${gamelist}" |
|||
# If we have a selection, do the install |
|||
if [ -n "${result}" ]; then |
|||
# Confirm path for installation |
|||
read -p "Select path to install ${result} [${installpath}]: " input |
|||
installpath=${input:-$installpath} |
|||
scriptpath="${installpath}/${result}" |
|||
# If file exists, confirm overwrite |
|||
if [ -e "${scriptpath}" ]; then |
|||
read -p "WARNING! ${scriptpath} already exists! OVERWRITE!? [y/N]: " input |
|||
if [ "${input}" != "y" ] && [ "${input}" != "Y" ]; then exit; fi |
|||
fi |
|||
# Install script |
|||
echo -ne "Installing to ${scriptpath}... \c" |
|||
# Create directory if missing. TODO: Gravefully handle errors like giving a file as the install dir |
|||
if [ ! -e $(dirname "${scriptpath}") ]; then |
|||
mkdir -p $(dirname "${scriptpath}") |
|||
fi |
|||
# Copy script and set executable |
|||
cp "${0}" "${scriptpath}" |
|||
chmod 0755 "${scriptpath}" |
|||
if [ $? ]; then |
|||
fn_colortext green "Done" |
|||
echo "Script deployed to ${scriptpath}" |
|||
else |
|||
fn_colortext red "FAIL" |
|||
fi |
|||
fi |
@ -0,0 +1,77 @@ |
|||
#!/bin/bash |
|||
# LGSM install_sourcemod.sh |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
|
|||
# This downloads and installs the latest stable versions of MetaMod and SourceMod |
|||
|
|||
lgsm_version="200116" |
|||
|
|||
|
|||
# MetaMod |
|||
fn_install_metamod(){ |
|||
# Get installation path for MetaMod |
|||
mm_path="${1:-"${systemdir}/addons/metamod"}" |
|||
mm_root=$(cd "$(dirname $(dirname "${mm_path}"))" && pwd) |
|||
if [ -e "${mm_path}" ]; then |
|||
read -p "WARNING! MetaMod exists at ${mm_path}! OVERWRITE!? [y/N]: " input |
|||
if [ "${input}" != "y" ] && [ "${input}" != "Y" ]; then return; fi |
|||
fi |
|||
# Download URL base |
|||
mm_url_base="http://www.sourcemm.net/downloads/" |
|||
# Get latest release file name |
|||
echo "Getting latest MetaMod version..." |
|||
mm_file_latest="$(curl -sL "${mm_url_base}" | grep -m1 -o "mmsource-[0-9\.a-zA-Z]*-linux\.tar\.gz")" |
|||
mm_file="${cachedir}/${mm_file_latest}" |
|||
# If file is not here, download it |
|||
if [ ! -e "${mm_file}" ]; then |
|||
echo -ne "Downloading ${mm_file_latest}... \c" |
|||
# Get mirror URLs |
|||
mm_file_urls="$(curl -sL "${mm_url_base}${mm_file_latest}" | grep -o -E 'href="http([^"#]+)mmsource-1.10.6-linux.tar.gz"' | cut -d'"' -f2)" |
|||
# Try each mirror |
|||
for url in $mm_file_urls; do |
|||
# Download file |
|||
curl -sL "${url}" -o "${mm_file}" |
|||
# If file downloaded, exit loop |
|||
if [ -e "${mm_file}" ]; then break; fi |
|||
done |
|||
if [ ! -e "${mm_file}" ]; then |
|||
fn_colortext red FAILED |
|||
exit 1 |
|||
else |
|||
fn_colortext green DONE |
|||
fi |
|||
fi |
|||
# Unzip MetaMod to addons |
|||
tar -xzvpf "${mm_file}" -C "${mm_root}" |
|||
} |
|||
fn_install_sourcemod(){ |
|||
# Get installation path for SourceMod |
|||
sm_path="${1:-"${systemdir}/addons/sourcemod"}" |
|||
sm_root=$(cd "$(dirname $(dirname "${sm_path}"))" && pwd) |
|||
if [ -e "${sm_path}" ]; then |
|||
read -p "WARNING! SourceMod exists at ${sm_path}! OVERWRITE!? [y/N]: " input |
|||
if [ "${input}" != "y" ] && [ "${input}" != "Y" ]; then return; fi |
|||
fi |
|||
# Install SourceMod to game server |
|||
sm_major_version="1.7" |
|||
sm_url_base="http://www.sourcemod.net/smdrop/${sm_major_version}/" |
|||
sm_url_latest="${sm_url_base}sourcemod-latest-linux" |
|||
sm_file_latest="$(curl -sL "${sm_url_latest}")" |
|||
sm_url_file="${sm_url_base}${sm_file_latest}" |
|||
sm_file="${cachedir}/${sm_file_latest}" |
|||
if [ ! -e "${sm_file}" ]; then |
|||
echo -ne "Downloading ${sm_file_latest}... \c" |
|||
curl -sL "${sm_url_file}" -o "${sm_file}" |
|||
if [ ! -e "${sm_file}" ]; then |
|||
fn_colortext red FAILED |
|||
exit 1 |
|||
else |
|||
fn_colortext green DONE |
|||
fi |
|||
fi |
|||
# Unzip SourceMod to addons |
|||
tar -xzvpf "${sm_file}" -C "${sm_root}" |
|||
} |
|||
fn_install_metamod |
|||
fn_install_sourcemod |
Binary file not shown.
@ -0,0 +1,90 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_messages function |
|||
# Author: Jared Ballou |
|||
# Website: http://gameservermanagers.com |
|||
lgsm_version="200116" |
|||
|
|||
# Description: Display menus and return selection |
|||
|
|||
# Display simple Bash menu |
|||
fn_menu_bash() { |
|||
local resultvar=$1 |
|||
title=$2 |
|||
caption=$3 |
|||
options=$4 |
|||
fn_print_horizontal |
|||
fn_print_center $title |
|||
fn_print_center $caption |
|||
fn_print_horizontal |
|||
menu_options=() |
|||
while IFS='' read -r line || [[ -n "$line" ]]; do |
|||
menu_options+=( "${line}" ) |
|||
done < $options |
|||
menu_options+=( "Cancel" ) |
|||
select option in "${menu_options[@]}"; do |
|||
if [ -n "${option}" ] && [ "${option}" != "Cancel" ]; then |
|||
eval "$resultvar=\"${option/%\ */}\"" |
|||
fi |
|||
break |
|||
done |
|||
} |
|||
|
|||
# Draw menu using Whiptail |
|||
fn_menu_whiptail() { |
|||
local menucmd=$1 |
|||
local resultvar=$2 |
|||
title=$3 |
|||
caption=$4 |
|||
options=$5 |
|||
height=${6:-40} |
|||
width=${7:-80} |
|||
menuheight=${8:-30} |
|||
#whiptail --title "<menu title>" --menu "<text to show>" <height> <width> <menu height> [ <tag> <item> ] . . . |
|||
menu_options=() |
|||
while read -r key val; do |
|||
menu_options+=( ${key//\"} "${val//\"}" ) |
|||
done < $options |
|||
OPTION=$($menucmd --title "${title}" --menu "${caption}" $height $width $menuheight "${menu_options[@]}" 3>&1 1>&2 2>&3) |
|||
if [ $? = 0 ]; then |
|||
eval "$resultvar=\"${OPTION}\"" |
|||
else |
|||
eval "$resultvar=" |
|||
fi |
|||
} |
|||
|
|||
# Show menu and receive input. We try to see if whiptail/dialog is available |
|||
# for a pretty ncurses menu. If not, use Bash builtins. |
|||
fn_menu() { |
|||
local resultvar=$1 |
|||
local selection="" |
|||
title=$2 |
|||
caption=$3 |
|||
options=$4 |
|||
# If this is a list of options as a string, dump it to a file so we can process it |
|||
if [ ! -e $options ]; then |
|||
echo -ne "{$options}\n" > "${cachedir}/menu.options" |
|||
options="${cachedir}/menu.options" |
|||
fi |
|||
|
|||
# Get menu command |
|||
for menucmd in whiptail dialog bash; do |
|||
if [ -x $(which $menucmd) ]; then |
|||
menucmd=$(which $menucmd) |
|||
break |
|||
fi |
|||
done |
|||
case "$(basename $menucmd)" in |
|||
whiptail|dialog) |
|||
fn_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 |
|||
;; |
|||
*) |
|||
fn_menu_bash selection "${title}" "${caption}" "${options}" |
|||
;; |
|||
esac |
|||
eval "$resultvar=\"${selection}\"" |
|||
} |
|||
|
|||
# Example usage: |
|||
# This will display a menu of available games to install |
|||
#fn_menu result "Linux Game Server Manager" "Select game to install" "../gamedata/__game_list" |
|||
#echo "result is ${result}" |
@ -0,0 +1,113 @@ |
|||
# Game Data Files |
|||
## General Info |
|||
These files are the proof of concept of my new method of supporting all the games LGSM covers. It's basically a hierarchial way to define three things: |
|||
|
|||
* **Script Parameters:** These are things like executable, game name, local directories, and all the rest. |
|||
* **Server Parameters:** These are the command-line switches that we give to the actual game server daemon. There is a little bit of smarts around the Source and GoldSource parsers, we feed it "minus parameters" and "plus parameters", and it spits them out in a somewhat sane order. |
|||
* **Server Settings:** These are the items that go into \_default.cfg for each game. They include the values for the two types of parameters, and are overridden hierarchially by sourcing \_default.cfg, then \_common.cfg, then $instance.cfg from the cfg/servers directory. |
|||
|
|||
The gamedata files themselves use a few simple functions to do their magic. |
|||
|
|||
## Functions |
|||
|
|||
### fn\_flush\_game\_settings() |
|||
This function clears out all the collector files in $settingsdir (default is $\{lgsmdir\}/settings.tmp). It is run at every execution of the script right now, eventually the goal is to only regenerate these files when gamedata updates are pulled. |
|||
|
|||
### fn\_import\_game\_settings() |
|||
|
|||
This function takes one parameter, the name of the gamedata file to load. The main script calls it with the name of the main script file being called. With this method, the same "basic" script is used for all game servers, and we simply name it "insserver" or "csgoserver" for instance. Symlinks then pick up the main script to make this work for multiple-instance deployments. |
|||
|
|||
In the gamedata files themselves, they are used to pull in other gamedata files. This is done in sequence, so it's usually best to do the import at the top of the file, and then overwrite. It is possible to import multiple files inside a single gamedata file, for instance include \_source and \_source\_workshop to pull in Source engine sane defaults and the Workshop variables. Any "base" gamedata file (that is, not for a specific game) should be prefixed with a "\_". The gamedata files for each engine should be named "\_\$\{engine\}". |
|||
|
|||
### fn\_set\_game\_params() |
|||
|
|||
Takes four parameters: |
|||
|
|||
* **param\_set:** The set of key-value pairs to update. You can create as many sets as you want, the only restriction is the set name must validate as a usable file name. For instance, I use parms\_minus and parms\_plus to separate the "-" and "+" parameters for the Server, and then I parse them in fn\_parms() to assemble them. The reserved names are: |
|||
|
|||
* **settings**: which will be parsed into the values in cfg/servers/\*.cfg |
|||
* **parms**: Common name for server daemon parameters. Should have one key declared, also named "parms" which is a string of the command-line arguments to pass to the game server. |
|||
* **param\_name:** The "key", this will be a Bash variable name so it should only be alphanumeric if you want to parse it. The parms\_(minus|plus) files break this convention, as part of how we process them, but ideally they would all be able to be sourced and return the expectec values. |
|||
* **param\_value:** The "default" to set the key to. Should be a single string, escape all quotes. If you want to reference a variable, use the \$\{varname\} syntax, that way the actual value saved to that set will retain the variabe name, rather than interpolating. Special values are: |
|||
* **"--UNSET--"** or **"":** the parser will REMOVE that key from the param\_set. Useful if an engine usually has a certain parameter, but one specific game does not. This allows you to set the default in the engine gamedata file, and then just deletre it for the specific games that don't need it. |
|||
* **"--EMPTY--":** This will set the value to "" (an empty string) and add it to the param set. This is useful for parameters that must be defined, but have no default value. |
|||
* **param\_comment:** This is the comment to append at the end of the line. If overriding a key set earlier in the hierarchy, leaving this blank will reuse the original comment. If you want to delete the comment, use "--EMPTY--". |
|||
|
|||
### fn\_parms() |
|||
|
|||
This is the same old function from the original LGSM main scripts, the difference is we now have a "sane default" one in \_default that just dumps params, and then each engine/game can get fancy if need be. This function gets overridden by the highest-ordered declaration, and for most games the default should be fine. The idea here is that we define flexible functions in each engine, and then allow the games to add/modify/delete keys in the data. |
|||
|
|||
## Examples |
|||
|
|||
This is an example of a gamedata file for the Widgets engine. We'll call it \_widgets for the sake of argument: |
|||
|
|||
```bash |
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
# Use + and - parameters |
|||
fn_import_game_settings _parms_plusminus |
|||
|
|||
# The parms that start with - go first |
|||
fn_set_game_params parms_minus "tickrate" "\${tickrate}" |
|||
fn_set_game_params parms_minus "port" "\${port}" |
|||
|
|||
# Then the parms that start with + |
|||
fn_set_game_params parms_plus "+servercfgfile" "\${servercfg}" |
|||
fn_set_game_params parms_plus "+map" "\${defaultmap}" |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "appid" "99999" "Steam App ID" |
|||
fn_set_game_params settings "defaultmap" "my_map" "Default map to load" |
|||
fn_set_game_params settings "engine" "widgets" "Game Engine" |
|||
fn_set_game_params settings "game" "widgets" "Name of game to pass to srcds" |
|||
fn_set_game_params settings "gamename" "widgets" "Name for subdirectory in GitHub repo" |
|||
fn_set_game_params settings "port" "99999" "Port to bind for server" |
|||
fn_set_game_params settings "servercfg" "\${selfname}.cfg" "Server Config file" |
|||
fn_set_game_params settings "steampass" "--EMPTY--" "Steam Password" |
|||
fn_set_game_params settings "steamuser" "anonymous" "Steam Username" |
|||
|
|||
# These are values that the script uses, they don't get used by the srcds server directly |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/\${game}" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./widgets_server" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.cfg" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/cfg" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.cfg" |
|||
``` |
|||
|
|||
Then, we need a game! DooDads is the name of the game, and just imports the defaults from its engine. |
|||
|
|||
```bash |
|||
# Import SRCDS |
|||
fn_import_game_settings _widgets |
|||
|
|||
# Delete tickrate parameter. This will remove it from the parameters, and remove it from _default.cfg |
|||
fn_set_game_params parms_minus "-tickrate" "--UNSET--" |
|||
fn_set_game_params settings "tickrate" "--UNSET--" |
|||
|
|||
# Add playlist parameter |
|||
fn_set_game_params parms_plus "+sv_playlist" "\${playlist}" |
|||
|
|||
# Override some server settings |
|||
fn_set_game_params settings "executable" "./doodads_server" |
|||
fn_set_game_params settings "appid" "100000" |
|||
fn_set_game_params settings "defaultmap" "special_map" |
|||
fn_set_game_params settings "game" "doodads" |
|||
fn_set_game_params settings "playlist" "custom" "Server Playlist" |
|||
fn_set_game_params settings "gamename" "DooDads" |
|||
``` |
|||
|
|||
With this, we inherit everything from \_widgets, but remove the tickrate setting, add playlist, and override some of the settings to make sure we install the right game via Steam. End users can then override the defaults in \_common.cfg and \$\{servicename\}.cfg for doing things their own way. The script will keep the gamedata files in sync with GitHub, as of right now the \_default.cfg is regenerated only when the \$lgsm\_version that created it differs from the script's \$version. The next step is to only regenerate the settings files when the gamedata itself is updated, which would be much more efficient. |
|||
|
|||
## TODO |
|||
|
|||
* [ ] Look into better handling of parms, especially with the "-" and "+" ordering in Source. |
|||
** Perhaps put a "before" and "after" field in the parms, so we can do a little more complex ordering? |
|||
* [ ] Clean up gamedata files for all engines/games. |
|||
* [ ] When \_default.cfg updates, read all other configs. Add in commented key/value/comment lines so that other configs have the keys and default values available. |
|||
* [ ] Add dependency installation for games, simple array of packages needed for debian,ubuntu,redhat for each game. |
|||
* [ ] Allow values to append or replace individual items, i.e. for dependencies layer on the needed packages from \_default \_engine and game data files. |
|||
* [ ] Parser should read the value and identify variable names, and make sure that this key is declared after those variables that the value references. |
|||
* [ ] Move insserver script (the POC common LGSM script) somewhere else to denote its new role |
@ -0,0 +1,43 @@ |
|||
arkserver "ARK: Survival Evolved" |
|||
arma3server "Arma 3" |
|||
bb2server "BrainBread 2" |
|||
bmdmserver "Black Mesa" |
|||
bsserver "Blade Symphony" |
|||
csczserver "Counter Strike: Condition Zero" |
|||
csgoserver "Counter Strike: Global Offensive" |
|||
csserver "Counter Strike" |
|||
cssserver "Counter Strike: Source" |
|||
dabserver "Double Action: Boogaloo" |
|||
dmcserver "Deathmatch Classic" |
|||
dodserver "Day Of Defeat" |
|||
dodsserver "Day Of Defeat: Source" |
|||
dstserver "Don't Starve Together" |
|||
fofserver "Fistful Of Frags" |
|||
gesserver "GoldenEye: Source" |
|||
gmodserver "Garry's Mod" |
|||
hl2dmserver "Half Life 2: Deathmatch" |
|||
hldmserver "Half Life: Deathmatch" |
|||
hldmsserver "Half-Life Deathmatch: Source" |
|||
hwserver "Hurtworld" |
|||
insserver "Insurgency" |
|||
jc2server "Just Cause 2" |
|||
kfserver "Killing Floor" |
|||
l4d2server "Left 4 Dead 2" |
|||
l4dserver "Left 4 Dead" |
|||
nmrihserver "No More Room In Hell" |
|||
ns2cserver "NS2: Combat" |
|||
ns2server "Natural Selection 2" |
|||
opforserver "Opposing Force" |
|||
pvkiiserver "Pirates, Vikings, and Knights II" |
|||
pzserver "Project Zomboid" |
|||
ricochetserver "Ricochet" |
|||
roserver "Red Orchestra" |
|||
sbserver "StarBound" |
|||
sdtdserver "7 Days To Die" |
|||
ss3sserver "Serious Sam 3: BFE" |
|||
terrariaserver "Terraria" |
|||
tf2server "Team Fortress 2" |
|||
tfcserver "Team Fortress Classic" |
|||
twserver "Teeworlds" |
|||
ut2k4server "Unreal Tournament 2004" |
|||
ut99server "Unreal Tournament 99" |
@ -0,0 +1,25 @@ |
|||
# Game Settings File |
|||
# _avalanche |
|||
# Avalanche Engine |
|||
|
|||
fn_import_game_settings _default |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "engine" "avalanche" |
|||
fn_set_game_params settings "servercfg" "config.lua" "Server Config file" |
|||
fn_set_game_params settings "sourcetvport" "27020" "SourceTV Port" |
|||
fn_set_game_params settings "srcds_parms" "--EMPTY--" "Additional SRCDS Parameters. Put the parameters that start with \"-\" first, then \"+\" parameters after" |
|||
fn_set_game_params settings "steampass" "--EMPTY--" "Steam Password" |
|||
fn_set_game_params settings "steamuser" "anonymous" "Steam Username" |
|||
fn_set_game_params settings "tickrate" "64" "Server Tick Rate" |
|||
|
|||
# These are values that the script uses, they don't get used by the srcds server directly |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "gamelogdir" "--EMPTY--" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./Jcmp-Server" |
|||
fn_set_game_params settings "servercfg" "config.lua" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/default_config.lua" |
|||
|
@ -0,0 +1,52 @@ |
|||
# Game Settings File |
|||
# _default |
|||
# Base defaults for all games |
|||
|
|||
# Set the default settings for the script |
|||
|
|||
# Default settings. This group includes a lot of blanks just so that the comments are set (and the engine/game files will show blank values to remind people to set them). |
|||
fn_set_game_params settings "appid" "--EMPTY--" "Steam App ID" |
|||
fn_set_game_params settings "backupdir" "\${lgsmdir}/backups" "Backup Directory" |
|||
fn_set_game_params settings "defaultmap" "--EMPTY--" "Default map to load" |
|||
fn_set_game_params settings "email" "[email protected]" "Email address for notification" |
|||
fn_set_game_params settings "emaillog" "\${scriptlogdir}/\${servicename}-email.log" "Email Log" |
|||
fn_set_game_params settings "emailnotification" "off" "Email notification (on|off)" |
|||
fn_set_game_params settings "engine" "--EMPTY--" "Game Engine" |
|||
fn_set_game_params settings "filesdir" "\${rootdir}/serverfiles" "Server Files Directory" |
|||
fn_set_game_params settings "game" "--EMPTY--" "Name of game" |
|||
fn_set_game_params settings "gamename" "--EMPTY--" "Name for subdirectory in GitHub repo" |
|||
fn_set_game_params settings "ip" "0.0.0.0" "IP Address to bind for server" |
|||
fn_set_game_params settings "lgsm_version" "${version}" "Version of LGSM that created this config" |
|||
fn_set_game_params settings "lockselfname" ".\${servicename}.lock" "LGSM Lock File" |
|||
fn_set_game_params settings "logdays" "7" "Number of days to retain logs" |
|||
fn_set_game_params settings "maxplayers" "--EMPTY--" "Maximum player count" |
|||
fn_set_game_params settings "port" "--EMPTY--" "Port to bind for server" |
|||
fn_set_game_params settings "steampass" "--EMPTY--" "Steam Password" |
|||
fn_set_game_params settings "steamuser" "anonymous" "Steam Username" |
|||
fn_set_game_params settings "updateonstart" "off" "Update game on start" |
|||
|
|||
# These settings are in a second group, since they reference the first group. |
|||
fn_set_game_params settings "consolelogdir" "\${lgsmdir}/log/console" "Console Log Dir" |
|||
fn_set_game_params settings "consolelog" "\${consolelogdir}/\${servicename}-console.log" "Console Log" |
|||
fn_set_game_params settings "consolelogdate" "\${consolelogdir}/\${servicename}-console-\$(date '+%d-%m-%Y-%H-%M-%S').log" "Console Log Rotation Filename" |
|||
|
|||
fn_set_game_params settings "scriptlogdir" "\${lgsmdir}/log/script" "Script Log Dir" |
|||
fn_set_game_params settings "scriptlog" "\${scriptlogdir}/\${servicename}-script.log" "Script Log" |
|||
fn_set_game_params settings "scriptlogdate" "\${scriptlogdir}/\${servicename}-script-\$(date '+%d-%m-%Y-%H-%M-%S').log" "Script Log Rotation Filename" |
|||
|
|||
fn_set_game_params settings "servercfg_suffix" ".cfg" "Suffix to put on the end of the server config. For file extensions, use \".ext\", setting to empty will use the bare server config name." |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/\${game}" "System Directory (root of game installation)" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" "Game log directory" |
|||
|
|||
fn_set_game_params settings "executabledir" "\${filesdir}" "Executable directory" |
|||
fn_set_game_params settings "executable" "--EMPTY--" "Executable to invoke to start game server" |
|||
|
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/cfg" "Server config directory" |
|||
fn_set_game_params settings "servercfg" "\${servicename}\${servercfg_suffix}" "Server config file for this instance" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default\${servercfg_suffix}" "Default server configuration file" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" "Full path to server config" |
|||
|
|||
# Default fn_parms just loads the parms file. Still need to figure out how to handle "simple" parms. |
|||
fn_parms(){ |
|||
source "${settingsdir}/parms" |
|||
} |
@ -0,0 +1,21 @@ |
|||
# Game Settings File |
|||
# _dontstarve |
|||
# Don't Starve Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "engine" "dontstarve" |
|||
fn_set_game_params settings "game" "dontstarve" |
|||
fn_set_game_params settings "gamename" "Don't Starve" |
|||
|
|||
# These are values that the script uses, they don't get used by the srcds server directly |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}/bin" |
|||
fn_set_game_params settings "executable" "./dontstarve_dedicated_server_nullrenderer" |
|||
fn_set_game_params settings "servercfg" "settings.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${HOME}/.klei/DoNotStarveTogether" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.ini" |
|||
|
@ -0,0 +1,20 @@ |
|||
# Game Settings File |
|||
# _goldsource |
|||
# Gold Source Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _halflife_shared |
|||
|
|||
# The parms that start with - go first |
|||
fn_set_game_params parms_minus "ip" "--UNSET--" |
|||
fn_set_game_params parms_plus "ip" "\${ip}" |
|||
|
|||
fn_set_game_params parms_minus "clientport" "--UNSET--" |
|||
fn_set_game_params parms_plus "clientport" "\${clientport}" |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "dm_lockdown" |
|||
fn_set_game_params settings "engine" "goldsource" |
|||
fn_set_game_params settings "executable" "./hlds_run" |
|||
|
@ -0,0 +1,5 @@ |
|||
# Game Settings File |
|||
# Game Server Login Token Support |
|||
|
|||
fn_set_game_params settings "gslt" "--EMPTY--" "Required: Game Server Login Token. GSLT is required for running a public server. More info: http://gameservermanagers.com/gslt" |
|||
fn_set_game_params parms_plus "sv_setsteamaccount" "\${gslt}" |
@ -0,0 +1,29 @@ |
|||
# Game Settings File |
|||
# _halflife_shared |
|||
# Half-Life Shared Engine (Source and GoldSource) |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
fn_import_game_settings _parms_plusminus |
|||
|
|||
# The parms that start with - go first |
|||
|
|||
fn_set_game_params parms_minus "game" "\${game}" |
|||
fn_set_game_params parms_minus "strictportbind" "--EMPTY--" |
|||
fn_set_game_params parms_minus "ip" "\${ip}" |
|||
fn_set_game_params parms_minus "port" "\${port}" |
|||
fn_set_game_params parms_minus "maxplayers" "\${maxplayers}" |
|||
fn_set_game_params parms_minus "tickrate" "\${tickrate}" |
|||
|
|||
# Then the parms that start with + |
|||
fn_set_game_params parms_plus "clientport" "\${clientport}" |
|||
fn_set_game_params parms_plus "servercfgfile" "\${servercfg}" |
|||
fn_set_game_params parms_plus "map" "\${defaultmap}" |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "clientport" "27005" "Client Port" |
|||
fn_set_game_params settings "defaultmap" "dm_lockdown" "Default map to load" |
|||
fn_set_game_params settings "maxplayers" "64" |
|||
fn_set_game_params settings "port" "27015" |
|||
fn_set_game_params settings "server_parms" "--EMPTY--" "Additional server Parameters. Put the parameters that start with \"-\" first, then \"+\" parameters after" |
|||
fn_set_game_params settings "tickrate" "64" "Server Tick Rate" |
@ -0,0 +1,10 @@ |
|||
# Game Settings File |
|||
# _parms_plusminus |
|||
# Parameter parsing with "+" and "-" sorting |
|||
|
|||
# This is the way we create a script that collates and parses the parameters |
|||
fn_parms(){ |
|||
parms_minus="$(echo $(sed -e 's/^\([^#=]\+\)=\"/\-\1 /g' -e 's/\"$//g' ${settingsdir}/parms_minus))" |
|||
parms_plus="$(echo $(sed -e 's/^\([^#=]\+\)=\"/\+\1 /g' -e 's/\"$//g' ${settingsdir}/parms_plus))" |
|||
parms="$(eval "echo \"${parms_minus} ${server_parms} ${parms_plus}\"")" |
|||
} |
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# _projectzomboid |
|||
# Project Zomboid Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "engine" "projectzomboid" |
|||
|
|||
# These are values that the script uses, they don't get used by the srcds server directly |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./start-server.sh" |
|||
fn_set_game_params settings "servercfg" "servertest.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${HOME}/Zomboid/Server" |
|||
|
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# _realvirtuality |
|||
# Real Virtuality Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "realvirtuality" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./arma3server" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.server.cfg" |
|||
fn_set_game_params settings "networkcfg" "\${servicename}.network.cfg" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/cfg" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "networkcfgfullpath" "\${servercfgdir}/\${networkcfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.server.cfg" |
|||
fn_set_game_params settings "networkcfgdefault" "\${servercfgdir}/lgsm-default.network.cfg" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# _seriousengine35 |
|||
# Serious Engine 3.5 |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "seriousengine35" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/Bin" |
|||
fn_set_game_params settings "executable" "./runSam3_DedicatedServer.sh" |
|||
fn_set_game_params settings "executabledir" "\${systemdir}" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}/Content/SeriousSam3/Config" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.ini" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# _source |
|||
# Source Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _halflife_shared |
|||
|
|||
# And the settings for defaults |
|||
fn_set_game_params settings "engine" "source" "Game Engine" |
|||
fn_set_game_params settings "sourcetvport" "27020" "SourceTV Port" |
|||
|
|||
fn_set_game_params parms_plus "tv_port" "\${sourcetvport}" |
|||
|
|||
# These are values that the script uses, they don't get used by the srcds server directly |
|||
fn_set_game_params settings "executable" "./srcds_linux" |
@ -0,0 +1,7 @@ |
|||
# Game Settings File |
|||
# _spark |
|||
# Spark Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# _srcds |
|||
# Base SRCDS Game |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "starbound" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}/linux64" |
|||
fn_set_game_params settings "executable" "./starbound_server" |
|||
fn_set_game_params settings "servercfg" "sbboot.config" |
|||
fn_set_game_params settings "servercfgdir" "\${executabledir}" |
|||
fn_set_game_params settings "gamelogdir" "\${filesdir}/giraffe_storage" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# _teeworlds |
|||
# TeeWorlds Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "teeworlds" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./teeworlds_srv" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.cfg" # Teeworlds can also auto load any config if an autoexec.cfg file is present in the server dir |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.cfg" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# _terraria |
|||
# Terarria Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "terraria" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./TerrariaServer" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.txt" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.txt" |
|||
fn_set_game_params settings "gamelogdir" "" |
@ -0,0 +1,31 @@ |
|||
# Game Settings File |
|||
# _unity3d |
|||
# Unity 3D Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_set_game_params settings "engine" "unity3d" |
|||
# http://hurtworld.wikia.com/wiki/Hosting_A_Server |
|||
fn_parms(){ |
|||
parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " |
|||
} |
|||
fn_set_game_params settings "port" "12871" |
|||
fn_set_game_params settings "queryport" "12881" |
|||
fn_set_game_params settings "maxplayers" "20" |
|||
fn_set_game_params settings "map" "--EMPTY--" "Optional" |
|||
fn_set_game_params settings "creativemode" "0" "Free Build" |
|||
fn_set_game_params settings "logfile" "gamelog.txt" |
|||
fn_set_game_params settings "admins" "--EMPTY--" "Adding admins using STEAMID64. Example : addadmin 012345678901234567; addadmin 987654321098765432" |
|||
|
|||
# Advanced |
|||
fn_set_game_params settings "loadsave" "" "Rollback server state (remove after start command)" |
|||
fn_set_game_params settings "x64mode" "0" "Use unstable 64 bit server executable (O/1)" |
|||
fn_set_game_params settings "filesdir" "\${rootdir}/serverfiles" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
if [ "${x64mode}" == "1" ]; then |
|||
fn_set_game_params settings "executable" "./Hurtworld.x86_64" |
|||
else |
|||
fn_set_game_params settings "executable" "./Hurtworld.x86" |
|||
fi |
@ -0,0 +1,20 @@ |
|||
# Game Settings File |
|||
# _unreal |
|||
# Unreal Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
# This is the way we create a script that collates and parses the parameters |
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/System" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" |
|||
fn_set_game_params settings "executabledir" "\${systemdir}" |
|||
fn_set_game_params settings "executable" "./ucc-bin" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/Default.ini" |
|||
fn_set_game_params settings "compressedmapsdir" "${rootdir}/Maps-Compressed" "Compressed Maps Directory" |
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# _unreal2 |
|||
# Unreal 2 Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "systemdir" "${filesdir}/System" |
|||
fn_set_game_params settings "executabledir" "${systemdir}" |
|||
fn_set_game_params settings "executable" "./ucc-bin" |
|||
fn_set_game_params settings "servercfg" "${servicename}.ini" |
|||
fn_set_game_params settings "servercfgdir" "${systemdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "${servercfgdir}/${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "${servercfgdir}/Default.ini" |
|||
fn_set_game_params settings "compressedmapsdir" "${rootdir}/Maps-Compressed" |
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# _unreal4 |
|||
# Unreal 4 Engine |
|||
|
|||
# Import default settings |
|||
fn_import_game_settings _default |
|||
|
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/\${game}" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" |
|||
fn_set_game_params settings "executabledir" "\${systemdir}/Binaries/Linux" |
|||
fn_set_game_params settings "executable" "./\${game}Server" |
|||
fn_set_game_params settings "servercfg" "GameUserSettings.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/Saved/Config/LinuxServer" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.ini" |
@ -0,0 +1,9 @@ |
|||
# Game Settings File |
|||
|
|||
# Workshop Authentication and Settings |
|||
fn_set_game_params parms_minus "authkey" "\${authkey}" |
|||
fn_set_game_params parms_plus "host_workshop_collection" "\${host_workshop_collection}" |
|||
fn_set_game_params parms_plus "workshop_start_map" "\${workshop_start_map}" |
|||
fn_set_game_params settings "authkey" "--EMPTY--" "Optional key for Workshop Content. See https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators - To get an authkey visit - http://steamcommunity.com/dev/apikey" |
|||
fn_set_game_params settings "host_workshop_collection" "--EMPTY--" "Workshop Collection ID" |
|||
fn_set_game_params settings "workshop_start_map" "--EMPTY--" "Workshop Start Map" |
@ -0,0 +1,23 @@ |
|||
# Game Settings File |
|||
# |
|||
# |
|||
|
|||
# Import Engine |
|||
fn_import_game_settings _unreal4 |
|||
|
|||
fn_parms(){ |
|||
parms="TheIsland?listen" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "376030" |
|||
fn_set_game_params settings "game" "ShooterGame" |
|||
fn_set_game_params settings "gamename" "ARK: Survival Evolved" |
|||
|
|||
fn_set_game_params settings "systemdir" "\${filesdir}/\${game}" |
|||
fn_set_game_params settings "gamelogdir" "\${systemdir}/logs" |
|||
fn_set_game_params settings "executabledir" "\${systemdir}/Binaries/Linux" |
|||
fn_set_game_params settings "executable" "./\${game}Server" |
|||
fn_set_game_params settings "servercfg" "GameUserSettings.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/Saved/Config/LinuxServer" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.ini" |
@ -0,0 +1,22 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _realvirtuality |
|||
|
|||
fn_parms(){ |
|||
parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" |
|||
} |
|||
fn_set_game_params settings "port" "2302" |
|||
fn_set_game_params settings "mods" "" "Mods" |
|||
fn_set_game_params settings "servermods" "" "Server Mods" |
|||
fn_set_game_params settings "bepath" "" "BattleEye Path" |
|||
fn_set_game_params settings "appid" "233780" "For Development branch, use \"233780 -beta development\"" |
|||
fn_set_game_params settings "gamename" "Arma 3" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./arma3server" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.server.cfg" |
|||
fn_set_game_params settings "networkcfg" "\${servicename}.network.cfg" "Network Config" |
|||
fn_set_game_params settings "servercfgdir" "\${systemdir}/cfg" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "networkcfgfullpath" "\${servercfgdir}/\${networkcfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.server.cfg" |
|||
fn_set_game_params settings "networkcfgdefault" "\${servercfgdir}/lgsm-default.network.cfg" "Default Network Config File" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
#fn_import_game_settings _gslt |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game brainbread2 -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "346330" |
|||
fn_set_game_params settings "gamename" "BrainBread 2" |
|||
fn_set_game_params settings "game" "brainvread2" |
|||
fn_set_game_params settings "defaultmap" "bba_barracks" |
@ -0,0 +1,11 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
fn_parms(){ |
|||
parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "346680" |
|||
fn_set_game_params settings "game" "bms" |
|||
fn_set_game_params settings "defaultmap" "dm_bounce" |
|||
fn_set_game_params settings "gamename" "Black Mesa" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "228780" |
|||
fn_set_game_params settings "defaultmap" "duel_winter" |
|||
fn_set_game_params settings "game" "berimbau" |
|||
fn_set_game_params settings "gamename" "Blade Symphony" |
@ -0,0 +1,10 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
fn_parms(){ |
|||
parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "de_dust2" |
|||
fn_set_game_params settings "game" "czero" |
|||
fn_set_game_params settings "gamename" "Counter Strike: Condition Zero" |
@ -0,0 +1,27 @@ |
|||
# Game Settings File |
|||
# csgoserver |
|||
# Counter-Strike: Global Offensive Dedicated Server |
|||
|
|||
# Import SRCDS |
|||
fn_import_game_settings _source |
|||
fn_import_game_settings _gslt |
|||
fn_import_game_settings _workshop |
|||
|
|||
# Override some server settings |
|||
fn_set_game_params settings "appid" "740" |
|||
fn_set_game_params settings "defaultmap" "de_dust2" |
|||
fn_set_game_params settings "game" "csgo" |
|||
fn_set_game_params settings "mapcyclefile" "--UNSET--" |
|||
fn_set_game_params settings "gamename" "Counter Strike: Global Offensive" |
|||
fn_set_game_params settings "mapgroup" "random_classic" "Map Group. See https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server" |
|||
fn_set_game_params settings "gametype" "0" "Game Type. Set to: Arms Race 1 Classic Casual 0 Classic Competitive 0 Demolition 1 Deathmatch 1" |
|||
fn_set_game_params settings "gamemode" "0" "Game Mode. Set to: Arms Race 0 Classic Casual 0 Classic Competitive 1 Demolition 1 Deathmatch 2" |
|||
|
|||
# The parms that start with - go first |
|||
fn_set_game_params parms_minus "usercon" "--EMPTY--" |
|||
fn_set_game_params parms_minus "maxplayers_override" "\${maxplayers}" |
|||
|
|||
# Then the parms that start with + |
|||
fn_set_game_params parms_plus "mapgroup" "\${mapgroup}" |
|||
fn_set_game_params parms_plus "game_mode" "\${gamemode}" |
|||
fn_set_game_params parms_plus "game_type" "\${gametype}" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
#TODO |
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
# Steam |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "de_dust2" |
|||
fn_set_game_params settings "game" "cstrike" |
|||
fn_set_game_params settings "gamename" "Counter Strike" |
@ -0,0 +1,17 @@ |
|||
# Game Settings File |
|||
# cssserver |
|||
# Counter-Strike: Source Dedicated Server |
|||
|
|||
# Import SRCDS |
|||
fn_import_game_settings _source |
|||
|
|||
# Override some server settings |
|||
fn_parms(){ |
|||
parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "232330" |
|||
fn_set_game_params settings "defaultmap" "de_dust2" |
|||
fn_set_game_params settings "game" "cstrike" |
|||
fn_set_game_params settings "mapcyclefile" "--UNSET--" |
|||
fn_set_game_params settings "gamename" "Counter Strike: Source" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "317800" |
|||
fn_set_game_params settings "defaultmap" "da_rooftops" |
|||
fn_set_game_params settings "executable" "./dabds.sh" |
|||
fn_set_game_params settings "game" "dab" |
|||
fn_set_game_params settings "gamename" "Double Action: Boogaloo" |
|||
fn_set_game_params settings "maxplayers" "10" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
|
|||
# Steam |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "dcdm5" |
|||
fn_set_game_params settings "game" "dmc" |
|||
fn_set_game_params settings "gamename" "Deathmatch Classic" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "dod_Anzio" |
|||
fn_set_game_params settings "game" "dod" |
|||
fn_set_game_params settings "gamename" "Day Of Defeat" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "232290" |
|||
fn_set_game_params settings "defaultmap" "dod_Anzio" |
|||
fn_set_game_params settings "game" "dod" |
|||
fn_set_game_params settings "gamename" "Day Of Defeat: Source" |
@ -0,0 +1,11 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _dontstarve |
|||
|
|||
#http://dont-starve-game.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers |
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "appid" "343050" |
|||
fn_set_game_params settings "game" "dontstarve" |
|||
fn_set_game_params settings "gamename" "Don't Starve Together" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "295230" |
|||
fn_set_game_params settings "defaultmap" "fof_depot" |
|||
fn_set_game_params settings "game" "fof" |
|||
fn_set_game_params settings "gamename" "Fistful Of Frags" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "310" |
|||
fn_set_game_params settings "defaultmap" "ge_archives" |
|||
fn_set_game_params settings "game" "gesource" |
|||
fn_set_game_params settings "gamename" "GoldenEye: Source" |
@ -0,0 +1,20 @@ |
|||
# Game Settings File |
|||
# gmodserver |
|||
# Garry's Mod Server |
|||
|
|||
# Import SRCDS |
|||
fn_import_game_settings _source |
|||
fn_import_game_settings _gslt |
|||
fn_import_game_settings _workshop |
|||
|
|||
# Override some server settings |
|||
fn_set_game_params settings "appid" "4020" |
|||
fn_set_game_params settings "defaultmap" "gm_construct" |
|||
fn_set_game_params settings "game" "garrysmod" |
|||
fn_set_game_params settings "mapcyclefile" "--UNSET--" |
|||
fn_set_game_params settings "gamename" "Garry's Mod" |
|||
fn_set_game_params settings "gamemode" "sandbox" "Game Mode." |
|||
|
|||
# Add the command line parameters |
|||
fn_set_game_params parms_plus "mapgroup" "\${mapgroup}" |
|||
fn_set_game_params parms_plus "gamemode" "\${gamemode}" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "232370" |
|||
fn_set_game_params settings "defaultmap" "dm_lockdown" |
|||
fn_set_game_params settings "game" "hl2mp" |
|||
fn_set_game_params settings "gamename" "Half Life 2: Deathmatch" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "crossfire" |
|||
fn_set_game_params settings "game" "valve" |
|||
fn_set_game_params settings "gamename" "Half Life: Deathmatch" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
# Steam |
|||
fn_set_game_params settings "appid" "255470" |
|||
fn_set_game_params settings "defaultmap" "crossfire" |
|||
fn_set_game_params settings "game" "hl1mp" |
|||
fn_set_game_params settings "gamename" "Half-Life Deathmatch: Source" |
|||
|
@ -0,0 +1,31 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unity3d |
|||
|
|||
|
|||
# http://hurtworld.wikia.com/wiki/Hosting_A_Server |
|||
fn_parms(){ |
|||
parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " |
|||
} |
|||
|
|||
fn_set_game_params settings "servername" "Hurtworld LGSM Server" |
|||
fn_set_game_params settings "appid" "405100" |
|||
fn_set_game_params settings "gamename" "Hurtworld" |
|||
fn_set_game_params settings "port" "12871" |
|||
fn_set_game_params settings "queryport" "12881" "Query Port" |
|||
fn_set_game_params settings "maxplayers" "20" |
|||
fn_set_game_params settings "map" "--EMPTY--" "Optional" |
|||
fn_set_game_params settings "creativemode" "0" "Free Build" |
|||
fn_set_game_params settings "logfile" "gamelog.txt" |
|||
fn_set_game_params settings "admins" "--EMPTY--" "Adding admins using STEAMID64. Example : addadmin 012345678901234567; addadmin 987654321098765432" |
|||
|
|||
fn_set_game_params settings "loadsave" "--EMPTY--" "Rollback server state (remove after start command)" |
|||
fn_set_game_params settings "x64mode" "0" "Use unstable 64 bit server executable (O/1)" |
|||
fn_set_game_params settings "filesdir" "${rootdir}/serverfiles" |
|||
fn_set_game_params settings "systemdir" "${filesdir}" |
|||
fn_set_game_params settings "executabledir" "${filesdir}" |
|||
if [ "${x64mode}" == "1" ]; then |
|||
fn_set_game_params settings "executable" "./Hurtworld.x86_64" |
|||
else |
|||
fn_set_game_params settings "executable" "./Hurtworld.x86" |
|||
fi |
@ -0,0 +1,20 @@ |
|||
# Game Settings File |
|||
# insserver |
|||
# Insurgency Dedicated Server |
|||
|
|||
# Import Source Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# Override some server settings |
|||
fn_set_game_params settings "appid" "237410" |
|||
fn_set_game_params settings "defaultmap" "ministry checkpoint" |
|||
fn_set_game_params settings "game" "insurgency" |
|||
fn_set_game_params settings "gamename" "Insurgency" |
|||
|
|||
# Add playlist parameter |
|||
fn_set_game_params parms_plus "sv_playlist" "\${playlist}" |
|||
fn_set_game_params settings "playlist" "custom" "Server Playlist" |
|||
|
|||
# Mapcycle |
|||
fn_set_game_params params_plus "mapcyclefile" "\${mapcyclefile}" |
|||
fn_set_game_params settings "mapcyclefile" "mapcycle_cooperative.txt" "Mapcycle File" |
@ -0,0 +1,10 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _avalanche |
|||
|
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "261140" |
|||
fn_set_game_params settings "gamename" "Just Cause 2" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unreal2 |
|||
|
|||
fn_parms(){ |
|||
parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" |
|||
|
|||
# Start Variables for Objective mode |
|||
#defaultmap="KFO-Steamland" |
|||
#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "215360" |
|||
fn_set_game_params settings "defaultmap" "KF-BioticsLab.rom" |
|||
fn_set_game_params settings "gamename" "Killing Floor" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "222860" |
|||
fn_set_game_params settings "defaultmap" "c5m1_waterfront" |
|||
fn_set_game_params settings "game" "left4dead2" |
|||
fn_set_game_params settings "gamename" "Left 4 Dead 2" |
|||
fn_set_game_params settings "maxplayers" "8" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} -tickrate ${tickrate} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "222840" |
|||
fn_set_game_params settings "defaultmap" "l4d_hospital01_apartment" |
|||
fn_set_game_params settings "game" "left4dead" |
|||
fn_set_game_params settings "gamename" "Left 4 Dead" |
|||
fn_set_game_params settings "maxplayers" "8" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "317670" |
|||
fn_set_game_params settings "defaultmap" "nmo_broadway" |
|||
fn_set_game_params settings "game" "nmrih" |
|||
fn_set_game_params settings "gamename" "No More Room In Hell" |
|||
fn_set_game_params settings "maxplayers" "8" |
@ -0,0 +1,22 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _spark |
|||
|
|||
fn_parms(){ |
|||
parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "313900" |
|||
fn_set_game_params settings "configpath" "server1" |
|||
fn_set_game_params settings "defaultmap" "co_core" |
|||
fn_set_game_params settings "executable" "./ns2combatserver_linux32" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}/ia32" |
|||
fn_set_game_params settings "gamename" "NS2: Combat" |
|||
fn_set_game_params settings "maxplayers" "24" |
|||
fn_set_game_params settings "mods" "--EMPTY--" |
|||
fn_set_game_params settings "modstorage" "server1/Workshop" |
|||
fn_set_game_params settings "password" "-EMPTY--" |
|||
fn_set_game_params settings "servername" "NS2C Server" |
|||
fn_set_game_params settings "webadminuser" "admin" |
|||
fn_set_game_params settings "webadminpass" "admin" |
|||
fn_set_game_params settings "webadminport" "8080" |
@ -0,0 +1,24 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _spark |
|||
|
|||
# http://wiki.unknownworlds.com/ns2/Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" |
|||
} |
|||
|
|||
fn_set_game_params settings "defaultmap" "ns2_summit" |
|||
fn_set_game_params settings "maxplayers" "24" |
|||
fn_set_game_params settings "servername" "NS2 Server" |
|||
fn_set_game_params settings "webadminuser" "admin" |
|||
fn_set_game_params settings "webadminpass" "admin" |
|||
fn_set_game_params settings "webadminport" "8080" |
|||
fn_set_game_params settings "configpath" "server1" |
|||
fn_set_game_params settings "modstorage" "server1/Workshop" |
|||
fn_set_game_params settings "mods" "" |
|||
fn_set_game_params settings "password" "" |
|||
fn_set_game_params settings "appid" "4940" |
|||
fn_set_game_params settings "gamename" "Natural Selection 2" |
|||
fn_set_game_params settings "systemdir" "${filesdir}" |
|||
fn_set_game_params settings "executabledir" "${filesdir}" |
|||
fn_set_game_params settings "executable" "./server_linux32" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "op4_bootcamp" |
|||
fn_set_game_params settings "game" "gearbox" |
|||
fn_set_game_params settings "gamename" "Opposing Force" |
|||
fn_set_game_params settings "maxplayers" "16" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
|
|||
fn_parms(){ |
|||
parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "17575" |
|||
fn_set_game_params settings "gamename" "Pirates, Vikings, and Knights II" |
|||
fn_set_game_params settings "defaultmap" "bt_island" |
|||
fn_set_game_params settings "maxplayers" "24" |
|||
fn_set_game_params settings "game" "pvkii" |
@ -0,0 +1,17 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _projectzomboid |
|||
|
|||
|
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "appid" "380870" |
|||
fn_set_game_params settings "gamename" "Project Zomboid" |
|||
|
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./start-server.sh" |
|||
fn_set_game_params settings "servercfg" "servertest.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${HOME}/Zomboid/Server" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
fn_parms(){ |
|||
parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "defaultmap" "rc_arena" |
|||
fn_set_game_params settings "maxplayers" "16" |
|||
fn_set_game_params settings "gamename" "Ricochet" |
|||
fn_set_game_params settings "game" "ricochet" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unreal2 |
|||
|
|||
fn_parms(){ |
|||
parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" |
|||
} |
|||
|
|||
fn_set_game_params settings "gamename" "Red Orchestra" |
|||
fn_set_game_params settings "appid" "223250" |
|||
fn_set_game_params settings "defaultmap" "RO-Arad.rom" |
|||
|
|||
# Lower Case wtf? |
|||
fn_set_game_params settings "systemdir" "${filesdir}/system" |
|||
fn_set_game_params settings "servercfgdefault" "${servercfgdir}/default.ini" |
@ -0,0 +1,15 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _starbound |
|||
|
|||
fn_parms(){ |
|||
parms="" |
|||
} |
|||
fn_set_game_params settings "appid" "211820" |
|||
fn_set_game_params settings "gamename" "StarBound" |
|||
fn_set_game_params settings "game" "starbound" |
|||
fn_set_game_params settings "executabledir" "${filesdir}/linux64" |
|||
fn_set_game_params settings "executable" "./starbound_server" |
|||
fn_set_game_params settings "servercfg" "sbboot.config" |
|||
fn_set_game_params settings "servercfgdir" "${executabledir}" |
|||
fn_set_game_params settings "gamelogdir" "${filesdir}/giraffe_storage" |
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unity3d |
|||
|
|||
# http://7daystodie.gamepedia.com/Server |
|||
fn_parms(){ |
|||
parms="-configfile=${servercfgfullpath} -dedicated" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "294420" |
|||
fn_set_game_params settings "gamename" "7 Days To Die" |
|||
fn_set_game_params settings "executable" "./startserver.sh" |
|||
fn_set_game_params settings "servercfg" "${servicename}.xml" |
|||
fn_set_game_params settings "servercfgdir" "${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "${servercfgdir}/${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "${servercfgdir}/serverconfig.xml" |
|||
|
|||
|
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _seriousengine35 |
|||
|
|||
# https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt |
|||
fn_parms(){ |
|||
parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "41080" |
|||
fn_set_game_params settings "gamename" "Serious Sam 3: BFE" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}/Bin" |
|||
fn_set_game_params settings "executable" "./runSam3_DedicatedServer.sh" |
|||
fn_set_game_params settings "executabledir" "\${systemdir}" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.ini" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}/Content/SeriousSam3/Config" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.ini" |
@ -0,0 +1,17 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _terarria |
|||
|
|||
fn_parms(){ |
|||
parms="-config ${servercfgfullpath}" |
|||
} |
|||
fn_set_game_params settings "appid" "105600" |
|||
fn_set_game_params settings "gamename" "Terraria" |
|||
fn_set_game_params settings "game" "terraria" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./TerrariaServer" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.txt" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.txt" |
|||
fn_set_game_params settings "gamelogdir" "" "Terraria Doesn't Have a Server Log" |
@ -0,0 +1,14 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _source |
|||
fn_import_game_settings _gslt |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
|||
fn_parms(){ |
|||
parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "232250" |
|||
fn_set_game_params settings "gamename" "Team Fortress 2" |
|||
fn_set_game_params settings "defaultmap" "cp_badlands" |
|||
fn_set_game_params settings "maxplayers" "16" |
|||
fn_set_game_params settings "game" "tf" |
@ -0,0 +1,13 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _goldsource |
|||
|
|||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 |
|||
fn_parms(){ |
|||
parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" |
|||
} |
|||
fn_set_game_params settings "appid" "90" |
|||
fn_set_game_params settings "gamename" "Team Fortress Classic" |
|||
fn_set_game_params settings "defaultmap" "dustbowl" |
|||
fn_set_game_params settings "maxplayers" "16" |
|||
fn_set_game_params settings "game" "tfc" |
@ -0,0 +1,18 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _teeworlds |
|||
|
|||
fn_parms(){ |
|||
parms="-f ${servercfgfullpath}" |
|||
} |
|||
|
|||
fn_set_game_params settings "appid" "380840" |
|||
fn_set_game_params settings "gamename" "Teeworlds" |
|||
fn_set_game_params settings "game" "teeworlds" |
|||
fn_set_game_params settings "systemdir" "\${filesdir}" |
|||
fn_set_game_params settings "executabledir" "\${filesdir}" |
|||
fn_set_game_params settings "executable" "./teeworlds_srv" |
|||
fn_set_game_params settings "servercfg" "\${servicename}.cfg" |
|||
fn_set_game_params settings "servercfgdir" "\${filesdir}" |
|||
fn_set_game_params settings "servercfgfullpath" "\${servercfgdir}/\${servercfg}" |
|||
fn_set_game_params settings "servercfgdefault" "\${servercfgdir}/lgsm-default.cfg" |
@ -0,0 +1,12 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unreal2 |
|||
|
|||
fn_parms(){ |
|||
parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" |
|||
} |
|||
fn_set_game_params settings "gamename" "Unreal Tournament 2004" |
|||
fn_set_game_params settings "defaultmap" "DM-Rankin" |
|||
|
|||
# Why isn't this Default? |
|||
fn_set_game_params settings "servercfgdefault" "${servercfgdir}/UT2004.ini" |
@ -0,0 +1,10 @@ |
|||
# Game Settings File |
|||
# Import Engine |
|||
fn_import_game_settings _unreal |
|||
|
|||
fn_parms(){ |
|||
parms="server ${defaultmap}.unr ini=${servercfgfullpath}" |
|||
} |
|||
fn_set_game_params settings "gamename" "Unreal Tournament 99" |
|||
fn_set_game_params settings "defaultmap" "DM-Deck16][" |
|||
|
Loading…
Reference in new issue