Beispiel #1
0
        private void OnTick()
        {
            DateTime now = DateTime.UtcNow;

            foreach (FirepitFireEntry 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(m_Firepit.EffectRadius);

            foreach (NetState state in eable)
            {
                PlayerMobile pm = state.Mobile as PlayerMobile;

                if (pm != null && GetEntry(pm) == null)
                {
                    FirepitFireEntry entry = new FirepitFireEntry(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();
        }
Beispiel #2
0
 public static void RemoveEntry(FirepitFireEntry entry)
 {
     m_Table.Remove(entry.Player);
     entry.Fire.m_Entries.Remove(entry);
 }