Linuxgsm: Rust seed is not being used

Created on 11 Nov 2017  路  3Comments  路  Source: GameServerManagers/LinuxGSM

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.

issue resolved bug

Most helpful comment

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

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Frisasky picture Frisasky  路  3Comments

ozhound picture ozhound  路  4Comments

dj-hyb picture dj-hyb  路  3Comments

Septembers picture Septembers  路  3Comments

DavidRayner picture DavidRayner  路  3Comments