private void OnTick()
{
DateTime now = DateTime.Now;
TimeSpan age = now - this.Created;
if ( age >= TimeSpan.FromSeconds( 100.0 ) )
this.Delete();
else if ( age >= TimeSpan.FromSeconds( 90.0 ) )
this.Status = CampfireStatus.Off;
else if ( age >= TimeSpan.FromSeconds( 60.0 ) )
this.Status = CampfireStatus.Extinguishing;
if ( this.Status == CampfireStatus.Off || this.Deleted )
return;
foreach ( CampfireEntry entry in new ArrayList( m_Entries ) )
{
if ( !entry.Valid || entry.Player.NetState == null )
{
RemoveEntry( entry );
}
else if ( !entry.Safe && now - entry.Start >= TimeSpan.FromSeconds( 30.0 ) )
{
entry.Safe = true;
entry.Player.SendLocalizedMessage( 500621 ); // The camp is now secure.
}
}
IPooledEnumerable eable = this.GetClientsInRange( SecureRange );
foreach ( NetState state in eable )
{
PlayerMobile pm = state.Mobile as PlayerMobile;
if ( pm != null && GetEntry( pm ) == null )
{
CampfireEntry entry = new CampfireEntry( pm, this );
m_Table[pm] = entry;
m_Entries.Add( entry );
pm.SendLocalizedMessage( 500620 ); // You feel it would take a few moments to secure your camp.
}
}
eable.Free();
}