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


C# Packet.ReadCString方法代码示例

本文整理汇总了C#中WowPacketParser.Misc.Packet.ReadCString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.ReadCString方法的具体用法?C# Packet.ReadCString怎么用?C# Packet.ReadCString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WowPacketParser.Misc.Packet的用法示例。


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

示例1: HandleAddCalendarEvent

        public static void HandleAddCalendarEvent(Packet packet)
        {
            packet.ReadCString("Title");
            packet.ReadCString("Description");
            packet.ReadEnum<CalendarEventType>("Event Type", TypeCode.Byte);
            packet.ReadEnum<CalendarRepeatType>("Repeat Type", TypeCode.Byte);
            packet.ReadInt32("Max Invites");
            packet.ReadEntryWithName<Int32>(StoreNameType.LFGDungeon, "Dungeon ID");
            packet.ReadPackedTime("Event Time");
            packet.ReadPackedTime("Unk PackedTime");

            var flags = packet.ReadEnum<CalendarFlag>("Event Flags", TypeCode.Int32);

            if ((flags & CalendarFlag.GuildAnnouncement) != 0)
                return;

            var count = packet.ReadInt32("Invite Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadPackedGuid("Creator GUID");
                packet.ReadEnum<CalendarEventStatus>("Status", TypeCode.Byte);
                packet.ReadEnum<CalendarModerationRank>("Moderation Rank", TypeCode.Byte);
            }
        }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:25,代码来源:CalendarHandler.cs

示例2: HandleCalendarCommandResult

 public static void HandleCalendarCommandResult(Packet packet)
 {
     packet.ReadInt32("UnkInt1");
     packet.ReadCString("UnkString1");
     packet.ReadCString("Param 1"); // if %s is used in the error message
     packet.ReadEnum<CalendarError>("Error", TypeCode.Int32);
 }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:7,代码来源:CalendarHandler.cs

示例3: HandleArenaTeamCommandResult

 public static void HandleArenaTeamCommandResult(Packet packet)
 {
     packet.ReadUInt32("Action"); // FIXME: Use enum
     packet.ReadCString("Team Name");
     packet.ReadCString("Player Name");
     packet.ReadUInt32("ErrorId"); // FIXME: Use enum
 }
开发者ID:skypeak,项目名称:WowPacketParser_SkyFire,代码行数:7,代码来源:BattlegroundHandler.cs

示例4: HandleAvailableVoiceChannel

 public static void HandleAvailableVoiceChannel(Packet packet)
 {
     packet.ReadInt64("Unk Int64 1");
     packet.ReadByte("Channel Type");
     packet.ReadCString("Channel Name");
     packet.ReadInt64("Unk Int64 2");
 }
开发者ID:Asdcrew,项目名称:WowPacketParser,代码行数:7,代码来源:VoiceChatHandler.cs

