Program.WriteLine();
Program.RestartTimer = new System.Timers.Timer();
Program.RestartTimer.Interval = (120 * 60000);
Program.RestartTimer.Elapsed += new System.Timers.ElapsedEventHandler(Program.Restart);
Program.RestartTimer.Start();
Program.RestartTimer1 = new System.Timers.Timer();
Program.RestartTimer1.Interval = (10 * 60000);
Program.RestartTimer1.Elapsed += new System.Timers.ElapsedEventHandler(Program.Restart1);
Program.RestartTimer1.Start();
Program.WriteLine("Server restart timer ON");
Then add these voids
PHP Code:
public static void Restart1(object source, System.Timers.ElapsedEventArgs e)
{
Program.WriteLine("Server will restart in 10 min");
Game.World.SendMsgToAll("Server", "Server will restart in 10 minitues. Please log off to avoid data loses", 2001, 0);
}
public static void Restart(object source, System.Timers.ElapsedEventArgs e)
{
NewestCOServer.Main.AuthWorker.Listener.Close();
NewestCOServer.Main.GameWorker.Listener.Close();
try
{
foreach (Game.Character C in Game.World.H_Chars.Values)
{
try
{
C.MyClient.Disconnect();
Console.WriteLine(C.Name + " has logged off successfuly.");
}
catch { continue; }
}
}
catch { }
Database.SaveKOs();
Console.WriteLine("KOs saved.");
Database.SaveEmpire();
Console.WriteLine("Empire saved.");
Features.Guilds.SaveGuilds();
Console.WriteLine("Guilds saved.");
Features.SkillsClass.Save();
Console.WriteLine("Skills saved.");
Console.WriteLine("Database disposed.");
Console.WriteLine("Write /exit or click X to close the window.");
System.Diagnostics.Process.Start("NewestCOServer.exe");
Environment.Exit(0);
}
}
}
@Synthesis
I dont think thats 2 1/2 hours cause my server just retarted, I think it was 20-25 mins or so. what would i change the "120" to to make it 2.5 hours? >.>
@Synthesis
I dont think thats 2 1/2 hours cause my server just retarted, I think it was 20-25 mins or so. what would i change the "120" to to make it 2.5 hours? >.>
[Request] Guilds, Friends, Marriage, Auto Restart 07/02/2009 - CO2 Private Server - 8 Replies Hi everyone!
I'd like some help fixing my code for these sections. I use PowerSource. I would appreciate any code given, and any explanations on how to figure it out would be great.
Guilds - The name 'DataBase' does not exist in the current context in Guild.cs, line 32, 156, 179, 192, 236 Character.cs, line 1646
Friends - I can only find code for LOTF source. As is, friends will randomly disappear off the friend list. I think it's a problem packing or unpacking the list.
...
[Help] how do i Delete the Auto-Restart system 02/23/2009 - CO2 Private Server - 8 Replies how do i delete the auto restart system??? i really dont like it, so if u can help me plx say...
[Request]Auto Restart Server 08/31/2008 - CO2 Private Server - 9 Replies Can anyone/somesone post a tutorial how to restart your server for about 15 or 10 min or higher.
using LOFT source.
thanks