当前位置: 首页>>代码示例>>C#>>正文


C# Items.BulletinMessage类代码示例

本文整理汇总了C#中Server.Items.BulletinMessage的典型用法代码示例。如果您正苦于以下问题:C# BulletinMessage类的具体用法?C# BulletinMessage怎么用?C# BulletinMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BulletinMessage类属于Server.Items命名空间,在下文中一共展示了BulletinMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BBMessageHeader

        public BBMessageHeader( BaseBulletinBoard board, BulletinMessage msg )
            : base(0x71)
        {
            string poster = SafeString( msg.PostedName );
            string subject = SafeString( msg.Subject );
            string time = SafeString( msg.GetTimeAsString() );

            EnsureCapacity( 22 + poster.Length + subject.Length + time.Length );

            m_Stream.Write( (byte) 0x01 ); // PacketID
            m_Stream.Write( (int) board.Serial ); // Bulletin board serial
            m_Stream.Write( (int) msg.Serial ); // Message serial

            BulletinMessage thread = msg.Thread;

            if ( thread == null )
                m_Stream.Write( (int) 0 ); // Thread serial--root
            else
                m_Stream.Write( (int) thread.Serial ); // Thread serial--parent

            WriteString( poster );
            WriteString( subject );
            WriteString( time );
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:24,代码来源:BulletinBoards.cs

示例2: RecurseDelete

        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] );
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:25,代码来源:BulletinBoards.cs

