mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-04 03:49:23 +02:00
Rename files; server to factorio_server and gameconfig to factorio_config.
This commit is contained in:
parent
691e924269
commit
0af1b53a3d
@ -119,15 +119,26 @@ func (f *FactorioServer) Run() error {
|
||||
}
|
||||
|
||||
func (f *FactorioServer) Stop() error {
|
||||
err := f.Cmd.Process.Signal(syscall.SIGINT)
|
||||
if err != nil {
|
||||
err := f.Cmd.Process.Signal(os.Interrupt)
|
||||
|
||||
// SIGINT is not implemented on Windows.
|
||||
if err != nil && err == syscall.EWINDOWS {
|
||||
// TODO: Shutdown Factorio on Windows so the map can be saved.
|
||||
err = f.Cmd.Process.Signal(os.Kill)
|
||||
if err != nil {
|
||||
log.Printf("Error sending SIGKILLL to Factorio process: %s", err)
|
||||
return err
|
||||
} else {
|
||||
log.Println("Sent SIGKILL to Factorio process. Factorio forced to exit.")
|
||||
}
|
||||
} else if err != nil {
|
||||
log.Printf("Error sending SIGINT to Factorio process: %s", err)
|
||||
return err
|
||||
} else {
|
||||
log.Printf("Sent SIGINT to Factorio process. Factorio shutting down...")
|
||||
}
|
||||
|
||||
f.Running = false
|
||||
|
||||
log.Printf("Sent SIGINT to Factorio process, Factorio server shutting down...")
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user