// serverProcessHandler modifies the server process.
serverProcessHandler modifies the server process.
// serverProcessHandler modifies the server process .
func serverProcessHandler(w http.ResponseWriter, r *http.Request) {
	var err error
	var txt string
	switch chi.URLParam(r, "action") {
	case "start":
		err = AssettoProcess.Start()
		txt = "started"
	case "stop":
		err = AssettoProcess.Stop()
		txt = "stopped"
	case "restart":
		err = AssettoProcess.Restart()
		txt = "restarted"
	}
	if err != nil {
		logrus.Errorf("could not change server process status, err: %s", err)
		AddErrFlashQuick(w, r, "Unable to change server status")
	} else {
		AddFlashQuick(w, r, "Server successfully "+txt)
	}
	http.Redirect(w, r, r.Referer(), http.StatusFound)
}
func serverProcessHandler ( w http . ResponseWriter , r * http . Request ) { var err error var txt string switch chi . URLParam ( r , " " ) { case " " : err = AssettoProcess . Start ( ) txt = " " case " " : err = AssettoProcess . Stop ( ) txt = " " case " " : err = AssettoProcess . Restart ( ) txt = " " } if err != nil { logrus . Errorf ( " " , err ) AddErrFlashQuick ( w , r , " " ) } else { AddFlashQuick ( w , r , " " + txt ) } http . Redirect ( w , r , r . Referer ( ) , http . StatusFound ) }
serverProcessHandler modifies the server process.
serverProcessHandler modifies the server process .