From 87576bde91b62f88d68c711ba3c18dbaec84b6ea Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Jan 2021 16:45:27 +0000 Subject: [PATCH] add seed to info_parms --- lgsm/functions/command_wipe.sh | 2 +- lgsm/functions/info_parms.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index ceb3be5b5..3c8e1a419 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -198,7 +198,7 @@ fn_wipe_warning(){ fn_print_warn "wipe is about to start" } -# Will change the seed everytime the wipe command is run if the seed in config is not set +# Will change the seed everytime the wipe command is run if the seed in config is not set. fn_wipe_random_seed(){ if [ -z "${seed}" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 782f774d4..4a81d73ce 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -140,6 +140,13 @@ fn_info_parms_rust(){ maxplayers=${maxplayers:-"0"} saveinterval=${saveinterval:-"0"} tickrate=${tickrate:-"0"} + # Part of random seed feature. + if [ -z "${seed}" ]; then + if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + fi + seed=$(cat "${datadir}/${selfname}-seed.txt") + fi } fn_info_parms_samp(){