factorio output reports server stop

This commit is contained in:
Jan Naahs 2021-06-29 23:33:01 +02:00
parent 9dd4348570
commit 25e1946df7
3 changed files with 5 additions and 2 deletions

View File

@ -347,6 +347,11 @@ func (server *Server) parseRunningCommand(std io.ReadCloser) (err error) {
log.Printf("Error: %s", err)
}
}
// server was stopped
if strings.Contains(strings.Join(line, " "), "ServerMultiplayerManager.cpp:783: updateTick(0) changing state from(Disconnected) to(Closed)") {
server.SetRunning(false)
}
}
}
}

View File

@ -41,7 +41,6 @@ func (server *Server) Stop() error {
log.Printf("Error sending SIGINT to Factorio process: %s", err)
return err
}
server.SetRunning(false)
log.Printf("Sent SIGINT to Factorio process. Factorio shutting down...")
err = server.Rcon.Close()

View File

@ -77,6 +77,5 @@ func (server *Server) Stop() error {
// Re-enable handling of CTRL+C after we're sure that the factrio server is shut down.
setCtrlHandlingIsDisabledForThisProcess(false)
server.SetRunning(false)
return nil
}