Bug: unable to set seed
Reason: There is a special logic for handling seed parameter in _default.cfg which processes this parameter to conditionalseed variable. However this processing is done before any custom config can be loaded. This IF statement needs to be part of fn_params function.
You're right, this if statement should be before parms="" because, I believe, the parms variable is defined upon going through fn_parms (not running it).
While we could put this if statement right before fn_parms, this could lead to users mistakes due to the new config files system, so it's safer as your said, to put it inside of fn_parms.
So here is the correction to bring:
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
# Specific to Rust
if [ -n "${seed}" ]; then
# If set, then add to start parms
conditionalseed="+server.seed ${seed}"
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}\""
}
Thanky you for looking into this.
Btw. if anyone would be interested in a quick workaround, it is possible to have the following lines in instance cfg:
seed=123456
conditionalseed="+server.seed ${seed}" # This is the actual workaround
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
You're right, this
ifstatement should be beforeparms=""because, I believe, theparmsvariable is defined upon going throughfn_parms(not running it).While we could put this
ifstatement right beforefn_parms, this could lead to users mistakes due to the new config files system, so it's safer as your said, to put it inside offn_parms.So here is the correction to bring: