protected override void OnTick()
		{
			if (item == null || item.Deleted ) { this.Stop(); return;}
			else if (((AutoRestarter)item).b_Switchon == false) { this.Stop(); return; }
			if (DateTime.Now >= item.t_RestartTime)
			{
				World.Broadcast( 0x22, true, "WARNING:" );
				World.Broadcast( 0x22, true, "The server will be restarting in  5 minutes." );
				item.t_RestartTime += TimeSpan.FromDays( 1.0 );
				AutoSave.Save();
				I_Auto_Restarter2 tmr2 = new I_Auto_Restarter2();
				tmr2.Start();
				this.Stop();
			}
		}
Exemple #2
0
 protected override void OnTick()
 {
     if (item == null || item.Deleted)
     {
         this.Stop(); return;
     }
     else if (((AutoRestarter)item).b_Switchon == false)
     {
         this.Stop(); return;
     }
     if (DateTime.Now >= item.t_RestartTime)
     {
         World.Broadcast(0x22, true, "WARNING:");
         World.Broadcast(0x22, true, "The server will be restarting in  5 minutes.");
         item.t_RestartTime += TimeSpan.FromDays(1.0);
         AutoSave.Save();
         I_Auto_Restarter2 tmr2 = new I_Auto_Restarter2();
         tmr2.Start();
         this.Stop();
     }
 }