Ejemplo n.º 1
0
 public static void HandleChatAddonMessageParty(Packet packet)
 {
     var len33 = packet.ReadBits(8);
     var len16 = packet.ReadBits(5);
     packet.ReadWoWString("Message", len33);
     packet.ReadWoWString("Prefix", len16);
 }
Ejemplo n.º 2
0
        public static void HandleBattlePetModifyName(Packet packet)
        {
            var guid = new byte[8];
            guid[5] = packet.ReadBit(); // 93
            guid[7] = packet.ReadBit(); // 95
            guid[3] = packet.ReadBit(); // 91
            guid[0] = packet.ReadBit(); // 88
            guid[6] = packet.ReadBit(); // 94
            var len = packet.ReadBits("Len", 7);
            guid[2] = packet.ReadBit(); // 90
            guid[1] = packet.ReadBit(); // 89
            var hasDeclinedNames = packet.ReadBit("hasDeclNames"); // 421
            guid[4] = packet.ReadBit(); // 92

            var declinedNamesLen = new uint[5];

            if (hasDeclinedNames)
                for ( var i = 5; i > 0; i--)
                    declinedNamesLen[i-1] = packet.ReadBits(7);

            packet.ResetBitReader();

            packet.ParseBitStream(guid, 3, 0, 6, 1, 5, 2, 4, 7);
            packet.WriteGuid("Guid", guid);

            packet.ReadWoWString("Nick", len);

            if (hasDeclinedNames)
                for (var i = 5; i > 0; i--)
                    packet.ReadWoWString("declNames", declinedNamesLen[i - 1], i);
        }
Ejemplo n.º 3
0
 public static void HandleChatAddonMessageInstanceChat(Packet packet)
 {
     var len272 = packet.ReadBits(5);
     var len16 = packet.ReadBits(8);
     packet.ReadWoWString("Message", len16);
     packet.ReadWoWString("Prefix", len272);
 }
Ejemplo n.º 4
0
 public static void HandleChannelBan(Packet packet)
 {
     var channelLength = packet.ReadBits(8);
     var nameLength = packet.ReadBits(7);
     packet.ReadWoWString("Channel", channelLength);
     packet.ReadWoWString("Player to ban", nameLength);
 }
        public static void HandleEquipmentSetList(Packet packet)
        {
            var count = packet.ReadInt32("Count");

            for (var i = 0; i < count; i++)
            {
                packet.ReadInt32("Type", i);
                packet.ReadUInt64("Guid", i);
                packet.ReadUInt32("SetID", i);
                uint ignoreMask = packet.ReadUInt32("IgnoreMask");

                for (var j = 0; j < NumSlots; j++)
                {
                    bool ignore = (ignoreMask & (1 << j)) != 0;
                    packet.ReadPackedGuid128("Pieces" + (ignore ? " (Ignored)" : ""), i, j);
                    packet.ReadInt32("Appearances", i);
                }

                for (var j = 0; j < 2; j++)
                    packet.ReadInt32("Enchants", i);

                packet.ResetBitReader();
                var setNameLen = packet.ReadBits(8);
                var setIconLen = packet.ReadBits(9);

                packet.ReadWoWString("SetName", setNameLen, i);
                packet.ReadWoWString("SetIcon", setIconLen, i);
            }
        }
Ejemplo n.º 6
0
 public static void HandleClientChatMessageAddon434(Packet packet)
 {
     var length1 = (int)packet.ReadBits(9);
     var length2 = (int)packet.ReadBits(5);
     packet.ReadWoWString("Message", length1);
     packet.ReadWoWString("Prefix", length2);
 }
Ejemplo n.º 7
0
 public static void HandleSetTimeZoneInformation(Packet packet)
 {
     var len1 = packet.ReadBits(7);
     var len2 = packet.ReadBits(7);
     packet.ReadWoWString("Server Location", len2);
     packet.ReadWoWString("Server Location", len1);
 }
Ejemplo n.º 8
0
        public static void HandleGuildQueryResponse(Packet packet)
        {
            packet.ReadPackedGuid128("Guild Guid");

            var hasData = packet.ReadBit();
            if (hasData)
            {
                packet.ReadPackedGuid128("GuildGUID");
                packet.ReadInt32("VirtualRealmAddress");
                var rankCount = packet.ReadInt32("RankCount");
                packet.ReadInt32("EmblemColor");
                packet.ReadInt32("EmblemStyle");
                packet.ReadInt32("BorderColor");
                packet.ReadInt32("BorderStyle");
                packet.ReadInt32("BackgroundColor");

                packet.ResetBitReader();
                var nameLen = packet.ReadBits(7);

                for (var i = 0; i < rankCount; i++)
                {
                    packet.ReadInt32("RankID", i);
                    packet.ReadInt32("RankOrder", i);

                    packet.ResetBitReader();
                    var rankNameLen = packet.ReadBits(7);
                    packet.ReadWoWString("Rank Name", rankNameLen, i);
                }

                packet.ReadWoWString("Guild Name", nameLen);
            }
        }
