OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
561 stars 135 forks source link

Server reported stopped to early #239

Closed knoxfighter closed 2 years ago

knoxfighter commented 3 years ago

The server is reported as stopped and can be started again, before it really stopped. Especially on large maps, the server is reported as stopped, when it is still saving the map. This results, that it is possible to start it again, while it is still running, which again will result in factorio failing to start, cause it is still running.

jannaahs commented 3 years ago

I would suggest watching for "Factorio server stopped" in the console output of factorio instead of setting running to false directly. This could be done in parseRunningCommand.

jannaahs commented 3 years ago

Like suggested, I did some changes. The pull request is a draft, because there is a possible downside: If there is any problem shutting down factorio, the server might not be set as stopped. This might be an edge case, which will never happen.

What do you think?

Additionally, it would be a good enhancement to add a spinner to the start and stop button while executing the action.