public AuctionBucketKey(WorldPacket data)
        {
            data.ResetBitPos();
            ItemID = data.ReadBits <uint>(20);

            if (data.HasBit())
            {
                BattlePetSpeciesID.HasValue = true;
            }

            ItemLevel = data.ReadBits <ushort>(11);

            if (data.HasBit())
            {
                SuffixItemNameDescriptionID.HasValue = true;
            }

            if (BattlePetSpeciesID.HasValue)
            {
                BattlePetSpeciesID.Set(data.ReadUInt16());
            }

            if (SuffixItemNameDescriptionID.HasValue)
            {
                SuffixItemNameDescriptionID.Set(data.ReadUInt16());
            }
        }
Example #2
0
        public void Read(WorldPacket data)
        {
            MinLevel    = data.ReadInt32();
            MaxLevel    = data.ReadInt32();
            RaceFilter  = data.ReadInt64();
            ClassFilter = data.ReadInt32();

            uint nameLength                  = data.ReadBits <uint>(6);
            uint virtualRealmNameLength      = data.ReadBits <uint>(9);
            uint guildNameLength             = data.ReadBits <uint>(7);
            uint guildVirtualRealmNameLength = data.ReadBits <uint>(9);
            uint wordsCount                  = data.ReadBits <uint>(3);

            ShowEnemies         = data.HasBit();
            ShowArenaPlayers    = data.HasBit();
            ExactName           = data.HasBit();
            ServerInfo.HasValue = data.HasBit();
            data.ResetBitPos();

            for (int i = 0; i < wordsCount; ++i)
            {
                Words.Add(data.ReadString(data.ReadBits <uint>(7)));
                data.ResetBitPos();
            }

            Name                  = data.ReadString(nameLength);
            VirtualRealmName      = data.ReadString(virtualRealmNameLength);
            Guild                 = data.ReadString(guildNameLength);
            GuildVirtualRealmName = data.ReadString(guildVirtualRealmNameLength);

            if (ServerInfo.HasValue)
            {
                ServerInfo.Value.Read(data);
            }
        }
Example #3
0
        public static MovementInfo ReadMovementInfo(WorldPacket data)
        {
            var movementInfo = new MovementInfo();

            movementInfo.Guid = data.ReadPackedGuid();
            movementInfo.Time = data.ReadUInt32();
            float x = data.ReadFloat();
            float y = data.ReadFloat();
            float z = data.ReadFloat();
            float o = data.ReadFloat();

            movementInfo.Pos.Relocate(x, y, z, o);
            movementInfo.Pitch           = data.ReadFloat();
            movementInfo.SplineElevation = data.ReadFloat();

            uint removeMovementForcesCount = data.ReadUInt32();

            uint moveIndex = data.ReadUInt32();

            for (uint i = 0; i < removeMovementForcesCount; ++i)
            {
                data.ReadPackedGuid();
            }

            // ResetBitReader

            movementInfo.SetMovementFlags((MovementFlag)data.ReadBits <uint>(30));
            movementInfo.SetMovementFlags2((MovementFlag2)data.ReadBits <uint>(18));

            bool hasTransport = data.HasBit();
            bool hasFall      = data.HasBit();
            bool hasSpline    = data.HasBit(); // todo 6.x read this infos

            data.ReadBit();                    // HeightChangeFailed
            data.ReadBit();                    // RemoteTimeValid

            if (hasTransport)
            {
                ReadTransportInfo(data, ref movementInfo.transport);
            }

            if (hasFall)
            {
                movementInfo.jump.fallTime = data.ReadUInt32();
                movementInfo.jump.zspeed   = data.ReadFloat();

                // ResetBitReader

                bool hasFallDirection = data.HasBit();
                if (hasFallDirection)
                {
                    movementInfo.jump.sinAngle = data.ReadFloat();
                    movementInfo.jump.cosAngle = data.ReadFloat();
                    movementInfo.jump.xyspeed  = data.ReadFloat();
                }
            }

            return(movementInfo);
        }
Example #4
0
        public void Read(WorldPacket data)
        {
            ItemID = data.ReadUInt32();

            ItemBonus.HasValue     = data.HasBit();
            Modifications.HasValue = data.HasBit();
            data.ResetBitPos();

            if (ItemBonus.HasValue)
            {
                ItemBonus.Value.Read(data);
            }

            if (Modifications.HasValue)
            {
                Modifications.Value.Read(data);
            }
        }
Example #5
0
        public void Read(WorldPacket data)
        {
            uint prefixLen = data.ReadBits <uint>(5);
            uint textLen   = data.ReadBits <uint>(8);

            IsLogged = data.HasBit();
            Type     = (ChatMsg)data.ReadInt32();
            Prefix   = data.ReadString(prefixLen);
            Text     = data.ReadString(textLen);
        }
