From 0dc2b645f3b42f7dcce10953b1cd8c238f1411d9 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 14 Mar 2018 19:55:55 +0100 Subject: [PATCH] Added conditional server salt setting for Rust We don't have the range, but it doesn't prevent users from setting a salt to a known value on an existing server, that they can know running rcon command: server.salt Fixes #1364 Also fixed an unneeded space line 22. --- .../config-lgsm/rustserver/_default.cfg | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index a24932d8a..1ac4b4db1 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -19,7 +19,8 @@ servername="Rust" maxplayers="50" # Advanced Start Settings -seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map +seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map +salt="" # default random; range : unknown range ; used to recover a known setting from an existing map worldsize="3000" # default 3000; range : 1000 to 6000 ; map size in meters saveinterval="300" # Auto-save in seconds tickrate="30" # default 30; range : 15 to 100 @@ -34,7 +35,14 @@ else # Keep randomness of the number if not set conditionalseed="" fi -parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\"" +if [ -n "${salt}" ]; then + # If set, then add to start parms + conditionalsalt="+server.salt ${salt}" +else + # Keep randomness of the number if not set + conditionalsalt="" +fi +parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} ${conditionalsalt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\"" } #### LinuxGSM Settings ####