Пример #1
0
        private void RecurseDelete(BulletinMessage msg)
        {
            List <Item> found = new List <Item>();
            List <Item> items = this.Items;

            for (int i = items.Count - 1; i >= 0; --i)
            {
                if (i >= items.Count)
                {
                    continue;
                }

                BulletinMessage check = items[i] as BulletinMessage;

                if (check == null)
                {
                    continue;
                }

                if (check.Thread == msg)
                {
                    check.Delete();
                    found.Add(check);
                }
            }

            for (int i = 0; i < found.Count; ++i)
            {
                RecurseDelete((BulletinMessage)found[i]);
            }
        }
Пример #2
0
        public virtual void Cleanup()
        {
            List <Item> items = this.Items;

            for (int i = items.Count - 1; i >= 0; --i)
            {
                if (i >= items.Count)
                {
                    continue;
                }

                BulletinMessage msg = items[i] as BulletinMessage;

                if (msg == null)
                {
                    continue;
                }

                if (msg.Thread == null && CheckTime(msg.LastPostTime, ThreadDeletionTime))
                {
                    msg.Delete();
                    RecurseDelete(msg);                       // A root-level thread has expired
                }
            }
        }
Пример #3
0
        private void RecurseDelete(BulletinMessage msg)
        {
            ArrayList   found = null;
            List <Item> items = this.Items;

            for (int i = items.Count - 1; i >= 0; --i)
            {
                BulletinMessage check = items[i] as BulletinMessage;
                if (check != null && check.Thread == msg)
                {
                    if (found == null)
                    {
                        found = new ArrayList(1);
                    }
                    found.Add(check);
                }
            }

            if (found != null)
            {
                for (int i = 0; i < found.Count; ++i)
                {
                    RecurseDelete((BulletinMessage)found[i]);
                }
            }
            msg.Delete();
        }
Пример #4
0
        public virtual void Cleanup()
        {
            List <Item> items = this.Items;

            for (int i = items.Count - 1; i >= 0; --i)
            {
                if (i >= items.Count)
                {
                    continue;
                }

                BulletinMessage msg = items[i] as BulletinMessage;

                if (msg == null)
                {
                    continue;
                }

                // Bounty Clean-up
                BountyMessage bm = msg as BountyMessage;
                if (bm != null)
                {
                    if (!((PlayerMobile)bm.BountyPlayer).BountyMark)
                    {
                        msg.Delete();
                        RecurseDelete(msg);
                    }

                    continue;
                }
                // End Bounty Clean-up

                //Stop escort messages from being deleted
                if (msg is EscortMessage)
                {
                    continue;
                }

                if (msg.Thread == null && CheckTime(msg.LastPostTime, ThreadDeletionTime))
                {
                    msg.Delete();
                    RecurseDelete(msg);                       // A root-level thread has expired
                }
            }
        }
Пример #5
0
		public static void BBRemoveMessage( Mobile from, BaseBulletinBoard board, PacketReader pvSrc )
		{
			BulletinMessage msg = World.FindItem( pvSrc.ReadInt32() ) as BulletinMessage;

			if ( msg == null || msg.Parent != board )
				return;

			if ( from.AccessLevel < AccessLevel.GameMaster && msg.Poster != from )
				return;

			msg.Delete();
		}
Пример #6
0
        public virtual void Cleanup()
        {
            List <Item> items = this.Items;

            for (int i = items.Count - 1; i >= 0; --i)
            {
                if (i >= items.Count)
                {
                    continue;
                }

                BulletinMessage msg = items[i] as BulletinMessage;

                if (msg == null)
                {
                    continue;
                }
                #region BBS Quests
                //Stop escort messages from being deleted
                if (msg is EscortMessage)
                {
                    continue;
                }

                //Stop prisoner messages from being deleted
                if (msg is PrisonerMessage)
                {
                    continue;
                }
                #endregion
                if (msg.Thread == null && CheckTime(msg.LastPostTime, ThreadDeletionTime))
                {
                    msg.Delete();
                    this.RecurseDelete(msg); // A root-level thread has expired
                }
            }
        }
Пример #7
0
        private void RecurseDelete( BulletinMessage msg )
        {
            ArrayList found = null;
            List<Item> items = this.Items;

            for ( int i = items.Count - 1; i >= 0; --i )
            {
                BulletinMessage check = items[i] as BulletinMessage;
                if ( check != null && check.Thread == msg )
                {
                    if ( found == null ) found = new ArrayList( 1 );
                    found.Add( check );
                }
            }

            if ( found != null )
            {
                for ( int i = 0; i < found.Count; ++i )
                    RecurseDelete( (BulletinMessage)found[i] );
            }
            msg.Delete();
        }