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


C# PacketReader.ReadString方法代碼示例

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


在下文中一共展示了PacketReader.ReadString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AsciiMessagePacket

 public AsciiMessagePacket(PacketReader reader)
     : base(0x1C, "Ascii Message")
 {
     m_serial = reader.ReadInt32();
     m_graphic = reader.ReadInt16();
     m_type = (MessageTypes)reader.ReadByte();
     m_hue = reader.ReadInt16();
     m_font = reader.ReadInt16();
     m_name = reader.ReadString(30);
     m_text = reader.ReadString();
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:11,代碼來源:AsciiMessagePacket.cs

示例2: AsciiMessagePacket

 public AsciiMessagePacket(PacketReader reader)
     : base(0x1C, "Ascii Message")
 {
     Serial = reader.ReadInt32();
     Model = reader.ReadInt16();
     MsgType = (MessageTypes)reader.ReadByte();
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     SpeakerName = reader.ReadString(30).Trim();
     Text = reader.ReadString();
 }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:11,代碼來源:AsciiMessagePacket.cs

示例3: UnicodeMessagePacket

 public UnicodeMessagePacket(PacketReader reader)
     : base(0xAE, "Unicode Message")
 {
     Serial = reader.ReadInt32();
     Model = reader.ReadInt16();
     MsgType = (MessageTypes)reader.ReadByte();
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     Language = reader.ReadString(4).Trim();
     SpeakerName = reader.ReadString(30).Trim();
     Text = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2);
 }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:12,代碼來源:UnicodeMessagePacket.cs

