From 8a21bfe48d3e3b405fa766e8f5b79035286c81d6 Mon Sep 17 00:00:00 2001 From: Marvin Lehmann Date: Fri, 11 Nov 2016 21:15:23 +0100 Subject: [PATCH] Fixes and improvements - moved tick_rate to config - corrected config info (port -> masterport) - corrected default cluster.ini path - added missing $ for variables --- DontStarveTogether/dstserver | 5 ++--- lgsm/functions/info_config.sh | 6 +++--- lgsm/functions/install_config.sh | 9 +++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index 6b65cacf7..859dbbe8f 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -36,7 +36,6 @@ ip="0.0.0.0" port="11000" steamauthenticationport="8768" steammasterserverport="27018" -tickrate="15" # Edit with care persistentstorageroot="${HOME}/.klei" @@ -44,7 +43,7 @@ confdir="DoNotStarveTogether" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="-bind_ip ${ip} -port ${port} -steam_master_server_port ${steammasterserverport} -steam_authentication_port ${steamauthenticationport} -tick ${tickrate} -persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" +parms="-bind_ip ${ip} -port ${port} -steam_master_server_port ${steammasterserverport} -steam_authentication_port ${steamauthenticationport} -persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" # -console -cluster MyDediServer -shard Master } @@ -117,7 +116,7 @@ executable="./dontstarve_dedicated_server_nullrenderer" clustercfg="cluster.ini" clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}" clustercfgfullpath="${clustercfgdir}/${clustercfg}" -clustercfgdefault="${clustercfgdir}/cluster.ini" +clustercfgdefault="cluster.ini" servercfg="server.ini" servercfgdir="${clustercfgdir}/${shard}" servercfgfullpath="${servercfgdir}/${servercfg}" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 4e8fca918..99e2038fa 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -87,14 +87,14 @@ fn_info_config_dontstarve(){ slots="${zero}" gamemode="${unavailable}" tickrate="${zero}" - port="${zero}" + masterport="${zero}" else servername=$(grep "cluster_name" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "cluster_password" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') slots=$(grep "max_players" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} @@ -102,7 +102,7 @@ fn_info_config_dontstarve(){ slots=${slots:-"0"} gamemode=${gamemode:-"NOT SET"} tickrate=${tickrate:-"0"} - port=${port:-"0"} + masterport=${masterport:-"0"} fi } diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index d751fb3a1..a77ef5d2d 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -97,11 +97,11 @@ fn_dstconfig(){ cp -v "${lgsmdir}/default-configs/${servercfgdefault}" "${servercfgfullpath}" sleep 1 # removing unnecessary options (dependent on sharding & shard type) - if [ "sharding" == "false" ]; then + if [ "${sharding}" == "false" ]; then sed -i "s/ISMASTER//g" "${servercfgfullpath}" - sed -d "/SHARDNAME/d" "${servercfgfullpath}" - elif [ "master" == "true" ]; then - sed -d "/SHARDNAME/d" "${servercfgfullpath}" + sed -i "/SHARDNAME/d" "${servercfgfullpath}" + elif [ "${master}" == "true" ]; then + sed -i "/SHARDNAME/d" "${servercfgfullpath}" fi # configure settings echo "changing shard name." @@ -233,6 +233,7 @@ elif [ "${gamename}" == "Deathmatch Classic" ]; then fn_set_config_vars elif [ "${gamename}" == "Don't Starve Together" ]; then gamedirname="DontStarveTogether" + fn_check_cfgdir array_configs+=( cluster.ini server.ini ) fn_fetch_default_config fn_dstconfig