Tired of crash ?
Use this, it will restart your server automaticly after the crash !
Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.IO; namespace Restarter { class Program { public static bool IsProcessRunning(string ProcessName, string Path) { foreach (Process clsProcess in Process.GetProcesses()) { if (clsProcess.ProcessName.Contains(ProcessName)) { Console.WriteLine(ProcessName + " is still running!"); return true; } } Console.WriteLine(ProcessName + " is not running anymore!"); try { Process.Start(Path); Console.WriteLine("Starting the process. If no error pops up, it went all fine."); } catch { Console.WriteLine(Path + " has NOT been executed. Please check if the path given exists."); } return false; } static void Main(string[] args) { Console.WriteLine("Copyright 2010 - DarKGunZ"); Console.WriteLine("Stroumpf - All rights reserved"); while (true) { IsProcessRunning("Locator", "C:/Gunz/Locator/Locator.exe"); IsProcessRunning("MatchServer", "C:/Gunz/MatchServer/MatchServer.exe"); IsProcessRunning("MatchAgent", "C:/Gunz/MatchAgent/MatchAgent.exe"); System.Threading.Thread.Sleep(10000); } } } }


Reply With Quote