示例5: HandleFriendStatus

        public static void HandleFriendStatus(Packet packet)
        {
            var result = packet.ReadByteE<ContactResult>("Result");

            packet.ReadGuid("GUID");

            switch (result)
            {
                case ContactResult.FriendAddedOffline:
                    packet.ReadCString("Note");
                    break;
                case ContactResult.FriendAddedOnline:
                {
                    packet.ReadCString("Note");
                    ReadSingleContactBlock(packet, false);
                    break;
                }
                case ContactResult.Online:
                    ReadSingleContactBlock(packet, false);
                    break;
                case ContactResult.Unknown2:
                    packet.ReadByte("Unk byte 1");
                    break;
                case ContactResult.Unknown3:
                    packet.ReadInt32("Unk int");
                    break;
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:28,代码来源:ContactHandler.cs

示例6: HandleGroupInvite422

        public static void HandleGroupInvite422(Packet packet)
        {
            // note: this handler is different in 4.3.0, it got a bit fancy.
            var guidBytes = new byte[8];

            guidBytes[6] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[3] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[7] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[1] = (byte)(packet.ReadBit() ? 1 : 0);
            guidBytes[2] = (byte)(packet.ReadBit() ? 1 : 0);

            packet.ReadInt32("Unk0"); // Always 0
            packet.ReadInt32("Unk1"); // Non-zero in cross realm parties (1383)
            packet.ReadCString("Name");

            if (guidBytes[0] != 0) guidBytes[0] ^= packet.ReadByte();
            if (guidBytes[7] != 0) guidBytes[7] ^= packet.ReadByte();
            if (guidBytes[4] != 0) guidBytes[4] ^= packet.ReadByte();
            if (guidBytes[1] != 0) guidBytes[1] ^= packet.ReadByte();
            if (guidBytes[2] != 0) guidBytes[2] ^= packet.ReadByte();
            if (guidBytes[6] != 0) guidBytes[6] ^= packet.ReadByte();
            if (guidBytes[5] != 0) guidBytes[5] ^= packet.ReadByte();

            packet.ReadCString("Realm Name"); // Non-empty in cross realm parties

            if (guidBytes[3] != 0) guidBytes[3] ^= packet.ReadByte();

            // Non-zero in cross realm parties
            packet.WriteLine("GUID: {0}", new Guid(BitConverter.ToUInt64(guidBytes, 0)));
        }
开发者ID:hodobaj,项目名称:StrawberryTools,代码行数:33,代码来源:GroupHandler.cs

示例7: HandleGMResponseReceived

 public static void HandleGMResponseReceived(Packet packet)
 {
     packet.ReadUInt32("Unk 1");
     packet.ReadUInt32("Unk 2");
     packet.ReadCString("Text");
     for (var i = 1; i <= 4; i++)
         packet.ReadCString("Response", i);
 }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:8,代码来源:TicketHandler.cs

示例8: HandleBug

 public static void HandleBug(Packet packet)
 {
     packet.ReadUInt32("Suggestion");
     packet.ReadUInt32("Content Lenght");
     packet.ReadCString("Content");
     packet.ReadUInt32("Text Lenght");
     packet.ReadCString("Text");
 }
开发者ID:samaelsacred,项目名称:WowPacketParser,代码行数:8,代码来源:MiscellaneousHandler.cs

示例9: HandleNpcGossip

        public static void HandleNpcGossip(Packet packet)
        {
            GossipMenu gossip = new GossipMenu();

            WowGuid guid = packet.ReadGuid("GUID");

            gossip.ObjectType = guid.GetObjectType();
            gossip.ObjectEntry = guid.GetEntry();

            uint menuId = packet.ReadUInt32("Menu Id");
            gossip.Entry = menuId;

            if (ClientVersion.AddedInVersion(ClientType.MistsOfPandaria))
                packet.ReadUInt32("Friendship Faction");

            gossip.TextID = packet.ReadUInt32("Text Id");

            uint count = packet.ReadUInt32("Amount of Options");

            for (int i = 0; i < count; i++)
            {
                GossipMenuOption gossipOption = new GossipMenuOption
                {
                    MenuID = menuId,
                    ID = packet.ReadUInt32("Index", i),
                    OptionIcon = packet.ReadByteE<GossipOptionIcon>("Icon", i),
                    BoxCoded = packet.ReadBool("Box", i),
                    BoxMoney = packet.ReadUInt32("Required money", i),
                    OptionText = packet.ReadCString("Text", i),
                    BoxText = packet.ReadCString("Box Text", i)
                };

                Storage.GossipMenuOptions.Add(gossipOption, packet.TimeSpan);
            }

            uint questgossips = packet.ReadUInt32("Amount of Quest gossips");
            for (int i = 0; i < questgossips; i++)
            {
                packet.ReadUInt32<QuestId>("Quest ID", i);

                packet.ReadUInt32("Icon", i);
                packet.ReadInt32("Level", i);
                packet.ReadUInt32E<QuestFlags>("Flags", i);
                if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
                    packet.ReadUInt32E<QuestFlags2>("Flags 2", i);

                packet.ReadBool("Change Icon", i);
                packet.ReadCString("Title", i);
            }

            if (guid.GetObjectType() == ObjectType.Unit)
                if (Storage.Objects.ContainsKey(guid))
                    ((Unit)Storage.Objects[guid].Item1).GossipId = menuId;

            Storage.Gossips.Add(gossip, packet.TimeSpan);

            packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:58,代码来源:NpcHandler.cs

示例10: HandleMailListResult

 public static void HandleMailListResult(Packet packet)
 {
     packet.ReadUInt32("Total Mails");
     var count = packet.ReadByte("Shown Mails");
     for (var i = 0; i < count; ++i)
     {
         packet.ReadUInt16("Message Size", i);
         packet.ReadUInt32("Mail Id", i);
         var mailType = packet.ReadEnum<MailType>("Message Type", TypeCode.Byte, i);
         switch (mailType) // Read GUID if MailType.Normal, int32 (entry) if not
         {
             case MailType.Normal:
                 packet.ReadGuid("Player GUID", i);
                 break;
             case MailType.Creature:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Unit, packet.ReadInt32()));
                 break;
             case MailType.GameObject:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.GameObject, packet.ReadInt32()));
                 break;
             case MailType.Item:
                 packet.Writer.WriteLine("[" + i + "] Entry: " + StoreGetters.GetExistingDatabaseString(StoreNameType.Item, packet.ReadInt32()));
                 break;
             default:
                 packet.ReadInt32("Entry", i);
                 break;
         }
         packet.ReadUInt32("COD", i);
         packet.ReadUInt32("Unk uint32", i);
         packet.ReadUInt32("Stationery", i);
         packet.ReadUInt32("Money", i);
         packet.ReadUInt32("Flags", i);
         packet.ReadSingle("Time?", i);
         packet.ReadUInt32("Template Id", i);
         packet.ReadCString("Subject", i);
         packet.ReadCString("Body", i);
         var items = packet.ReadByte("Item Count", i);
         for (var j = 0; j < items; ++j)
         {
             packet.ReadByte("Item Index", i, j);
             packet.ReadUInt32("Item GuidLow", i, j);
             packet.ReadEntryWithName<UInt32>(StoreNameType.Item, "Item Id", i, j);
             for (var k = 0; k < 7; ++k)
             {
                 packet.ReadUInt32("Item Enchantment Id", i, j, k);
                 packet.ReadUInt32("Item Enchantment Duration", i, j, k);
                 packet.ReadUInt32("Item Enchantment Charges", i, j, k);
             }
             packet.ReadInt32("Item Random Property Id", i, j);
             packet.ReadUInt32("Item Suffix Factor", i, j);
             packet.ReadUInt32("Item Count", i, j);
             packet.ReadUInt32("Item SpellCharges", i, j);
             packet.ReadUInt32("Item Max Durability", i, j);
             packet.ReadUInt32("Item Durability", i, j);
             packet.ReadByte("Unk byte", i, j);
         }
     }
 }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:58,代码来源:MailHandler.cs