示例4: BookHeaderNewPacket

 public BookHeaderNewPacket(PacketReader reader)
     : base(0xD4, "Book Header (New)")
 {
     Serial = reader.ReadInt32();
     Flag0 = reader.ReadByte();
     Flag1 = reader.ReadByte();
     Pages = reader.ReadInt16();
     TitleLength = reader.ReadInt16();
     Title = reader.ReadString();
     AuthorLength = reader.ReadInt16();
     Author = reader.ReadString();
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:12,代碼來源:BookHeaderNewPacket.cs

示例5: ChatPacket

 public ChatPacket(PacketReader reader)
     : base(0xB3, "Chat Packet")
 {
     m_language = reader.ReadString(3);
     reader.ReadInt16(); // unknown.
     m_commandtype = reader.ReadByte();
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:7,代碼來源:ChatPacket.cs

示例6: ServerListEntry

 public ServerListEntry(PacketReader reader)
 {
     Index = (ushort)reader.ReadInt16();
     Name = reader.ReadString(32);
     PercentFull = reader.ReadByte();
     Timezone = reader.ReadByte();
     Address = (uint)reader.ReadInt32();
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:8,代碼來源:ServerListEntry.cs

示例7: ServerListEntry

 public ServerListEntry(PacketReader reader)
 {
     index = (ushort)reader.ReadInt16();
     name = reader.ReadString(30);
     percentFull = reader.ReadByte();
     timezone = reader.ReadByte();
     address = (uint)reader.ReadInt32();
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:8,代碼來源:ServerListEntry.cs

示例8: VendorSellItem

            public VendorSellItem(PacketReader reader)
            {
                ItemSerial = reader.ReadInt32();
                ItemID = reader.ReadUInt16();
                Hue = reader.ReadUInt16();
                Amount = reader.ReadUInt16();
                Price = reader.ReadUInt16();

                ushort nameLength = reader.ReadUInt16();
                Name = reader.ReadString(nameLength);
            }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:11,代碼來源:VendorSellListPacket.cs

示例9: MessageLocalizedPacket

 public MessageLocalizedPacket(PacketReader reader)
     : base(0xC1, "Message Localized")
 {
     Serial = reader.ReadInt32(); // 0xffff for system message
     Body = reader.ReadInt16(); // (0xff for system message
     MessageType = (MessageTypes)reader.ReadByte(); // 6 - lower left, 7 on player
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     CliLocNumber = reader.ReadInt32();
     SpeakerName = reader.ReadString(30).Trim();
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:12,代碼來源:MessageLocalizedPacket.cs

示例10: UnicodeMessagePacket

 public UnicodeMessagePacket(PacketReader reader)
     : base(0xAE, "Unicode Message")
 {
     m_serial = reader.ReadInt32();
     m_model = reader.ReadInt16();
     m_msgType = (MessageTypes)reader.ReadByte();
     m_hue = reader.ReadInt16();
     m_font = reader.ReadInt16();
     m_language = reader.ReadInt32();
     m_speakerName = reader.ReadString(30);
     m_spokenText = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2);
 }
開發者ID:leventcorapsiz,項目名稱:UltimaXNA,代碼行數:12,代碼來源:UnicodeMessagePacket.cs

示例11: StatusInfoPacket

        public StatusInfoPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            Serial = reader.ReadInt32();
            PlayerName = reader.ReadString(30);
            CurrentHealth = reader.ReadInt16();
            MaxHealth = reader.ReadInt16();
            NameChangeFlag = reader.ReadByte() != 0x00; // 0x1 = allowed, 0 = not allowed
            StatusTypeFlag = reader.ReadByte();
            if (StatusTypeFlag > 0)
            {
                Sex = (Genders)reader.ReadByte(); // 0=male, 1=female
                Strength = reader.ReadInt16();
                Dexterity = reader.ReadInt16();
                Intelligence = reader.ReadInt16();
                CurrentStamina = reader.ReadInt16();
                MaxStamina = reader.ReadInt16();
                CurrentMana = reader.ReadInt16();
                MaxMana = reader.ReadInt16();
                GoldInInventory = reader.ReadInt32();
                ArmorRating = reader.ReadInt16();
                Weight = reader.ReadInt16();

                if (StatusTypeFlag >= 5)
                {
                    MaxWeight = reader.ReadInt16();
                    Race = (Races)reader.ReadByte();
                }

                if (StatusTypeFlag >= 3)
                {
                    StatCap = reader.ReadInt16();
                    Followers = reader.ReadByte();
                    MaxFollowers = reader.ReadByte();
                }

                if (StatusTypeFlag >= 4)
                {
                    ResistFire = reader.ReadInt16();
                    ResistCold = reader.ReadInt16();
                    ResistPoison = reader.ReadInt16();
                    ResistEnergy = reader.ReadInt16();
                    Luck = reader.ReadInt16();
                    DmgMin = reader.ReadInt16();
                    DmgMax = reader.ReadInt16();
                    TithingPoints = reader.ReadInt16();
                }
            }
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:49,代碼來源:StatusInfoPacket.cs

示例12: VendorBuyListPacket

        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            m_vendorPackSerial = reader.ReadInt32();
            m_itemCount = reader.ReadByte();
            m_prices = new int[m_itemCount];
            m_descriptions = new string[m_itemCount];

            for (int i = 0; i < m_itemCount; i++)
            {
                m_prices[i] = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                m_descriptions[i] = reader.ReadString(descriptionLegnth);
            }
        }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:15,代碼來源:VendorBuyListPacket.cs

示例13: VendorBuyListPacket

        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            VendorPackSerial = reader.ReadInt32();
            int count = reader.ReadByte();
            Items = new List<VendorBuyItem>();
            for (int i = 0; i < count; i++)
            {
                int price = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                string description = reader.ReadString(descriptionLegnth);

                Items.Add(new VendorBuyItem(price, description));
            }
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:15,代碼來源:VendorBuyListPacket.cs

示例14: MobileStatusCompactPacket

        public MobileStatusCompactPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            m_serial = reader.ReadInt32();
            m_playerName = reader.ReadString(30);
            m_currentHealth = reader.ReadInt16();
            m_maxHealth = reader.ReadInt16();
            m_nameChangeFlag = reader.ReadByte(); // 0x1 = allowed, 0 = not allowed
            m_statusTypeFlag = reader.ReadByte();
            sex = (Genders)reader.ReadByte(); // 0=male, 1=female
            m_strength = reader.ReadInt16();
            m_dexterity = reader.ReadInt16();
            m_intelligence = reader.ReadInt16();
            m_currentStamina = reader.ReadInt16();
            m_maxStamina = reader.ReadInt16();
            m_currentMana = reader.ReadInt16();
            m_maxMana = reader.ReadInt16();
            m_goldInInventory = reader.ReadInt32();
            m_armorRating = reader.ReadInt16();
            m_weight = reader.ReadInt16();

            if (m_statusTypeFlag >= 5)
            {
                m_maxWeight = reader.ReadInt16();
                m_race = (Races)reader.ReadByte();
            }

            if (m_statusTypeFlag >= 3)
            {
                m_statCap = reader.ReadInt16();
                m_followers = reader.ReadByte();
                m_maxFollowers = reader.ReadByte();
            }

            if (m_statusTypeFlag >= 4)
            {
                m_resistFire = reader.ReadInt16();
                m_resistCold = reader.ReadInt16();
                m_resistPoison = reader.ReadInt16();
                m_resistEnergy = reader.ReadInt16();
                m_luck = reader.ReadInt16();
                m_dmgMin = reader.ReadInt16();
                m_dmgMax = reader.ReadInt16();
                m_tithingPoints = reader.ReadInt16();
            }
        }
開發者ID:robertdeclaux,項目名稱:UltimaXNA,代碼行數:46,代碼來源:StatusInfoPacket.cs

示例15: BookPagesPacket

 public BookPagesPacket(PacketReader reader)
     : base(0x66, "Book Pages")
 {
     Serial = reader.ReadInt32();
     PageCount = reader.ReadInt16();
     Pages = new BaseBook.BookPageInfo[PageCount];
     for (int i = 0; i < PageCount; ++i)
     {
         int page = reader.ReadInt16();
         int length = reader.ReadInt16();
         string[] lines = new string[length];
         for (int j = 0; j < length; j++)
         {
             lines[j] = reader.ReadString();
         }
         Pages[i] = new BaseBook.BookPageInfo(lines);
     }
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:18,代碼來源:BookPagesPacket.cs


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