Here is my question of the day...I have set up my server to automatically restart at 7pm, and I want to give an advanced warning to the people on the shard of 5 minutes until restart. I've set up the restart time correctly, but when it comes up that the server will be restarting shortly it almost instantly restarts instead of waiting for five minutes and then restarting.
Code:
namespace Server.Misc
{
public class AutoRestart : Timer
{
public static bool Enabled = true; // is the script enabled?
private static TimeSpan RestartTime = TimeSpan.FromHours( 19.0 ); // time of day at which to restart
private static TimeSpan RestartDelay = TimeSpan.Zero; // how long the server should remain active before restart (period of 'server wars')
private static TimeSpan WarningDelay = TimeSpan.FromMinutes( 5.0 ); // at what interval should the shutdown message be displayed?
private static bool m_Restarting;
private static DateTime m_RestartTime;
Should I change the TimeSpan.FromMinutes part from 5, because that seems to be seconds and not minutes to 300, because there are 300 seconds in five minutes?