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"
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}"

6
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
}

9
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

Loading…
Cancel
Save