Ejemplo n.º 9
0
        public static void HandlePetNameQueryResponse(Packet packet)
        {
            var number = packet.ReadUInt64("Pet number");
            var hasData = packet.ReadBit();
            if (!hasData)
                return;

            const int maxDeclinedNameCases = 5;
            var declinedNameLen = new int[maxDeclinedNameCases];
            for (var i = 0; i < maxDeclinedNameCases; ++i)
                declinedNameLen[i] = (int)packet.ReadBits(7);

            packet.ReadBit("Declined");
            var len = packet.ReadBits(8);

            for (var i = 0; i < maxDeclinedNameCases; ++i)
                if (declinedNameLen[i] != 0)
                    packet.ReadWoWString("Declined name", declinedNameLen[i], i);

            packet.ReadTime("Time");
            var petName = packet.ReadWoWString("Pet name", len);

            var guidArray = (from pair in StoreGetters.NameDict where Equals(pair.Value, number) select pair.Key).ToList();
            foreach (var guid in guidArray)
                StoreGetters.NameDict[guid] = petName;
        }
Ejemplo n.º 10
0
        public static void HandleGroupInvite(Packet packet)
        {
            var guid = new byte[8];

            packet.ReadInt32("Unk Int32"); // Non-zero in cross realm parties (1383)
            packet.ReadInt32("Unk Int32"); // Always 0
            packet.ReadByte("unk");

            guid[2] = packet.ReadBit();
            var strLen = packet.ReadBits(9);
            guid[0] = packet.ReadBit();

            guid[3] = packet.ReadBit();
            guid[4] = packet.ReadBit();
            guid[6] = packet.ReadBit();
            guid[7] = packet.ReadBit();
            guid[5] = packet.ReadBit();
            guid[1] = packet.ReadBit();

            var nameLen = packet.ReadBits(9);

            packet.ResetBitReader();

            packet.ReadXORByte(guid, 5);
            packet.ReadWoWString("Realm Name", strLen); // Non-empty in cross realm parties
            packet.ReadWoWString("Name", nameLen);
            packet.ReadXORByte(guid, 4);
            packet.ReadXORByte(guid, 0);
            packet.ReadXORByte(guid, 3);
            packet.ReadXORByte(guid, 6);
            packet.ReadXORByte(guid, 1);
            packet.ReadXORByte(guid, 2);
            packet.ReadXORByte(guid, 7);
            packet.WriteGuid("Guid", guid); // Non-zero in cross realm parties
        }
Ejemplo n.º 11
0
        public static void HandleGroupInvite(Packet packet)
        {
            var crossRealmGuid = new byte[8];

            packet.ReadInt32("Int114");
            packet.ReadByte("Byte118");
            packet.ReadInt32("Int128");
            crossRealmGuid[7] = packet.ReadBit();
            var realmNameLen = packet.ReadBits(9);
            crossRealmGuid[3] = packet.ReadBit();
            var nameLen = packet.ReadBits(9);
            crossRealmGuid[2] = packet.ReadBit();
            crossRealmGuid[5] = packet.ReadBit();
            crossRealmGuid[4] = packet.ReadBit();
            crossRealmGuid[0] = packet.ReadBit();
            crossRealmGuid[1] = packet.ReadBit();
            crossRealmGuid[6] = packet.ReadBit();

            packet.ReadXORByte(crossRealmGuid, 7);
            packet.ReadXORByte(crossRealmGuid, 6);
            packet.ReadXORByte(crossRealmGuid, 0);
            packet.ReadXORByte(crossRealmGuid, 4);
            packet.ReadWoWString("Name", nameLen);
            packet.ReadXORByte(crossRealmGuid, 1);
            packet.ReadXORByte(crossRealmGuid, 2);
            packet.ReadXORByte(crossRealmGuid, 3);
            packet.ReadWoWString("Realm Name", realmNameLen);
            packet.ReadXORByte(crossRealmGuid, 5);

            packet.WriteGuid("crossRealmGuid", crossRealmGuid);
        }
Ejemplo n.º 12
0
        public static void HandleCalendarSendEvent(Packet packet)
        {
            packet.ReadByte("EventType");
            packet.ReadPackedGuid128("OwnerGUID");
            packet.ReadInt64("EventID");
            packet.ReadByte("GetEventType");
            packet.ReadInt32("TextureID");
            packet.ReadUInt32("Flags");
            packet.ReadUInt32("Date");
            packet.ReadUInt32("LockDate");
            packet.ReadPackedGuid128("EventGuildID");

            var inviteCount = packet.ReadInt32("InviteCount");

            packet.ResetBitReader();

            var lenEventName = packet.ReadBits(8);
            var lenDescription = packet.ReadBits(11);

            packet.ResetBitReader();

            for (int i = 0; i < inviteCount; i++)
                V6_0_2_19033.Parsers.CalendarHandler.ReadCalendarEventInviteInfo(packet, "Invites", i);

            packet.ReadWoWString("EventName", lenEventName);
            packet.ReadWoWString("Description", lenDescription);
        }
Ejemplo n.º 13
0
 public static void HandleClientChatMessageWhisper(Packet packet)
 {
     packet.ReadEnum<Language>("Language", TypeCode.Int32);
     var msgLen = packet.ReadBits(8);
     var recvName = packet.ReadBits(9);
     packet.ReadWoWString("Message", msgLen);
     packet.ReadWoWString("Receivers Name", recvName);
 }
        public static void HandleServerTimezone(Packet packet)
        {
            var Location2Lenght = packet.ReadBits(7);
            var Location1Lenght = packet.ReadBits(7);

            packet.ReadWoWString("Timezone Location1", Location1Lenght);
            packet.ReadWoWString("Timezone Location2", Location2Lenght);
        }
Ejemplo n.º 15
0
        public static void HandleChannelMisc1(Packet packet)
        {
            var lenChannelName = packet.ReadBits(7);
            var lenName = packet.ReadBits(9);

            packet.ReadWoWString("ChannelName", lenChannelName);
            packet.ReadWoWString("Name", lenName);
        }
Ejemplo n.º 16
0
 public static void HandleClientChatMessageChannel434(Packet packet)
 {
     packet.ReadEnum<Language>("Language", TypeCode.Int32);
     var channelNameLen = packet.ReadBits(9);
     var msgLen = packet.ReadBits(8);
     packet.ReadWoWString("Message", msgLen);
     packet.ReadWoWString("Channel Name", channelNameLen);
 }
Ejemplo n.º 17
0
 public static void HandleClientChatChannel(Packet packet)
 {
     packet.ReadInt32E<Language>("Language");
     var channelNameLen = packet.ReadBits(9);
     var msgLen = packet.ReadBits(8);
     packet.ReadWoWString("Message", msgLen);
     packet.ReadWoWString("Channel Name", channelNameLen);
 }
Ejemplo n.º 18
0
        public static void HandleAddonMessage(Packet packet)
        {
            var prefixLen = packet.ReadBits(5);
            var testLen = packet.ReadBits(8);

            packet.ReadWoWString("Prefix", prefixLen);
            packet.ReadWoWString("Text", testLen);
        }
Ejemplo n.º 19
0
        public static void HandleChannelInvite434(Packet packet)
        {
            var nameLen = packet.ReadBits(7);
            var channelLen = packet.ReadBits(8);

            packet.ReadWoWString("Name", nameLen);
            packet.ReadWoWString("Channel Name", channelLen);
        }
Ejemplo n.º 20
0
        public static void HandleAddFriend(Packet packet)
        {
            var bits16 = packet.ReadBits(9);
            var bits10 = packet.ReadBits(10);

            packet.ReadWoWString("Name", bits16);
            packet.ReadWoWString("Notes", bits10);
        }
Ejemplo n.º 21
0
 public static void HandleMessageChatAddonWhisper(Packet packet)
 {
     var targetLen = packet.ReadBits(9);
     var messageLen = packet.ReadBits(8);
     var prefixLen = packet.ReadBits(5);
     packet.ReadWoWString("Target Name", targetLen);
     packet.ReadWoWString("Prefix", prefixLen);
     packet.ReadWoWString("Message", messageLen);
 }
Ejemplo n.º 22
0
 public static void HandleArenaTeamCommandResult434(Packet packet)
 {
     var playerLength = packet.ReadBits(7);
     var teamLength = packet.ReadBits(8);
     packet.ReadWoWString("Player Name", playerLength);
     packet.ReadUInt32("Action");
     packet.ReadUInt32("ErrorId");
     packet.ReadWoWString("Team Name", teamLength);
 }
Ejemplo n.º 23
0
        public static void HandleEquipmentSetList(Packet packet)
        {
            var count = packet.ReadBits(19);

            var guid1 = new byte[count][][];
            var guid2 = new byte[count][];

            var bits0 = new uint[count];
            var bits4 = new uint[count];

            for (var i = 0; i < count; i++)
            {
                guid1[i] = new byte[NumSlots][];
                guid2[i] = new byte[8];

                guid2[i][7] = packet.ReadBit();

                for (var j = 0; j < NumSlots; j++)
                {
                    guid1[i][j] = new byte[8];
                    packet.StartBitStream(guid1[i][j], 6, 7, 5, 1, 0, 4, 2, 3);
                }

                guid2[i][3] = packet.ReadBit();
                guid2[i][1] = packet.ReadBit();
                guid2[i][5] = packet.ReadBit();
                guid2[i][6] = packet.ReadBit();
                bits0[i] = packet.ReadBits(8);
                bits4[i] = packet.ReadBits(9);
                guid2[i][0] = packet.ReadBit();
                guid2[i][2] = packet.ReadBit();
                guid2[i][4] = packet.ReadBit();
            }

            for (var i = 0; i < count; i++)
            {
                for (var j = 0; j < NumSlots; j++)
                {
                    packet.ParseBitStream(guid1[i][j], 7, 4, 5, 3, 0, 6, 2, 1);
                    packet.WriteGuid("Item GUID", guid1[i][j], i, j);
                }

                packet.ReadXORByte(guid2[i], 7);
                packet.ReadXORByte(guid2[i], 3);
                packet.ReadXORByte(guid2[i], 0);
                packet.ReadXORByte(guid2[i], 5);
                packet.ReadWoWString("Set Name", bits0[i], i);
                packet.ReadXORByte(guid2[i], 4);
                packet.ReadXORByte(guid2[i], 6);
                packet.ReadXORByte(guid2[i], 2);
                packet.ReadXORByte(guid2[i], 1);
                packet.ReadInt32("Index", i);
                packet.ReadWoWString("Set Icon", bits4[i], i);

                packet.WriteGuid("GUID", guid2[i], i);
            }
        }
Ejemplo n.º 24
0
        public static void HandleClientChatMessageWhisper(Packet packet)
        {
            packet.ReadInt32E<Language>("Language");
            var recvName = packet.ReadBits(9);
            var msgLen = packet.ReadBits(8);

            packet.ReadWoWString("Target", recvName);
            packet.ReadWoWString("Text", msgLen);
        }
        public static void HandleRecruitAFriend(Packet packet)
        {
            var bits16 = packet.ReadBits(7);
            var bits273 = packet.ReadBits(9);
            var bits338 = packet.ReadBits(10);

            packet.ReadWoWString("Name", bits16);
            packet.ReadWoWString("Email", bits273);
            packet.ReadWoWString("Text", bits338);
        }
Ejemplo n.º 26
0
 public static void HandleChannelJoin(Packet packet)
 {
     packet.ReadInt32("Channel Id");
     var passwordLength = packet.ReadBits(7);
     packet.ReadBit("Joined by zone update");
     var channelLength = packet.ReadBits(7);
     packet.ReadBit("Has Voice");
     packet.ReadWoWString("Channel Pass", passwordLength);
     packet.ReadWoWString("Channel Name", channelLength);
 }
        public static void HandleBugReport(Packet packet)
        {
            packet.ReadBit("Type");

            var len1 = packet.ReadBits(12);
            var len2 = packet.ReadBits(10);

            packet.ReadWoWString("DiagInfo", len1);
            packet.ReadWoWString("Text", len2);
        }
Ejemplo n.º 28
0
        public static void HandleChannelList(Packet packet)
        {
            packet.ReadUInt32("Flags");
            var password = packet.ReadBits(7);
            packet.ReadBit();
            var length = packet.ReadBits(7);
            packet.ReadBit();

            packet.ReadWoWString("Password", password);
            packet.ReadWoWString("Channel Name", length);
        }
        public static void HandleSaveClientVarables(Packet packet)
        {
            var varablesCount = packet.ReadUInt32("VarablesCount");

            for (var i = 0; i < varablesCount; ++i)
            {
                var variableNameLen = packet.ReadBits(6);
                var valueLen = packet.ReadBits(10);

                packet.WriteLine($"[{ i.ToString() }] VariableName: \"{ packet.ReadWoWString((int)variableNameLen) }\" Value: \"{ packet.ReadWoWString((int)valueLen) }\"");
            }
        }
Ejemplo n.º 30
0
        public static void HandleClientPartyInvite(Packet packet)
        {
            packet.ReadByte("PartyIndex");
            packet.ReadInt32("ProposedRoles");
            packet.ReadPackedGuid128("TargetGuid");

            packet.ResetBitReader();

            var lenTargetName = packet.ReadBits(9);
            var lenTargetRealm = packet.ReadBits(9);

            packet.ReadWoWString("TargetName", lenTargetName);
            packet.ReadWoWString("TargetRealm", lenTargetRealm);
        }