Example #6
0
        public void Read(WorldPacket data)
        {
            data.ResetBitPos();

            uint nameLength    = data.ReadBits <uint>(10);
            uint versionLength = data.ReadBits <uint>(10);

            Loaded   = data.HasBit();
            Disabled = data.HasBit();
            if (nameLength > 1)
            {
                Name = data.ReadString(nameLength - 1);
                data.ReadUInt8(); // null terminator
            }
            if (versionLength > 1)
            {
                Version = data.ReadString(versionLength - 1);
                data.ReadUInt8(); // null terminator
            }
        }
Example #7
0
        public static void ReadTransportInfo(WorldPacket data, ref MovementInfo.TransportInfo transportInfo)
        {
            transportInfo.guid            = data.ReadPackedGuid();      // Transport Guid
            transportInfo.pos.posX        = data.ReadFloat();
            transportInfo.pos.posY        = data.ReadFloat();
            transportInfo.pos.posZ        = data.ReadFloat();
            transportInfo.pos.Orientation = data.ReadFloat();
            transportInfo.seat            = data.ReadInt8();      // VehicleSeatIndex
            transportInfo.time            = data.ReadUInt32();    // MoveTime

            bool hasPrevTime  = data.HasBit();
            bool hasVehicleId = data.HasBit();

            if (hasPrevTime)
            {
                transportInfo.prevTime = data.ReadUInt32();         // PrevMoveTime
            }
            if (hasVehicleId)
            {
                transportInfo.vehicleId = data.ReadUInt32();        // VehicleRecID
            }
        }
Example #8
0
 public void Read(WorldPacket data)
 {
     MarketID  = data.ReadUInt32();
     SellerNPC = data.ReadUInt32();
     Item.Read(data);
     Quantity         = data.ReadUInt32();
     MinBid           = data.ReadUInt64();
     MinIncrement     = data.ReadUInt64();
     CurrentBid       = data.ReadUInt64();
     SecondsRemaining = data.ReadUInt32();
     NumBids          = data.ReadUInt32();
     HighBid          = data.HasBit();
 }
Example #9
0
            public void Read(WorldPacket data)
            {
                Timestamp  = data.ReadInt32();
                AuthorGUID = data.ReadPackedGuid();

                bool hasClubID       = data.HasBit();
                bool hasChannelGUID  = data.HasBit();
                bool hasRealmAddress = data.HasBit();
                bool hasSlashCmd     = data.HasBit();
                uint textLength      = data.ReadBits <uint>(12);

                if (hasClubID)
                {
                    ClubID.HasValue = true;
                    ClubID.Value    = data.ReadUInt64();
                }

                if (hasChannelGUID)
                {
                    ChannelGUID.HasValue = true;
                    ChannelGUID.Value    = data.ReadPackedGuid();
                }

                if (hasRealmAddress)
                {
                    RealmAddress.HasValue = true;
                    RealmAddress.Value.VirtualRealmAddress = data.ReadUInt32();
                    RealmAddress.Value.field_4             = data.ReadUInt16();
                    RealmAddress.Value.field_6             = data.ReadUInt8();
                }

                if (hasSlashCmd)
                {
                    SlashCmd.HasValue = true;
                    SlashCmd.Value    = data.ReadInt32();
                }

                Text = data.ReadString(textLength);
            }
Example #10
0
        public void Read(WorldPacket data)
        {
            Guid      = data.ReadPackedGuid();
            Status    = data.ReadUInt8();
            Moderator = data.ReadUInt8();

            bool hasUnused801_1 = data.HasBit();
            bool hasUnused801_2 = data.HasBit();
            bool hasUnused801_3 = data.HasBit();

            if (hasUnused801_1)
            {
                Unused801_1.Set(data.ReadPackedGuid());
            }
            if (hasUnused801_2)
            {
                Unused801_2.Set(data.ReadUInt64());
            }
            if (hasUnused801_3)
            {
                Unused801_3.Set(data.ReadUInt64());
            }
        }
Example #11
0
            public void Read(WorldPacket data)
            {
                uint linesCount = data.ReadUInt32();

                ReportLineIndex.HasValue = data.HasBit();
                data.ResetBitPos();

                for (uint i = 0; i < linesCount; i++)
                {
                    Lines.Add(new SupportTicketChatLine(data));
                }

                if (ReportLineIndex.HasValue)
                {
                    ReportLineIndex.Value = data.ReadUInt32();
                }
            }
Example #12
0
 public AuctionSortDef(WorldPacket data)
 {
     data.ResetBitPos();
     SortOrder   = (AuctionHouseSortOrder)data.ReadBits <uint>(4);
     ReverseSort = data.HasBit();
 }