示例3: BBMessageContent

        public BBMessageContent( BaseBulletinBoard board, BulletinMessage msg )
            : base(0x71)
        {
            string poster = SafeString( msg.PostedName );
            string subject = SafeString( msg.Subject );
            string time = SafeString( msg.GetTimeAsString() );

            EnsureCapacity( 22 + poster.Length + subject.Length + time.Length );

            m_Stream.Write( (byte) 0x02 ); // PacketID
            m_Stream.Write( (int) board.Serial ); // Bulletin board serial
            m_Stream.Write( (int) msg.Serial ); // Message serial

            WriteString( poster );
            WriteString( subject );
            WriteString( time );

            m_Stream.Write( (short) msg.PostedBody );
            m_Stream.Write( (short) msg.PostedHue );

            int len = msg.PostedEquip.Length;

            if ( len > 255 )
                len = 255;

            m_Stream.Write( (byte) len );

            for ( int i = 0; i < len; ++i )
            {
                BulletinEquip eq = msg.PostedEquip[i];

                m_Stream.Write( (short) eq.itemID );
                m_Stream.Write( (short) eq.hue );
            }

            len = msg.Lines.Length;

            if ( len > 255 )
                len = 255;

            m_Stream.Write( (byte) len );

            for ( int i = 0; i < len; ++i )
                WriteString( msg.Lines[i] );
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:45,代码来源:BulletinBoards.cs

示例4: BulletinMessage

        public BulletinMessage(Mobile poster, BulletinMessage thread, string subject, string[] lines)
            : base(0xEB0)
        {
            this.Movable = false;

            this.m_Poster = poster;
            this.m_Subject = subject;
            this.m_Time = DateTime.UtcNow;
            this.m_LastPostTime = this.m_Time;
            this.m_Thread = thread;
            this.m_PostedName = this.m_Poster.Name;
            this.m_PostedBody = this.m_Poster.Body;
            this.m_PostedHue = this.m_Poster.Hue;
            this.m_Lines = lines;

            List<BulletinEquip> list = new List<BulletinEquip>();

            for (int i = 0; i < poster.Items.Count; ++i)
            {
                Item item = poster.Items[i];

                if (item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount)
                    list.Add(new BulletinEquip(item.ItemID, item.Hue));
            }

            this.m_PostedEquip = list.ToArray();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:27,代码来源:BulletinBoards.cs

示例5: PostMessage

        public void PostMessage( Mobile from, BulletinMessage thread, string subject, string[] lines )
        {
            if ( thread != null )
                thread.LastPostTime = DateTime.Now;

            AddItem( new BulletinMessage( from, thread, subject, lines ) );
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:7,代码来源:BulletinBoards.cs

示例6: MessageOK

 public virtual bool MessageOK( BulletinMessage msg )
 {
     return msg.Parent == this;
 }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:4,代码来源:BulletinBoards.cs

示例7: BulletinMessage

		public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
			: base( 0xEB0 )
		{
			Movable = false;

			m_Poster = poster;
			m_Subject = subject;
			m_Time = DateTime.Now;
			m_LastPostTime = m_Time;
			m_Thread = thread;
			m_PostedName = m_Poster.Name;
			m_PostedBody = m_Poster.Body;
			m_PostedHue = m_Poster.Hue;
			m_Lines = lines;

            List<BulletinEquip> list = new List<BulletinEquip>();

            for (int i = 0; i < poster.Items.Count; ++i)
            {
                Item item = poster.Items[i];

                if (item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount)
                    list.Add(new BulletinEquip(item.ItemID, item.Hue));
            }
            /*
			var postedEquip =
                from item in poster.item()
				where item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount
				select new BulletinEquip( item.ItemID, item.Hue );
             */

            m_PostedEquip = list.ToArray();
		}
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:33,代码来源:BulletinBoards.cs

示例8: BulletinMessage

        public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
            : base(0xEB0)
        {
            Movable = false;

            m_Poster = poster;
            m_Subject = subject;
            m_Time = DateTime.Now;
            m_Thread = thread;
            m_Lines = lines;
            if ( m_Poster == null )
            {
                m_PostedName = "";
                m_PostedBody = 0x0190;
                m_PostedHue = 0x83EA;
                m_PostedEquip = new BulletinEquip[0];
            }
            else
            {
                m_PostedName = m_Poster.Name;
                m_PostedBody = m_Poster.Body;
                m_PostedHue = m_Poster.Hue;

                ArrayList list = new ArrayList( poster.Items.Count );
                for ( int i = 0; i < poster.Items.Count; ++i )
                {
                    Item item = (Item)poster.Items[i];

                    if ( item.Layer >= Layer.FirstValid && item.Layer <= Layer.LastValid )
                        list.Add( new BulletinEquip( item.ItemID, item.Hue ) );
                }
                m_PostedEquip = (BulletinEquip[])list.ToArray( typeof( BulletinEquip ) );
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:34,代码来源:BulletinBoards.cs

示例9: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if ( reader.ReadBool() )
                m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-(

            if ( reader.ReadBool() )
            {
                m_DeleteTime = reader.ReadDeltaTime();
                m_DeleteTimer = new DeleteTimer( this, m_DeleteTime - DateTime.Now );
                m_DeleteTimer.Start();
            }

            m_Message = reader.ReadItem() as BulletinMessage;
        }
开发者ID:Godkong,项目名称:Origins,代码行数:18,代码来源:BaseEscortable.cs

示例10: PostMessage

 public override void PostMessage( Mobile from, BulletinMessage thread, string subject, string[] lines )
 {
     from.SendAsciiMessage( "This board is for automated bounty postings only.  For communications you should use the forums at http://www.uorebirth.com" );
     return;
 }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:5,代码来源:BulletinBoards.cs

示例11: GetLastPostTime

 public override DateTime GetLastPostTime( BulletinMessage check )
 {
     return check.Time;
 }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:4,代码来源:BulletinBoards.cs

示例12: RecurseDelete

        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();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:22,代码来源:BulletinBoards.cs

示例13: BulletinMessage

        public BulletinMessage( Mobile poster, BulletinMessage thread, string subject, string[] lines )
            : base(0xEB0)
        {
            Movable = false;

            m_Poster = poster;
            m_Subject = subject;
            m_Time = DateTime.Now;
            m_LastPostTime = m_Time;
            m_Thread = thread;
            m_PostedName = m_Poster.Name;
            m_PostedBody = m_Poster.Body;
            m_PostedHue = m_Poster.Hue;
            m_Lines = lines;

            ArrayList list = new ArrayList();

            for ( int i = 0; i < poster.Items.Count; ++i )
            {
                Item item = poster.Items[i];

                if ( item.Layer >= Layer.OneHanded && item.Layer <= Layer.Mount )
                    list.Add( new BulletinEquip( item.ItemID, item.Hue ) );
            }

            m_PostedEquip = (BulletinEquip[])list.ToArray( typeof( BulletinEquip ) );
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:27,代码来源:BulletinBoards.cs

示例14: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_Poster = reader.ReadMobile();
                    m_Subject = reader.ReadString();
                    m_Time = reader.ReadDateTime();
                    m_LastPostTime = reader.ReadDateTime();
                    bool hasThread = reader.ReadBool();
                    m_Thread = reader.ReadItem() as BulletinMessage;
                    m_PostedName = reader.ReadString();
                    m_PostedBody = reader.ReadInt();
                    m_PostedHue = reader.ReadInt();

                    m_PostedEquip = new BulletinEquip[reader.ReadInt()];

                    for ( int i = 0; i < m_PostedEquip.Length; ++i )
                    {
                        m_PostedEquip[i].itemID = reader.ReadInt();
                        m_PostedEquip[i].hue = reader.ReadInt();
                    }

                    m_Lines = new string[reader.ReadInt()];

                    for ( int i = 0; i < m_Lines.Length; ++i )
                        m_Lines[i] = reader.ReadString();

                    if ( hasThread && m_Thread == null )
                        Delete();

                    break;
                }
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:40,代码来源:BulletinBoards.cs

示例15: OnLocationChange

        protected override void OnLocationChange(Point3D oldLocation)
        {
            base.OnLocationChange(oldLocation);

            if (oldLocation == Point3D.Zero)
            {
                EDI dest = GetDestination();

                if (dest != null && m_Message == null)
                {
                    if (m_Camp != null)
                        m_Message = new PrisonerMessage(m_Camp, this);
                    else
                        m_Message = new EscortMessage(this);
                }
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:17,代码来源:BaseEscortable.cs


注:本文中的Server.Items.BulletinMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。