Browse Source

Fixes and improvements

- moved tick_rate to config
- corrected config info (port -> masterport)
- corrected default cluster.ini path
- added missing $ for variables
pull/1200/head
Marvin Lehmann 9 years ago
parent
commit
8a21bfe48d
  1. 5
      DontStarveTogether/dstserver
  2. 6
      lgsm/functions/info_config.sh
  3. 9
      lgsm/functions/install_config.sh

5
DontStarveTogether/dstserver

@ -36,7 +36,6 @@ ip="0.0.0.0"
port="11000" port="11000"
steamauthenticationport="8768" steamauthenticationport="8768"
steammasterserverport="27018" steammasterserverport="27018"
tickrate="15"
# Edit with care # Edit with care
persistentstorageroot="${HOME}/.klei" persistentstorageroot="${HOME}/.klei"
@ -44,7 +43,7 @@ confdir="DoNotStarveTogether"
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){ 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 # -console -cluster MyDediServer -shard Master
} }
@ -117,7 +116,7 @@ executable="./dontstarve_dedicated_server_nullrenderer"
clustercfg="cluster.ini" clustercfg="cluster.ini"
clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}" clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}"
clustercfgfullpath="${clustercfgdir}/${clustercfg}" clustercfgfullpath="${clustercfgdir}/${clustercfg}"
clustercfgdefault="${clustercfgdir}/cluster.ini" clustercfgdefault="cluster.ini"
servercfg="server.ini" servercfg="server.ini"
servercfgdir="${clustercfgdir}/${shard}" servercfgdir="${clustercfgdir}/${shard}"
servercfgfullpath="${servercfgdir}/${servercfg}" servercfgfullpath="${servercfgdir}/${servercfg}"

6
lgsm/functions/info_config.sh

@ -87,14 +87,14 @@ fn_info_config_dontstarve(){
slots="${zero}" slots="${zero}"
gamemode="${unavailable}" gamemode="${unavailable}"
tickrate="${zero}" tickrate="${zero}"
port="${zero}" masterport="${zero}"
else 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]*$//') 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]*$//') 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:]') 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]*$//') 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:]') 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 # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
@ -102,7 +102,7 @@ fn_info_config_dontstarve(){
slots=${slots:-"0"} slots=${slots:-"0"}
gamemode=${gamemode:-"NOT SET"} gamemode=${gamemode:-"NOT SET"}
tickrate=${tickrate:-"0"} tickrate=${tickrate:-"0"}
port=${port:-"0"} masterport=${masterport:-"0"}
fi fi
} }

9
lgsm/functions/install_config.sh

@ -97,11 +97,11 @@ fn_dstconfig(){
cp -v "${lgsmdir}/default-configs/${servercfgdefault}" "${servercfgfullpath}" cp -v "${lgsmdir}/default-configs/${servercfgdefault}" "${servercfgfullpath}"
sleep 1 sleep 1
# removing unnecessary options (dependent on sharding & shard type) # removing unnecessary options (dependent on sharding & shard type)
if [ "sharding" == "false" ]; then if [ "${sharding}" == "false" ]; then
sed -i "s/ISMASTER//g" "${servercfgfullpath}" sed -i "s/ISMASTER//g" "${servercfgfullpath}"
sed -d "/SHARDNAME/d" "${servercfgfullpath}" sed -i "/SHARDNAME/d" "${servercfgfullpath}"
elif [ "master" == "true" ]; then elif [ "${master}" == "true" ]; then
sed -d "/SHARDNAME/d" "${servercfgfullpath}" sed -i "/SHARDNAME/d" "${servercfgfullpath}"
fi fi
# configure settings # configure settings
echo "changing shard name." echo "changing shard name."
@ -233,6 +233,7 @@ elif [ "${gamename}" == "Deathmatch Classic" ]; then
fn_set_config_vars fn_set_config_vars
elif [ "${gamename}" == "Don't Starve Together" ]; then elif [ "${gamename}" == "Don't Starve Together" ]; then
gamedirname="DontStarveTogether" gamedirname="DontStarveTogether"
fn_check_cfgdir
array_configs+=( cluster.ini server.ini ) array_configs+=( cluster.ini server.ini )
fn_fetch_default_config fn_fetch_default_config
fn_dstconfig fn_dstconfig

Loading…
Cancel
Save