Ejemplo n.º 1
0
            public LogoutGump(CampfireEntry entry, Bedroll bedroll) : base(100, 0)
            {
                m_Entry   = entry;
                m_Bedroll = bedroll;

                m_CloseTimer = Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(CloseGump));

                AddBackground(0, 0, 400, 350, 0xA28);

                AddHtmlLocalized(100, 20, 200, 35, 1011015, false, false); // <center>Logging out via camping</center>

                /* Using a bedroll in the safety of a camp will log you out of the game safely.
                 * If this is what you wish to do choose CONTINUE and you will be logged out.
                 * Otherwise, select the CANCEL button to avoid logging out at this time.
                 * The camp will remain secure for 10 seconds at which time this window will close
                 * and you not be logged out.
                 */
                AddHtmlLocalized(50, 55, 300, 140, 1011016, true, true);

                AddButton(45, 298, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(80, 300, 110, 35, 1011011, false, false); // CONTINUE

                AddButton(200, 298, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(235, 300, 110, 35, 1011012, false, false); // CANCEL
            }
Ejemplo n.º 2
0
        private void OnTick()
        {
            DateTime now = DateTime.UtcNow;
            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();
        }
Ejemplo n.º 3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.Parent != null || !this.VerifyMove(from))
            {
                return;
            }

            if (!from.InRange(this, 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (this.ItemID == 0xA57) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);

                if (dir == Direction.North || dir == Direction.South)
                {
                    this.ItemID = 0xA55;
                }
                else
                {
                    this.ItemID = 0xA56;
                }
            }
            else // unrolled
            {
                this.ItemID = 0xA57;

                if (!from.HasGump(typeof(LogoutGump)))
                {
                    CampfireEntry entry = Campfire.GetEntry(from);

                    if (entry != null && entry.Safe)
                    {
                        from.SendGump(new LogoutGump(entry, this));
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public static void RemoveEntry(CampfireEntry entry)
 {
     m_Table.Remove(entry.Player);
     entry.Fire.m_Entries.Remove(entry);
 }