Przeglądaj źródła

fix: [Factorio] Update startparameters to load the latest server autosave (#4960)

* chore(sync): synced local '.github/' with remote 'general/.github/' (#4947)

Synced from dgibbs64/repo-sync@0a4246db6891a1188edd959ccec352e6c4149eb4 — Merge pull request #12 from dgibbs64/dependabot/npm_and_yarn/brace-expansion-5.0.7

chore(deps): bump brace-expansion from 5.0.6 to 5.0.7

* Update startparameters to load the latest server autosave

Swap --start-server ${serverfiles}/save1.zip with --start-server-load-latest

* fix(fctr): create initial save in saves/ so load-latest finds it

--start-server-load-latest only searches the saves directory. The
initial save was created at ${serverfiles}/save1.zip, so a fresh install
had no saves/ directory and failed to host ("cannot open directory").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Daniel Gibbs <me@danielgibbs.co.uk>
Co-authored-by: unknown <unknown@example.com>
Co-authored-by: LinuxGSM <dev@linuxgsm.com>
Co-authored-by: Knoxed <1338733+knoxed@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: WildPenguin <ville.aakko@gmail.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Jacob Gerega <22921310+jgerega107@users.noreply.github.com>
Co-authored-by: dgibbs64 <dgibbs64@users.noreply.github.com>
Co-authored-by: Nikolay Asenov <10465782+nasenov@users.noreply.github.com>
Co-authored-by: Fabian Raab <fabian@raab.link>
Co-authored-by: yourfate <2371889-youRFate@users.noreply.gitlab.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: fwillo <37631375+fwillo@users.noreply.github.com>
Co-authored-by: Silas J. Matson <sjmatson01@gmail.com>
Doug Murphy 2 tygodni temu
rodzic
commit
25a94f5428

+ 1 - 1
lgsm/config-default/config-lgsm/fctrserver/_default.cfg

@@ -16,7 +16,7 @@ rconpassword="CHANGE_ME"
 branch="stable" # values: stable, experimental
 branch="stable" # values: stable, experimental
 
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="--bind ${ip} --start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}"
+startparameters="--bind ${ip} --start-server-load-latest --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}"
 
 
 #### LinuxGSM Settings ####
 #### LinuxGSM Settings ####
 
 

+ 3 - 1
lgsm/modules/install_factorio_save.sh

@@ -11,4 +11,6 @@ echo -e ""
 echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}"
 echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}"
 fn_messages_separator
 fn_messages_separator
 check_glibc.sh
 check_glibc.sh
-"${executabledir}"/factorio --create "${serverfiles}/save1"
+# Create the save in the saves directory so --start-server-load-latest can find it.
+mkdir -p "${serverfiles}/saves"
+"${executabledir}"/factorio --create "${serverfiles}/saves/save1"