Browse Source

fix(rust): random seed not generating

pull/4161/head
Daniel Gibbs 2 years ago
parent
commit
89363f6b25
  1. 2
      lgsm/functions/fix_rust.sh
  2. 6
      lgsm/functions/info_game.sh

2
lgsm/functions/fix_rust.sh

@ -12,7 +12,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedic
# Part of random seed feature.
# If seed is not defined by user generate a seed file.
if [ -z "${seed}" ]; then
if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then
if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then
shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"
fi

6
lgsm/functions/info_game.sh

@ -1490,7 +1490,11 @@ fn_info_game_rust() {
serverlevel=${serverlevel:-"NOT SET"}
customlevelurl=${customlevelurl:-"NOT SET"}
worldsize=${worldsize:-"0"}
seed=${seed:-"0"}
if [ -n "${seed}" ]; then
seed=${seed:-"0"}
elif [ -f "${datadir}/${selfname}-seed.txt" ]; then
seed=$(cat "${datadir}/${selfname}-seed.txt")
fi
salt=${salt:-"0"}
}

Loading…
Cancel
Save