當前位置: 首頁>>代碼示例>>C#>>正文


C# BulletinMessage.GetTimeAsString方法代碼示例

本文整理匯總了C#中Server.Items.BulletinMessage.GetTimeAsString方法的典型用法代碼示例。如果您正苦於以下問題:C# BulletinMessage.GetTimeAsString方法的具體用法?C# BulletinMessage.GetTimeAsString怎麽用?C# BulletinMessage.GetTimeAsString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Items.BulletinMessage的用法示例。


在下文中一共展示了BulletinMessage.GetTimeAsString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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


注:本文中的Server.Items.BulletinMessage.GetTimeAsString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。