Browse Source

fix(wipe): resolve random seed not working (#3190)

* random seed

* correct name

* add seed to info_parms

* fix(wipe): resolve random seed not working
pull/3116/head
Daniel Gibbs 4 years ago
committed by GitHub
parent
commit
dc546ea23c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lgsm/functions/command_wipe.sh
  2. 7
      lgsm/functions/info_parms.sh

6
lgsm/functions/command_wipe.sh

@ -198,6 +198,11 @@ 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.
fn_wipe_random_seed(){
shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"
}
fn_print_dots ""
check.sh
@ -219,6 +224,7 @@ if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[
fi
fn_print_complete_nl "Wiping ${selfname}"
fn_script_log_pass "Wiping ${selfname}"
fn_wipe_random_seed
else
fn_print_ok_nl "Wipe not required"
fn_script_log_pass "Wipe not required"

7
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(){

Loading…
Cancel
Save