示例11: ReadSetInfo

        public static void ReadSetInfo(Packet packet)
        {
            packet.ReadPackedGuid("Set ID");
            packet.ReadInt32("Index");
            packet.ReadCString("Set Name");
            packet.ReadCString("Set Icon");

            for (var j = 0; j < NumSlots; j++)
                packet.ReadPackedGuid("Item GUID " + j);
        }
开发者ID:cyberbrest,项目名称:WowPacketParser,代码行数:10,代码来源:EquipmentSetHandler.cs

示例12: HandleNpcGossip

        public static void HandleNpcGossip(Packet packet)
        {
            var gossip = new Gossip();

            var guid = packet.ReadGuid("GUID");

            gossip.ObjectType = guid.GetObjectType();
            gossip.ObjectEntry = guid.GetEntry();

            var menuId = packet.ReadUInt32("Menu Id");

            if (ClientVersion.AddedInVersion(ClientType.MistsOfPandaria))
                packet.ReadUInt32("Friendship Faction");

            var textId = packet.ReadUInt32("Text Id");

            if (guid.GetObjectType() == ObjectType.Unit)
                if (Storage.Objects.ContainsKey(guid))
                        ((Unit) Storage.Objects[guid].Item1).GossipId = menuId;

            var count = packet.ReadUInt32("Amount of Options");

            gossip.GossipOptions = new List<GossipOption>((int) count);
            for (var i = 0; i < count; i++)
            {
                var gossipOption = new GossipOption
                {
                    Index = packet.ReadUInt32("Index", i),
                    OptionIcon = packet.ReadEnum<GossipOptionIcon>("Icon", TypeCode.Byte, i),
                    Box = packet.ReadBoolean("Box", i),
                    RequiredMoney = packet.ReadUInt32("Required money", i),
                    OptionText = packet.ReadCString("Text", i),
                    BoxText = packet.ReadCString("Box Text", i)
                };

                gossip.GossipOptions.Add(gossipOption);
            }
            Storage.Gossips.Add(Tuple.Create(menuId, textId), gossip, packet.TimeSpan);
            packet.AddSniffData(StoreNameType.Gossip, (int)menuId, guid.GetEntry().ToString(CultureInfo.InvariantCulture));

            var questgossips = packet.ReadUInt32("Amount of Quest gossips");
            for (var i = 0; i < questgossips; i++)
            {
                packet.ReadEntryWithName<UInt32>(StoreNameType.Quest, "Quest ID", i);

                packet.ReadUInt32("Icon", i);
                packet.ReadInt32("Level", i);
                packet.ReadEnum<QuestFlags>("Flags", TypeCode.UInt32, i);
                if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
                    packet.ReadEnum<QuestFlags2>("Flags 2", TypeCode.UInt32, i);

                packet.ReadBoolean("Change Icon", i);
                packet.ReadCString("Title", i);
            }
        }
开发者ID:RazorCore,项目名称:WowPacketParser,代码行数:55,代码来源:NpcHandler.cs

示例13: HandleGameObjectQueryResponse

        public static void HandleGameObjectQueryResponse(Packet packet)
        {
            var entry = packet.ReadEntry("Entry");
            if (entry.Value) // entry is masked
                return;

            GameObjectTemplate gameObject = new GameObjectTemplate
            {
                Entry = (uint)entry.Key
            };

            int unk1 = packet.ReadInt32("Unk1 UInt32");
            if (unk1 == 0)
            {
                packet.ReadByte("Unk1 Byte");
                return;
            }

            gameObject.Type = packet.ReadInt32E<GameObjectType>("Type");
            gameObject.DisplayID = packet.ReadUInt32("Display ID");

            var name = new string[4];
            for (int i = 0; i < 4; i++)
                name[i] = packet.ReadCString("Name", i);
            gameObject.Name = name[0];

            gameObject.IconName = packet.ReadCString("Icon Name");
            gameObject.CastCaption = packet.ReadCString("Cast Caption");
            gameObject.UnkString = packet.ReadCString("Unk String");

            gameObject.Data = new int?[32];
            for (int i = 0; i < gameObject.Data.Length; i++)
                gameObject.Data[i] = packet.ReadInt32("Data", i);

            gameObject.Size = packet.ReadSingle("Size");

            gameObject.QuestItems = new uint?[packet.ReadByte("QuestItems Length")];

            for (int i = 0; i < gameObject.QuestItems.Length; i++)
                gameObject.QuestItems[i] = (uint)packet.ReadInt32<ItemId>("Quest Item", i);

            packet.ReadUInt32E<ClientType>("Expansion");

            packet.ReadByte("Unk1 Byte");

            Storage.GameObjectTemplates.Add(gameObject, packet.TimeSpan);

            ObjectName objectName = new ObjectName
            {
                ObjectType = ObjectType.GameObject,
                ID = entry.Key,
                Name = gameObject.Name
            };
            Storage.ObjectNames.Add(objectName, packet.TimeSpan);
        }
开发者ID:horn,项目名称:WowPacketParser,代码行数:55,代码来源:GameObjectHandler.cs

示例14: HandleGMSurveySubmit

 public static void HandleGMSurveySubmit(Packet packet)
 {
     var count = packet.ReadUInt32("Survey Question Count");
     for (var i = 0; i < count; ++i)
     {
         var gmsurveyid = packet.ReadUInt32("GM Survey Id", i);
         if (gmsurveyid == 0)
             break;
         packet.ReadByte("Question Number", i);
         packet.ReadCString("Answer", i);
     }
     packet.ReadCString("Comment");
 }
开发者ID:hodobaj,项目名称:WowPacketParser,代码行数:13,代码来源:TicketHandler.cs

示例15: HandleGMResponseReceived

        public static void HandleGMResponseReceived(Packet packet)
        {
            packet.ReadUInt32("Unk 1");

            packet.ReadUInt32("Unk 2");

            packet.ReadCString("Text");

            for (var i = 1; i <= 4; i++) // Last 3 strings are usually empty
            {
                packet.ReadCString("Response " + i);
            }
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:13,代码来源:TicketHandler.cs


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