• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Items.BulletinMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Items.Container类代码示例发布时间:2022-05-26
下一篇:
C# Items.Boots类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap