[Release] Custom Automatic Restarter for LOTF Source!!!

05/06/2009 00:57 Mjnorman#1
First in General.cs Search for public static void DoStuff()
Above it add this
Quote:
public static void RestarttTimer_Elapsed(object sender, ElapsedEventArgs e)
{
World.SendMsgToAll("Server Restart in 10 seconds!", "SYSTEM", 2011);
new Thread(new ThreadStart(
delegate()
{
Console.WriteLine("Server Restarting in 10 seconds!");
Thread.Sleep(5000);
Console.WriteLine("Server Restarting in 5 seconds!");
World.SendMsgToAll("Server Restart in 5 seconds!", "SYSTEM", 2011);
Thread.Sleep(5000);
World.SaveAllChars();
General.ServerRestart();
}
)).Start();
}
Now go Some were around line 55 in General.cs and Put this!!!
Quote:
public static System.Timers.Timer RestarttTimer;
Now Goto Line 246 in General.cs and Put this!
Quote:
RestarttTimer = new System.Timers.Timer();
RestarttTimer.Interval = 3600000;
RestarttTimer.Elapsed += new ElapsedEventHandler(RestarttTimer_Elapsed);
RestarttTimer.Start();
Hit Thanks if this helped you please
05/06/2009 00:59 LetterX#2
Quote:
Originally Posted by Mjnorman View Post
Now go Some were around line 55 in General.cs and Put this!!!
Now Goto Line 246 in General.cs and Put this!
You can't base it off of lines.
You may have stuff in your general.cs file others don't, therefore making your file longer and containing data at different lines than others; or vice versa.

edit: fixed quote
05/06/2009 01:21 Mjnorman#3
Quote:
Originally Posted by LetterX View Post
You can't base it off of lines.
You may have stuff in your general.cs file others don't, therefore making your file longer and containing data at different lines than others; or vice versa.

edit: fixed quote
ohhh sorry