Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the creation of named save while server is active. #401

Open
Squelch opened this issue Jul 15, 2024 · 5 comments
Open

Enable the creation of named save while server is active. #401

Squelch opened this issue Jul 15, 2024 · 5 comments

Comments

@Squelch
Copy link

Squelch commented Jul 15, 2024

Background

On the Saves page, the user is prevented from creating a save while the server is running. Factorio now allows the console command /c server-save This will save the game as the currently loaded filename in the same manner as Save and Stop Server on the Controls page. However, a non documented feature of this command is that it also allows a named save to be created ie /c server save 123 with .zip extension being appended automattically.
Cannot-save-while-running

Suggestion

Instead of displaying the message that saves are not possible, branch the code from using system IO file creation while game is not running, to issuing an RCON command to save the savegame name entered in the field while the game is running.
Save-while-running

Expected result:

Save-Complete

The same result can be achieved from the console page, or by issuing the command ingame of course, but this suggestion would appear more intuitive, and remove the suggestion that no save while running is not possible.

@knoxfighter
Copy link
Member

That is a great suggestion. Also there is no need to run the LUA console. The command /server-save can be used directly.

@Mattie112
Copy link
Contributor

Does this also leave the game running? E.g. does this prevent the "saving" pause when (autosaving) saving normally?

@Squelch
Copy link
Author

Squelch commented Jul 15, 2024

Does this also leave the game running? E.g. does this prevent the "saving" pause when (autosaving) saving normally?

Only on Linux machines where forking and therefore asynchronous saving is possible. Sadly Windows does not allow this natively, but I think I recall that WSL2 can fork. Players will still see the save being created by the server however.

Some background. Asynchronous saving was, and still is in some places marked as experimental, but has been fixed. There were problems reported where it would cause crashes. The problem was eventually tracked down to being Steam specific where both forks of Factorio would send the same save to Steam. The first would be accepted and acknowledged, but the second would never complete. This left multiple forks hanging waiting for the acknowledgment that never arrived and an eventual crash. Standalone Factorio never suffered from this problem.

See the forum thread: https://forums.factorio.com/viewtopic.php?p=523229#p523229

@Squelch
Copy link
Author

Squelch commented Nov 23, 2024

Also there is no need to run the LUA console. The command /server-save can be used directly.

Yep, that's a good point. Allow me to clarify -

I use a shorthand convention (in my head at least) to denote which command interpreter it might be called from. In this context, /c shows it can be run from within Factorio too.

Windows commandline
>
Windows Powershell
PS>
'nix commandline
$
Factorio commandline
/c

@knoxfighter
Copy link
Member

Don't forget the RCON command /save. This can also be used in the webinterface console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants