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


C# Packet.ReadInt16E方法代码示例

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


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

示例1: HandleAuthSession

        public static void HandleAuthSession(Packet packet)
        {
            var sha = new byte[20];
            packet.ReadUInt32("UInt32 1");
            packet.ReadUInt32("UInt32 2");
            packet.ReadByte("Unk Byte");
            sha[10] = packet.ReadByte();
            sha[18] = packet.ReadByte();
            sha[12] = packet.ReadByte();
            sha[5] = packet.ReadByte();
            packet.ReadInt64("Int64");
            sha[15] = packet.ReadByte();
            sha[9] = packet.ReadByte();
            sha[19] = packet.ReadByte();
            sha[4] = packet.ReadByte();
            sha[7] = packet.ReadByte();
            sha[16] = packet.ReadByte();
            sha[3] = packet.ReadByte();
            packet.ReadInt16E<ClientVersionBuild>("Client Build");
            sha[8] = packet.ReadByte();
            packet.ReadUInt32("UInt32 3");
            packet.ReadByte("Unk Byte");
            sha[17] = packet.ReadByte();
            sha[6] = packet.ReadByte();
            sha[0] = packet.ReadByte();
            sha[1] = packet.ReadByte();
            sha[11] = packet.ReadByte();
            packet.ReadUInt32("Client seed");
            sha[2] = packet.ReadByte();
            packet.ReadUInt32("UInt32 4");
            sha[14] = packet.ReadByte();
            sha[13] = packet.ReadByte();

            var addons = new Packet(packet.ReadBytes(packet.ReadInt32()), packet.Opcode, packet.Time, packet.Direction,
                packet.Number, packet.Writer, packet.FileName);
            CoreParsers.AddonHandler.ReadClientAddonsList(addons);
            addons.ClosePacket(false);

            packet.ReadBit("Unk bit");
            var size = (int)packet.ReadBits(12);
            packet.ReadBytesString("Account name", size);
            packet.AddValue("Proof SHA-1 Hash", Utilities.ByteArrayToHexString(sha));
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:43,代码来源:SessionHandler.cs

示例2: HandlePartyMemberStats

        public static void HandlePartyMemberStats(Packet packet)
        {
            var guid = new byte[8];

            packet.StartBitStream(guid, 0, 5);
            packet.ReadBit("unk1"); // Add arena opponent ?
            packet.StartBitStream(guid, 1, 4);
            packet.ReadBit("unk2");
            packet.StartBitStream(guid, 6, 2, 7, 3);

            packet.ParseBitStream(guid, 3, 2, 6, 7, 5);
            var updateFlags = packet.ReadUInt32E<GroupUpdateFlag548>("Update Flags");
            packet.ParseBitStream(guid, 1, 4, 0);

            packet.WriteGuid("Guid", guid);

            var size = packet.ReadInt32("Size");
            var data = packet.ReadBytes(size);
            var updateFlagPacket = new Packet(data, packet.Opcode, packet.Time, packet.Direction, packet.Number, packet.Writer, packet.FileName);

            if (updateFlags.HasFlag(GroupUpdateFlag548.Status)) // 0x1
                updateFlagPacket.ReadInt16E<GroupMemberStatusFlag>("Status");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Unk2)) // 0x2
            {
                for (var i = 0; i < 2; i++)
                    updateFlagPacket.ReadByte("Unk2", i);
            }

            if (updateFlags.HasFlag(GroupUpdateFlag548.CurrentHealth)) // 0x4
                updateFlagPacket.ReadUInt32("Current Health");

            if (updateFlags.HasFlag(GroupUpdateFlag548.MaxHealth)) // 0x8
                updateFlagPacket.ReadUInt32("Max Health");

            if (updateFlags.HasFlag(GroupUpdateFlag548.PowerType)) // 0x10
                updateFlagPacket.ReadByteE<PowerType>("Power type");

            if (updateFlags.HasFlag(GroupUpdateFlag548.CurrentPower)) // 0x20
                updateFlagPacket.ReadUInt16("Current Power");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Zone)) // 0x40
                updateFlagPacket.ReadUInt16<ZoneId>("Zone Id");

            if (updateFlags.HasFlag(GroupUpdateFlag548.MaxPower))// 0x80
                updateFlagPacket.ReadUInt16("Max Power");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Level))// 0x100
                updateFlagPacket.ReadUInt16("Level");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Unk200)) // 0x200
                updateFlagPacket.ReadUInt16("Unk200");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Unk400)) // 0x400
                updateFlagPacket.ReadUInt16("Unk400");

            if (updateFlags.HasFlag(GroupUpdateFlag548.Position)) // 0x800
            {
                updateFlagPacket.ReadInt16("Position X");
                updateFlagPacket.ReadInt16("Position Y");
                updateFlagPacket.ReadInt16("Position Z");
            }

            if (updateFlags.HasFlag(GroupUpdateFlag548.Auras)) // 0x1000
            {
                updateFlagPacket.ReadByte("unkByte");
                var mask = updateFlagPacket.ReadUInt64("Aura Mask");
                var count = updateFlagPacket.ReadInt32("AuraCount");

                for (var i = 0; i < count; ++i)
                {
                    if (mask == 0) // bad packet
                        break;

                    if ((mask & (1ul << i)) == 0)
                        continue;

                    updateFlagPacket.ReadUInt32<SpellId>("Spell Id", i);
                    var flags = updateFlagPacket.ReadByteE<AuraFlagMoP>("Aura Flags", i);
                    var unk = updateFlagPacket.ReadUInt32("unk", i);

                    if (flags.HasFlag(AuraFlagMoP.Scalable))
                    {
                        var cnt = updateFlagPacket.ReadByte("Scalings");
                        for (int j = 0; j < cnt; j++)
                            updateFlagPacket.ReadSingle("Scale", i, j);
                    }
                }
            }

            if (updateFlags.HasFlag(GroupUpdateFlag548.PetGuid)) // 0x2000
                updateFlagPacket.ReadGuid("Pet GUID");

            if (updateFlags.HasFlag(GroupUpdateFlag548.PetName)) // 0x4000
                updateFlagPacket.ReadCString("Pet Name");

            if (updateFlags.HasFlag(GroupUpdateFlag548.PetModelId)) // 0x8000
                updateFlagPacket.ReadInt16("Pet Modelid");

            if (updateFlags.HasFlag(GroupUpdateFlag548.PetCurrentHealth)) // 0x10000
//.........这里部分代码省略.........
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:101,代码来源:GroupHandler.cs

示例3: HandleSpellFailure

 public static void HandleSpellFailure(Packet packet)
 {
     packet.ReadPackedGuid128("CasterUnit");
     packet.ReadPackedGuid128("CastID");
     packet.ReadInt32<SpellId>("SpellID");
     packet.ReadUInt32("SpellXSpellVisualID");
     packet.ReadInt16E<SpellCastFailureReason>("Reason");
 }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:8,代码来源:SpellHandler.cs

示例4: HandlePartyMemberStats422

        public static void HandlePartyMemberStats422(Packet packet)
        {
            if (packet.Opcode == Opcodes.GetOpcode(Opcode.SMSG_PARTY_MEMBER_STATS_FULL, Direction.ServerToClient))
                packet.ReadBool("Add arena opponent");

            packet.ReadPackedGuid("GUID");
            var updateFlags = packet.ReadInt32E<GroupUpdateFlag422>("Update Flags");

            if (updateFlags.HasFlag(GroupUpdateFlag422.Status))
                packet.ReadInt16E<GroupMemberStatusFlag>("Status");

            if (updateFlags.HasFlag(GroupUpdateFlag422.CurrentHealth))
            {
                if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing))
                    packet.ReadInt32("Current Health");
                else
                    packet.ReadUInt16("Current Health");
            }

            if (updateFlags.HasFlag(GroupUpdateFlag422.MaxHealth))
            {
                if (ClientVersion.AddedInVersion(ClientType.WrathOfTheLichKing))
                    packet.ReadInt32("Max Health");
                else
                    packet.ReadUInt16("Max Health");
            }

            if (updateFlags.HasFlag(GroupUpdateFlag422.PowerType))
                packet.ReadByteE<PowerType>("Power type");

            if (updateFlags.HasFlag(GroupUpdateFlag422.CurrentPower))
                packet.ReadInt16("Current Power");

            if (updateFlags.HasFlag(GroupUpdateFlag422.MaxPower))
                packet.ReadInt16("Max Power");

            if (updateFlags.HasFlag(GroupUpdateFlag422.Level))
                packet.ReadInt16("Level");

            if (updateFlags.HasFlag(GroupUpdateFlag422.Zone))
                packet.ReadInt16<ZoneId>("Zone Id");

            if (updateFlags.HasFlag(GroupUpdateFlag422.Unk100))
                packet.ReadInt16("Unk");

            if (updateFlags.HasFlag(GroupUpdateFlag422.Position))
            {
                packet.ReadInt16("X");
                packet.ReadInt16("Y");
                packet.ReadInt16("Z");
            }

            if (updateFlags.HasFlag(GroupUpdateFlag422.Auras))
            {
                packet.ReadByte("Unk byte");
                var mask = packet.ReadUInt64("Aura mask");
                var cnt = packet.ReadUInt32("Aura count");
                for (var i = 0; i < cnt; ++i)
                {
                    if (mask == 0) // bad packet
                        break;

                    if ((mask & (1ul << i)) == 0)
                        continue;

                    packet.ReadUInt32<SpellId>("Spell Id", i);

                    var aflags = packet.ReadUInt16E<AuraFlag>("Aura Flags", i);
                    if (aflags.HasFlag(AuraFlag.Scalable))
                        for (var j = 0; j < 3; ++j)
                            packet.ReadInt32("Effect BasePoints", i, j);
                }
            }

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetGuid))
                packet.ReadUInt64("Pet GUID");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetName))
                packet.ReadCString("Pet Name");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetModelId))
                packet.ReadUInt16("Pet Model Id");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetCurrentHealth))
                packet.ReadUInt32("Pet Current Health");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetMaxHealth))
                packet.ReadUInt32("Pet Max Health");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetPowerType))
                packet.ReadByteE<PowerType>("Pet Power type");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetCurrentPower))
                packet.ReadInt16("Pet Current Power");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetMaxPower))
                packet.ReadInt16("Pet Max Power");

            if (updateFlags.HasFlag(GroupUpdateFlag422.PetAuras))
            {
//.........这里部分代码省略.........
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:101,代码来源:GroupHandler.cs

示例5: HandlePartyMemberState

        public static void HandlePartyMemberState(Packet packet)
        {
            packet.ReadBit("ForEnemy");

            for (var i = 0; i < 2; i++)
                packet.ReadByte("PartyType", i);

            packet.ReadInt16E<GroupMemberStatusFlag>("Flags");

            packet.ReadByte("PowerType");
            packet.ReadInt16("OverrideDisplayPower");
            packet.ReadInt32("CurrentHealth");
            packet.ReadInt32("MaxHealth");
            packet.ReadInt16("MaxPower");
            packet.ReadInt16("MaxPower");
            packet.ReadInt16("Level");
            packet.ReadInt16("Spec");
            packet.ReadInt16("AreaID");

            packet.ReadInt16("WmoGroupID");
            packet.ReadInt32("WmoDoodadPlacementID");

            packet.ReadInt16("PositionX");
            packet.ReadInt16("PositionY");
            packet.ReadInt16("PositionZ");

            packet.ReadInt32("VehicleSeatRecID");
            var auraCount = packet.ReadInt32("AuraCount");

            packet.ReadInt32("PhaseShiftFlags");
            var int4 = packet.ReadInt32("PhaseCount");
            packet.ReadPackedGuid128("PersonalGUID");
            for (int i = 0; i < int4; i++)
            {
                packet.ReadInt16("PhaseFlags", i);
                packet.ReadInt16("Id", i);
            }

            for (int i = 0; i < auraCount; i++)
            {
                packet.ReadInt32<SpellId>("Aura", i);
                packet.ReadByte("Flags", i);
                packet.ReadInt32("ActiveFlags", i);
                var byte3 = packet.ReadInt32("PointsCount", i);

                for (int j = 0; j < byte3; j++)
                    packet.ReadSingle("Points", i, j);
            }

            packet.ResetBitReader();

            var hasPet = packet.ReadBit("HasPet");
            if (hasPet) // Pet
            {
                packet.ReadPackedGuid128("PetGuid");
                packet.ReadInt16("PetDisplayID");
                packet.ReadInt32("PetMaxHealth");
                packet.ReadInt32("PetHealth");

                var petAuraCount = packet.ReadInt32("PetAuraCount");
                for (int i = 0; i < petAuraCount; i++)
                {
                    packet.ReadInt32<SpellId>("PetAura", i);
                    packet.ReadByte("PetFlags", i);
                    packet.ReadInt32("PetActiveFlags", i);
                    var byte3 = packet.ReadInt32("PetPointsCount", i);

                    for (int j = 0; j < byte3; j++)
                        packet.ReadSingle("PetPoints", i, j);
                }

                packet.ResetBitReader();

                var len = packet.ReadBits(8);
                packet.ReadWoWString("PetName", len);
            }

            packet.ReadPackedGuid128("MemberGuid");
        }
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:79,代码来源:GroupHandler.cs

示例6: HandlePartyMemberState

        public static void HandlePartyMemberState(Packet packet)
        {
            packet.ReadBit("ForEnemy");
            packet.ReadPackedGuid128("MemberGuid");

            for (var i = 0; i < 2; i++)
                packet.ReadByte("Unk704", i);

            packet.ReadInt16E<GroupMemberStatusFlag>("Status");

            packet.ReadByte("PowerType");
            packet.ReadInt16("Unk322");
            packet.ReadInt32("CurrentHealth");
            packet.ReadInt32("MaxHealth");
            packet.ReadInt16("CurrentPower");
            packet.ReadInt16("MaxPower");
            packet.ReadInt16("Level");
            packet.ReadInt16("Unk200000");
            packet.ReadInt16("ZoneId");

            packet.ReadInt16("Unk2000000");
            packet.ReadInt32("Unk4000000");

            packet.ReadInt16("PositionX");
            packet.ReadInt16("PositionY");
            packet.ReadInt16("PositionZ");

            packet.ReadInt32("VehicleSeat");
            var auraCount = packet.ReadInt32("AuraCount");

            packet.ReadInt32("PhaseShiftFlags");
            var int4 = packet.ReadInt32("PhaseCount");
            packet.ReadPackedGuid128("PersonalGUID");
            for (int i = 0; i < int4; i++)
            {
                packet.ReadInt16("PhaseFlags", i);
                packet.ReadInt16("Id", i);
            }

            for (int i = 0; i < auraCount; i++)
            {
                packet.ReadInt32("SpellId", i);
                packet.ReadByte("Scalings", i);
                packet.ReadInt32("EffectMask", i);
                var byte3 = packet.ReadInt32("EffectCount", i);

                for (int j = 0; j < byte3; j++)
                    packet.ReadSingle("Scale", i, j);
            }

            packet.ResetBitReader();

            var hasPet = packet.ReadBit("HasPet");
            if (hasPet) // Pet
            {
                packet.ReadPackedGuid128("PetGUID");
                packet.ReadInt16("PetModelId");
                packet.ReadInt32("PetCurrentHealth");
                packet.ReadInt32("PetMaxHealth");

                var petAuraCount = packet.ReadInt32("AuraCount");
                for (int i = 0; i < petAuraCount; i++)
                {
                    packet.ReadInt32("SpellId", i);
                    packet.ReadByte("Scalings", i);
                    packet.ReadInt32("EffectMask", i);
                    var byte3 = packet.ReadInt32("EffectCount", i);

                    for (int j = 0; j < byte3; j++)
                        packet.ReadSingle("Scale", i, j);
                }

                packet.ResetBitReader();

                var len = packet.ReadBits(8);
                packet.ReadWoWString("PetName", len);
            }
        }
开发者ID:cyberbrest,项目名称:WowPacketParser,代码行数:78,代码来源:GroupHandler.cs

示例7: HandleAuthSession

        public static void HandleAuthSession(Packet packet)
        {
            packet.ReadUInt64("DosResponse");
            packet.ReadInt16E<ClientVersionBuild>("Build");
            packet.ReadByte("BuildType");
            packet.ReadUInt32("RegionID");
            packet.ReadUInt32("BattlegroupID");
            packet.ReadUInt32("RealmID");
            packet.ReadBytes("LocalChallenge", 16);
            packet.ReadBytes("Digest", 24);
            packet.ReadBit("UseIPv6");

            var realmJoinTicketSize = packet.ReadInt32();
            packet.ReadBytes("RealmJoinTicket", realmJoinTicketSize);
        }
开发者ID:jackpoz,项目名称:WowPacketParser,代码行数:15,代码来源:AuthenticationHandler.cs

示例8: ReadAuraUpdateBlock

        private static Aura ReadAuraUpdateBlock(Packet packet, int i)
        {
            var aura = new Aura
            {
                Slot = packet.ReadByte("Slot", i)
            };

            var id = packet.ReadInt32<SpellId>("Spell ID", i);
            if (id <= 0)
                return null;
            aura.SpellId = (uint)id;

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_0_14333))
                aura.AuraFlags = packet.ReadInt16E<AuraFlag>("Flags", i);
            else
                aura.AuraFlags = packet.ReadByteE<AuraFlag>("Flags", i);

            aura.Level = packet.ReadByte("Level", i);

            aura.Charges = packet.ReadByte("Charges", i);

            aura.CasterGuid = !aura.AuraFlags.HasAnyFlag(AuraFlag.NotCaster) ? packet.ReadPackedGuid("Caster GUID", i) : new WowGuid64();

            if (aura.AuraFlags.HasAnyFlag(AuraFlag.Duration))
            {
                aura.MaxDuration = packet.ReadInt32("Max Duration", i);
                aura.Duration = packet.ReadInt32("Duration", i);
            }
            else
            {
                aura.MaxDuration = 0;
                aura.Duration = 0;
            }

            if (aura.AuraFlags.HasAnyFlag(AuraFlag.Scalable))
            {
                // This aura is scalable with level/talents
                // Here we show each effect value after scaling
                if (aura.AuraFlags.HasAnyFlag(AuraFlag.EffectIndex0))
                    packet.ReadInt32("Effect 0 Value", i);
                if (aura.AuraFlags.HasAnyFlag(AuraFlag.EffectIndex1))
                    packet.ReadInt32("Effect 1 Value", i);
                if (aura.AuraFlags.HasAnyFlag(AuraFlag.EffectIndex2))
                    packet.ReadInt32("Effect 2 Value", i);
            }

            packet.AddSniffData(StoreNameType.Spell, (int)aura.SpellId, "AURA_UPDATE");

            return aura;
        }
开发者ID:horn,项目名称:WowPacketParser,代码行数:50,代码来源:SpellHandler.cs

示例9: HandleAuthSession432

        public static void HandleAuthSession432(Packet packet)
        {
            var sha = new byte[20];
            packet.ReadInt32("Int32");
            sha[12] = packet.ReadByte();
            packet.ReadInt32("Int32");
            packet.ReadInt32("Int32");
            sha[0] = packet.ReadByte();
            sha[2] = packet.ReadByte();
            sha[18] = packet.ReadByte();
            sha[7] = packet.ReadByte();
            sha[9] = packet.ReadByte();
            sha[19] = packet.ReadByte();
            sha[17] = packet.ReadByte();
            sha[6] = packet.ReadByte();
            sha[11] = packet.ReadByte();

            packet.ReadInt16E<ClientVersionBuild>("Client Build");

            sha[15] = packet.ReadByte();

            packet.ReadInt64("Int64");
            packet.ReadByte("Unk Byte");
            packet.ReadByte("Unk Byte");
            sha[3] = packet.ReadByte();
            sha[10] = packet.ReadByte();

            packet.ReadUInt32("Client Seed");

            sha[16] = packet.ReadByte();
            sha[4] = packet.ReadByte();
            packet.ReadInt32("Int32");
            sha[14] = packet.ReadByte();
            sha[8] = packet.ReadByte();
            sha[5] = packet.ReadByte();
            sha[1] = packet.ReadByte();
            sha[13] = packet.ReadByte();

            var pkt = new Packet(packet.ReadBytes(packet.ReadInt32()), packet.Opcode, packet.Time, packet.Direction,
                packet.Number, packet.Writer, packet.FileName);
            AddonHandler.ReadClientAddonsList(pkt);
            pkt.ClosePacket(false);

            var highBits = packet.ReadByte() << 5;
            var lowBits = packet.ReadByte() >> 3;
            var size = lowBits | highBits;
            packet.AddValue("Size", size);
            packet.AddValue("Account name", Encoding.UTF8.GetString(packet.ReadBytes(size)));
            packet.AddValue("Proof SHA-1 Hash", Utilities.ByteArrayToHexString(sha));
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:50,代码来源:SessionHandler.cs

示例10: HandleAuthSession505

        public static void HandleAuthSession505(Packet packet)
        {
            var sha = new byte[20];
            packet.ReadUInt32("UInt32 2");//18
            sha[2] = packet.ReadByte();//24
            sha[15] = packet.ReadByte();//37
            sha[12] = packet.ReadByte();//34
            sha[11] = packet.ReadByte();//33
            sha[10] = packet.ReadByte();//32
            sha[9] = packet.ReadByte();//31
            packet.ReadByte("Unk Byte");//20
            packet.ReadUInt32("Client seed");//14
            sha[16] = packet.ReadByte();//38
            sha[5] = packet.ReadByte();//27
            packet.ReadInt16E<ClientVersionBuild>("Client Build");//34
            packet.ReadUInt32("UInt32 4");//16
            sha[18] = packet.ReadByte();//40
            sha[0] = packet.ReadByte();//22
            sha[13] = packet.ReadByte();//35
            sha[3] = packet.ReadByte();//25
            sha[14] = packet.ReadByte();//36
            packet.ReadByte("Unk Byte");//21
            sha[8] = packet.ReadByte();//30
            sha[7] = packet.ReadByte();//29
            packet.ReadUInt32("UInt32 3");//15
            sha[4] = packet.ReadByte();//26
            packet.ReadInt64("Int64");//12,13
            sha[17] = packet.ReadByte();//39
            sha[19] = packet.ReadByte();//41
            packet.ReadUInt32("UInt32 1");//4
            sha[6] = packet.ReadByte();//28
            sha[1] = packet.ReadByte();//23

            var addons = new Packet(packet.ReadBytes(packet.ReadInt32()), packet.Opcode, packet.Time, packet.Direction,
                packet.Number, packet.Writer, packet.FileName);
            AddonHandler.ReadClientAddonsList(addons);
            addons.ClosePacket(false);

            packet.ReadBit("Unk bit");
            var size = (int)packet.ReadBits(12);
            packet.AddValue("Account name", Encoding.UTF8.GetString(packet.ReadBytes(size)));
            packet.AddValue("Proof SHA-1 Hash", Utilities.ByteArrayToHexString(sha));
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:43,代码来源:SessionHandler.cs

示例11: HandleAuthSession430

        public static void HandleAuthSession430(Packet packet)
        {
            packet.ReadInt32("Int32");
            packet.ReadByte("Digest (1)");
            packet.ReadInt64("Int64");
            packet.ReadInt32("Int32");
            packet.ReadByte("Digest (2)");
            packet.ReadInt32("Int32");
            packet.ReadByte("Digest (3)");

            packet.ReadInt32("Int32");
            for (var i = 0; i < 7; i++)
                packet.ReadByte("Digest (4)", i);

            packet.ReadInt16E<ClientVersionBuild>("Client Build");

            for (var i = 0; i < 8; i++)
                packet.ReadByte("Digest (5)", i);

            packet.ReadByte("Unk Byte");
            packet.ReadByte("Unk Byte");

            packet.ReadUInt32("Client Seed");

            for (var i = 0; i < 2; i++)
                packet.ReadByte("Digest (6)", i);

            var pkt = new Packet(packet.ReadBytes(packet.ReadInt32()), packet.Opcode, packet.Time, packet.Direction,
                packet.Number, packet.Writer, packet.FileName);
            AddonHandler.ReadClientAddonsList(pkt);
            pkt.ClosePacket(false);

            packet.ReadByte("Mask"); // TODO: Seems to affect how the size is read
            var size = (packet.ReadByte() >> 4);
            packet.AddValue("Size", size);
            packet.AddValue("Account name", Encoding.UTF8.GetString(packet.ReadBytes(size)));
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:37,代码来源:SessionHandler.cs

示例12: HandleAuthSession422

        public static void HandleAuthSession422(Packet packet)
        {
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadInt32("Int32");
            packet.ReadInt32("Int32");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");

            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadInt16E<ClientVersionBuild>("Client Build");

            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");

            packet.ReadInt32("Int32");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");
            packet.ReadByte("Byte");

            packet.ReadInt32("Int32");
            packet.ReadByte("Byte");

            packet.ReadInt32("Int32");
            packet.ReadByte("Byte");

            packet.ReadInt32("Int32");
            packet.ReadByte("Byte");

            packet.ReadInt32("Int32");
            packet.ReadInt32("Int32");

            packet.ReadCString("Account name");
            packet.ReadInt32("Int32");

            AddonHandler.ReadClientAddonsList(packet);
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:43,代码来源:SessionHandler.cs

示例13: HandlePartyMemberStats

        public static void HandlePartyMemberStats(Packet packet)
        {
            packet.ReadBit("ForEnemy");
            packet.ReadBit("FullUpdate");
            var bit761 = packet.ReadBit("HasUnk761");
            var bit790 = packet.ReadBit("HasStatus");
            var bit763 = packet.ReadBit("HasPowerType");
            var bit322 = packet.ReadBit("HasUnk322");
            var bit28 = packet.ReadBit("HasCurrentHealth");
            var bit316 = packet.ReadBit("HasMaxHealth");
            var bit748 = packet.ReadBit("HasCurrentPower");
            var bit766 = packet.ReadBit("HasMaxPower");
            var bit752 = packet.ReadBit("HasLevel");
            var bit326 = packet.ReadBit("HasUnk326");
            var bit770 = packet.ReadBit("HasZoneId");
            var bit756 = packet.ReadBit("HasUnk756");
            var bit776 = packet.ReadBit("HasUnk776");
            var bit786 = packet.ReadBit("HasPosition");
            var bit20 = packet.ReadBit("HasVehicleSeat");
            var bit308 = packet.ReadBit("HasAuras");
            var bit736 = packet.ReadBit("HasPet");
            var bit72 = packet.ReadBit("HasPhase");

            packet.ReadPackedGuid128("MemberGuid");

            if (bit761)
            {
                // sub_5FB6A9
                for (int i = 0; i < 2; i++)
                    packet.ReadByte("Unk761", i);
            }

            if (bit790)
                packet.ReadInt16E<GroupMemberStatusFlag>("Status");

            if (bit763)
                packet.ReadByte("PowerType");

            if (bit322)
                packet.ReadInt16("Unk322");

            if (bit28)
                packet.ReadInt32("CurrentHealth");

            if (bit316)
                packet.ReadInt32("MaxHealth");

            if (bit748)
                packet.ReadInt16("CurrentPower");

            if (bit766)
                packet.ReadInt16("MaxPower");

            if (bit752)
                packet.ReadInt16("Level");

            if (bit326)
                packet.ReadInt16("Unk200000");

            if (bit770)
                packet.ReadInt16("ZoneId");

            if (bit756)
                packet.ReadInt16("Unk2000000");

            if (bit776)
                packet.ReadInt32("Unk4000000");

            if (bit786)
            {
                // sub_626D9A
                packet.ReadInt16("PositionX");
                packet.ReadInt16("PositionY");
                packet.ReadInt16("PositionZ");
            }

            if (bit20)
                packet.ReadInt32("VehicleSeat");

            if (bit308)
            {
                // sub_618493
                var count = packet.ReadInt32("AuraCount");

                for (int i = 0; i < count; i++)
                {
                    packet.ReadInt32("SpellId", i);
                    packet.ReadByte("Scalings", i);
                    packet.ReadInt32("EffectMask", i);
                    var byte3 = packet.ReadInt32("EffectCount", i);

                    for (int j = 0; j < byte3; j++)
                        packet.ReadSingle("Scale", i, j);
                }
            }

            if (bit736) // Pet
            {
                // sub_618CF4
                packet.ResetBitReader();
//.........这里部分代码省略.........
开发者ID:cyberbrest,项目名称:WowPacketParser,代码行数:101,代码来源:GroupHandler.cs

示例14: HandleAuthSession

        public static void HandleAuthSession(Packet packet)
        {
            var sha = new byte[20];
            packet.ReadUInt32("Grunt ServerId");
            packet.ReadInt16E<ClientVersionBuild>("Client Build");
            packet.ReadUInt32("Region");
            packet.ReadUInt32("Battlegroup");
            packet.ReadUInt32("RealmIndex");
            packet.ReadByte("Login Server Type");
            packet.ReadByte("Unk");
            packet.ReadUInt32("Client Seed");
            packet.ReadUInt64("DosResponse");

            for (uint i = 0; i < 20; ++i)
                sha[i] = packet.ReadByte();

            var accountNameLength = packet.ReadBits("Account Name Length", 11);
            packet.ResetBitReader();
            packet.ReadWoWString("Account Name", accountNameLength);
            packet.ReadBit("UseIPv6");

            var addonSize = packet.ReadInt32("Addons Size");

            if (addonSize > 0)
            {
                var addons = new Packet(packet.ReadBytes(addonSize), packet.Opcode, packet.Time, packet.Direction,
                packet.Number, packet.Writer, packet.FileName);
                CoreParsers.AddonHandler.ReadClientAddonsList(addons);
                addons.ClosePacket(false);
            }

            packet.AddValue("Proof SHA-1 Hash", Utilities.ByteArrayToHexString(sha));
        }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:33,代码来源:SessionHandler.cs

示例15: HandleGMMessageChat

        public static void HandleGMMessageChat(Packet packet)
        {
            var type = packet.ReadByteE<ChatMessageType>("Type");
            packet.ReadInt32E<Language>("Language");
            packet.ReadGuid("GUID 1");
            packet.ReadInt32("Constant time");
            packet.ReadInt32("GM Name Length");
            packet.ReadCString("GM Name");
            packet.ReadGuid("GUID 2");
            packet.ReadInt32("Message Length");
            packet.ReadCString("Message");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V5_1_0_16309))
                packet.ReadInt16E<ChatTag>("Chat Tag");
            else
                packet.ReadByteE<ChatTag>("Chat Tag");

            if (type == ChatMessageType.Achievement || type == ChatMessageType.GuildAchievement)
                packet.ReadInt32<AchievementId>("Achievement Id");
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:20,代码来源:ChatHandler.cs


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