OpenFactorioServerManager / factorio-server-manager

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

Server does not save when stopped manually. #75

Closed JakenVeina closed 6 years ago

JakenVeina commented 7 years ago

"Stop Factorio Server" from the "Server Control" page does not cause the server to save. I can see a note in the CLI for the manager, saying that SIGINT was sent to the server, which should cause the server to save (it does if I'm running the server manually, anyway).

JakenVeina commented 7 years ago

So, it looks like golang actually developed a workaround for this, a few years ago.

https://github.com/golang/go/issues/6720 https://codereview.appspot.com/29290044

Unfortunately, they elected not to incorporate it. The solution was to send CTRL+C to the console the process is running in, rather than actually signaling the process. Since multiple processes can attach to a single console, they decided that rather than be confusing/inconsistent with this, it was better to be explicit that Signal.Interrupt is not implemented on Windows.

The solution is just a dozen lines of code, any chance it could be added in? The biggest issue looks to be that they had to add a new syscall for sending a Control key input to the console.

knoxfighter commented 6 years ago

I think this is fixed with #77