Skip to content

Commit

Permalink
Merge branch 'release/180313'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Mar 13, 2018
2 parents 8854693 + 90248bf commit 058d690
Show file tree
Hide file tree
Showing 18 changed files with 144 additions and 82 deletions.
3 changes: 2 additions & 1 deletion lgsm/config-default/config-lgsm/kf2server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
ip="0.0.0.0"
queryport="27015"
defaultmap="KF-BioticsLab"
gamemode="KFGameContent.KFGameInfo_VersusSurvival"

## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival?ConfigSubDir=${servicename} -QueryPort=${queryport}\""
parms="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${servicename} -QueryPort=${queryport}\""
}

#### LinuxGSM Settings ####
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,18 @@
#### Server Settings ####

## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server
# [Game Modes] gametype gamemode
# Arms Race 1 0
# Classic Casual 0 0
# Classic Competitive 0 1
# Demolition 1 1
# Deathmatch 1 2
gametype="0"
gamemode="0"
mapgroup="mg_active"
ip="0.0.0.0"
port="27015"
clientport="27005"
sourcetvport="27020"
defaultmap="de_mirage"
maxplayers="16"
tickrate="64"

## Required: Game Server Login Token
# GSLT is required for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""

## Optional: Workshop Parameters
# https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators
# To get an authkey visit - http://steamcommunity.com/dev/apikey
# authkey=""
# ws_collection_id=""
# ws_start_map=""
port="27500"
queryport="27015"
worldtype="Moon"
autosaveinterval=300
clearinterval=60
worldname="moon_save"

## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server
fn_parms(){
parms="-game csco -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}"
parms="-batchmode -nographics -autostart -gameport=${port} -updateport=${queryport} -worldtype=${worldtype} -loadworld=${worldname} -worldname=${worldname} -autosaveinterval=${autosaveinterval} -clearallinterval=${clearinterval}"
}

#### LinuxGSM Settings ####
Expand Down Expand Up @@ -105,40 +84,35 @@ logdays="7"

## SteamCMD Settings
# Server appid
appid="740"
appid_co="600380"
appid="600760"
# Steam App Branch Select
# Allows to opt into the various Steam app branches. Default branch is "".
# Example: "-beta latest_experimental"
branch=""

## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login
steamuser="username"
steampass='password'

## LinuxGSM Server Details
# Do not edit
gamename="Classic Offensive"
engine="source"
gamename="Stationeers"
engine="unity3d"

#### Directories ####
# Edit with care

## Server Specific Directories
systemdir="${serverfiles}/csco"
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="./srcds_run"
servercfg="${servicename}.cfg"
servercfgdefault="server.cfg"
servercfgdir="${systemdir}/cfg"
executable="./rocketstation_DedicatedServer.x86_64"
servercfg="default.ini"
servercfgdefault="default.ini"
servercfgdir="${systemdir}"
servercfgfullpath="${servercfgdir}/${servercfg}"

## Backup Directory
backupdir="${rootdir}/backups"

## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${systemdir}/logs"
gamelogdir="${HOME}/.config/unity3d/Rocketwerkz/Stationeers"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${servicename}-script.log"
Expand All @@ -148,4 +122,5 @@ postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"

## Logs Naming
lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

5 changes: 5 additions & 0 deletions lgsm/config-default/config-lgsm/tuserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ ip="0.0.0.0"
port="7777"
queryport="27015"

## Optional: Game Server Login Token
# GSLT can be used for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""

## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="-log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerINI=${servicename}.ini"
Expand Down
5 changes: 5 additions & 0 deletions lgsm/config-default/config-lgsm/zpsserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ sourcetvport="27020"
defaultmap="zps_deadend"
maxplayers="20"

## Optional: Game Server Login Token
# GSLT can be used for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""

## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
Expand Down
1 change: 1 addition & 0 deletions lgsm/data/serverlist.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ rust,rustserver,Rust
samp,sampserver,San Andreas Multiplayer
ss3,ss3server,Serious Sam 3: BFE
sb,sbserver,Starbound
st,stserver,Stationeers
squad,squadserver,Squad
sven,svenserver,Sven Co-op
tf2,tf2server,Team Fortress 2
Expand Down
3 changes: 3 additions & 0 deletions lgsm/functions/check_system_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ elif [ "${gamename}" == "Minecraft" ]; then
elif [ "${gamename}" == "Natural Selection 2" ]||[ "${gamename}" == "NS2: Combat" ]; then
ramrequirementmb="1000"
ramrequirementgb="1"
elif [ "${shortname}" == "st" ]; then
ramrequirementmb="1000"
ramrequirementgb="1"
fi

# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
Expand Down
14 changes: 7 additions & 7 deletions lgsm/functions/command_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ fn_backup_compression(){
fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress"
excludedir=$(fn_backup_relpath)

# CHECK THAT excludedir is a valid path.
# Check that excludedir is a valid path.
if [ ! -d "${excludedir}" ] ; then
fn_print_info_nl "Problem identifying the previous backup directory for exclusion."
fn_script_log_error "Problem identifying the previous backup directory for exclusion"
fn_print_fail_nl "Problem identifying the previous backup directory for exclusion."
fn_script_log_fatal "Problem identifying the previous backup directory for exclusion"
core_exit.sh
fi

Expand Down Expand Up @@ -195,16 +195,16 @@ fn_backup_relpath() {
declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g"))

if [ ${#rdirtoks[@]} -eq 0 ]; then
fn_print_info_nl "Problem assessing rootdir during relative path assessment"
fn_script_log_error "Problem assessing rootdir during relative path assessment: ${rootdir}"
fn_print_fail_nl "Problem assessing rootdir during relative path assessment"
fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}"
core_exit.sh
fi

# Populate an array of tokens initialized from the backupdir components:
declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g"))
if [ ${#bdirtoks[@]} -eq 0 ]; then
fn_print_info_nl "Problem assessing backupdir during relative path assessment"
fn_script_log_error "Problem assessing backupdir during relative path assessment: ${rootdir}"
fn_print_fail_nl "Problem assessing backupdir during relative path assessment"
fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}"
core_exit.sh
fi

Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/command_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn_monitor_tmux(){
fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK"
# runs gsquery check on game with specific engines.
local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
for allowed_engine in "${allowed_engines_array[@]}"
do
if [ "${allowed_engine}" == "starbound" ]; then
Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/core_dl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn_fetch_file(){
# if larger file shows progress bar
if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]; then
echo -ne "downloading ${local_filename}..."
sleep 1
sleep 0.5
curlcmd=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
echo -ne "downloading ${local_filename}..."
else
Expand Down
4 changes: 2 additions & 2 deletions lgsm/functions/gsquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def __init__(self, options, arguments):
self.default_buffer_length = 1024
#
sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
idtech2query=['idtech3','quake','iw3.0']
idtech3query=['idtech2','iw2.0']
idtech3query=['idtech3','quake','iw3.0']
idtech2query=['idtech2','iw2.0']
if self.option.engine in sourcequery:
self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
elif self.option.engine in idtech2query:
Expand Down
22 changes: 22 additions & 0 deletions lgsm/functions/info_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,25 @@ fn_info_config_squad(){
maxplayers=${maxplayers:-"0"}
}

fn_info_config_stationeers(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
rconpassword="${unavailable}"
maxplayers="${unavailable}"
else
servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "RCONPASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/RCONPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
maxplayers=$(grep "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')

# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
fi
}

# ARK: Survival Evolved
if [ "${gamename}" == "ARK: Survivial Evolved" ]; then
Expand Down Expand Up @@ -993,4 +1012,7 @@ elif [ "${gamename}" == "Multi Theft Auto" ]; then
fn_info_config_mta
elif [ "${gamename}" == "Squad" ]; then
fn_info_config_squad
# Stationeers
elif [ "${gamename}" == "Stationeers" ]; then
fn_info_config_stationeers
fi
16 changes: 14 additions & 2 deletions lgsm/functions/info_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ fn_info_message_ports(){

parmslocation="${red}UNKNOWN${default}"
# engines/games that require editing in the config file
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
for port_edit in "${ports_edit_array[@]}"
do
if [ "${shortname}" == "ut3" ]; then
Expand Down Expand Up @@ -618,7 +618,7 @@ fn_info_message_minecraft(){
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Game\tINBOUND\t${port}\ttcp"
} | column -s $'\t' -t
}

Expand Down Expand Up @@ -835,6 +835,16 @@ fn_info_message_starbound(){
} | column -s $'\t' -t
}

fn_info_message_stationeers(){
echo -e "netstat -atunp | grep rocketstation"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\ttcp"
echo -e "> Query\tINBOUND\t${queryport}\ttcp"
} | column -s $'\t' -t
}

fn_info_message_teamspeak3(){
echo -e "netstat -atunp | grep ts3server"
echo -e ""
Expand Down Expand Up @@ -1021,6 +1031,8 @@ fn_info_message_select_engine(){
fn_info_message_samp
elif [ "${gamename}" == "Squad" ]; then
fn_info_message_squad
elif [ "${gamename}" == "Stationeers" ]; then
fn_info_message_stationeers
elif [ "${gamename}" == "TeamSpeak 3" ]; then
fn_info_message_teamspeak3
elif [ "${gamename}" == "Tower Unite" ]; then
Expand Down
13 changes: 12 additions & 1 deletion lgsm/functions/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ fn_set_config_vars(){
echo "changing hostname."
fn_script_log_info "changing hostname."
sleep 1
sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"

if [ $(grep SERVERNAME=SERVERNAME \"${lgsmdir}/config-default/config-game/${config}\") ]; then
sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
else
sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
fi
echo "changing rcon/admin password."
fn_script_log_info "changing rcon/admin password."
sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
Expand Down Expand Up @@ -462,6 +467,12 @@ elif [ "${gamename}" == "Starbound" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Stationeers" ]; then
gamedirname="Stationeers"
array_configs+=( default.ini )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
gamedirname="SanAndreasMultiplayer"
array_configs+=( server.cfg )
Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/install_gslt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo ""
echo "Game Server Login Token"
echo "================================="
sleep 1
if [ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Counter-Strike: Source" ]; then
if [ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "No More Room in Hell" ]; then
echo "GSLT is required to run a public ${gamename} server"
fn_script_log_info "GSLT is required to run a public ${gamename} server"
else
Expand Down
Loading

0 comments on commit 058d690

Please sign in to comment.