// Stop the assetto server.
Stop the assetto server.
// Stop the assetto server .
func (as *AssettoServerProcess) Stop() error {
	if !as.IsRunning() {
		return nil
	}
	as.mutex.Lock()
	defer as.mutex.Unlock()
	err := as.cmd.Process.Kill()
	if err != nil && !strings.Contains(err.Error(), "process already finished") {
		return err
	}
	as.cmd = nil
	as.stopChildProcesses()
	return nil
}
func ( as * AssettoServerProcess ) Stop ( ) error { if ! as . IsRunning ( ) { return nil } as . mutex . Lock ( ) defer as . mutex . Unlock ( ) err := as . cmd . Process . Kill ( ) if err != nil && ! strings . Contains ( err . Error ( ) , " " ) { return err } as . cmd = nil as . stopChildProcesses ( ) return nil }
Stop the assetto server.
Stop the assetto server .