diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-08-02 13:25:41 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-08-02 13:25:41 +0200 |
| commit | e59eef5432c7b70679d33f4911c88d0f7d75fd39 (patch) | |
| tree | fe9bce9c82496589facec3719b3f2943d8295e76 /src/server/game/Server/Packets | |
| parent | 7fb9168d57f378075b0f6692ea7ad822c1d8e43d (diff) | |
Core/PacketIO: Updated to 11.0.0
Diffstat (limited to 'src/server/game/Server/Packets')
51 files changed, 548 insertions, 175 deletions
diff --git a/src/server/game/Server/Packets/AreaTriggerPackets.cpp b/src/server/game/Server/Packets/AreaTriggerPackets.cpp index ae6dfddb134..c03ddb7d058 100644 --- a/src/server/game/Server/Packets/AreaTriggerPackets.cpp +++ b/src/server/game/Server/Packets/AreaTriggerPackets.cpp @@ -82,6 +82,7 @@ WorldPacket const* WorldPackets::AreaTrigger::AreaTriggerDenied::Write() WorldPacket const* WorldPackets::AreaTrigger::AreaTriggerRePath::Write() { _worldPacket << TriggerGUID; + _worldPacket << Unused_1100; _worldPacket.WriteBit(AreaTriggerSpline.has_value()); _worldPacket.WriteBit(AreaTriggerOrbit.has_value()); diff --git a/src/server/game/Server/Packets/AreaTriggerPackets.h b/src/server/game/Server/Packets/AreaTriggerPackets.h index 2af22e72d2c..1186b772b60 100644 --- a/src/server/game/Server/Packets/AreaTriggerPackets.h +++ b/src/server/game/Server/Packets/AreaTriggerPackets.h @@ -82,6 +82,7 @@ namespace WorldPackets Optional<AreaTriggerOrbitInfo> AreaTriggerOrbit; Optional<AreaTriggerMovementScriptInfo> AreaTriggerMovementScript; ObjectGuid TriggerGUID; + ObjectGuid Unused_1100; }; class AreaTriggerPlaySpellVisual final : public ServerPacket diff --git a/src/server/game/Server/Packets/AuctionHousePackets.cpp b/src/server/game/Server/Packets/AuctionHousePackets.cpp index ed6aea45f77..3ede64d39c0 100644 --- a/src/server/game/Server/Packets/AuctionHousePackets.cpp +++ b/src/server/game/Server/Packets/AuctionHousePackets.cpp @@ -99,7 +99,7 @@ ByteBuffer& operator>>(ByteBuffer& data, AuctionListFilterClass& filterClass) ByteBuffer& operator>>(ByteBuffer& data, AuctionSortDef& sortDef) { data.ResetBitPos(); - data >> Bits<4>(sortDef.SortOrder); + data >> As<uint8>(sortDef.SortOrder); data >> Bits<1>(sortDef.ReverseSort); return data; @@ -302,15 +302,15 @@ void AuctionBrowseQuery::Read() ItemClassFilters.resize(_worldPacket.ReadBits(3)); Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - if (TaintedBy) _worldPacket >> *TaintedBy; Name = _worldPacket.ReadString(nameLength); for (AuctionListFilterClass& filterClass : ItemClassFilters) _worldPacket >> filterClass; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionCancelCommoditiesPurchase::Read() @@ -351,14 +351,14 @@ void AuctionListBiddedItems::Read() AuctionIDs.resize(_worldPacket.ReadBits(7)); Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - if (TaintedBy) _worldPacket >> *TaintedBy; for (uint32& auctionID : AuctionIDs) _worldPacket >> auctionID; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionListBucketsByBucketKeys::Read() @@ -371,14 +371,14 @@ void AuctionListBucketsByBucketKeys::Read() BucketKeys.resize(_worldPacket.ReadBits(7)); Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - if (TaintedBy) _worldPacket >> *TaintedBy; for (AuctionBucketKey& bucketKey : BucketKeys) _worldPacket >> bucketKey; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionListItemsByBucketKey::Read() @@ -392,13 +392,13 @@ void AuctionListItemsByBucketKey::Read() Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - _worldPacket >> BucketKey; if (TaintedBy) _worldPacket >> *TaintedBy; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionListItemsByItemID::Read() @@ -413,11 +413,11 @@ void AuctionListItemsByItemID::Read() Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - if (TaintedBy) _worldPacket >> *TaintedBy; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionListOwnedItems::Read() @@ -430,11 +430,11 @@ void AuctionListOwnedItems::Read() Sorts.resize(_worldPacket.ReadBits(2)); - for (AuctionSortDef& sortDef : Sorts) - _worldPacket >> sortDef; - if (TaintedBy) _worldPacket >> *TaintedBy; + + for (AuctionSortDef& sortDef : Sorts) + _worldPacket >> sortDef; } void AuctionPlaceBid::Read() diff --git a/src/server/game/Server/Packets/AuthenticationPackets.cpp b/src/server/game/Server/Packets/AuthenticationPackets.cpp index 5ae68849569..4a948e6ca35 100644 --- a/src/server/game/Server/Packets/AuthenticationPackets.cpp +++ b/src/server/game/Server/Packets/AuthenticationPackets.cpp @@ -327,8 +327,8 @@ void WorldPackets::Auth::AuthContinuedSession::Read() void WorldPackets::Auth::ConnectToFailed::Read() { - _worldPacket >> As<uint32>(Serial); _worldPacket >> Con; + _worldPacket >> As<uint32>(Serial); } bool WorldPackets::Auth::EnterEncryptedMode::InitializeEncryption() diff --git a/src/server/game/Server/Packets/AzeritePackets.cpp b/src/server/game/Server/Packets/AzeritePackets.cpp index 87406b757dc..bbaf9668d01 100644 --- a/src/server/game/Server/Packets/AzeritePackets.cpp +++ b/src/server/game/Server/Packets/AzeritePackets.cpp @@ -56,10 +56,10 @@ void WorldPackets::Azerite::AzeriteEmpoweredItemViewed::Read() void WorldPackets::Azerite::AzeriteEmpoweredItemSelectPower::Read() { - _worldPacket >> Tier; - _worldPacket >> AzeritePowerID; _worldPacket >> ContainerSlot; _worldPacket >> Slot; + _worldPacket >> Tier; + _worldPacket >> AzeritePowerID; } WorldPacket const* WorldPackets::Azerite::PlayerAzeriteItemEquippedStatusChanged::Write() diff --git a/src/server/game/Server/Packets/AzeritePackets.h b/src/server/game/Server/Packets/AzeritePackets.h index 0a0204c61e7..4d76a83884e 100644 --- a/src/server/game/Server/Packets/AzeritePackets.h +++ b/src/server/game/Server/Packets/AzeritePackets.h @@ -89,7 +89,7 @@ namespace WorldPackets void Read() override; - int32 Tier = 0; + uint8 Tier = 0; int32 AzeritePowerID = 0; uint8 ContainerSlot = 0; uint8 Slot = 0; diff --git a/src/server/game/Server/Packets/BankPackets.cpp b/src/server/game/Server/Packets/BankPackets.cpp index 63f9300c31d..74f24cb7519 100644 --- a/src/server/game/Server/Packets/BankPackets.cpp +++ b/src/server/game/Server/Packets/BankPackets.cpp @@ -16,10 +16,12 @@ */ #include "BankPackets.h" +#include "DBCEnums.h" void WorldPackets::Bank::AutoBankItem::Read() { _worldPacket >> Inv + >> As<int8>(BankType) >> Bag >> Slot; } @@ -54,3 +56,9 @@ void WorldPackets::Bank::ReagentBank::Read() { _worldPacket >> Banker; } + +void WorldPackets::Bank::BankerActivate::Read() +{ + _worldPacket >> Banker; + _worldPacket >> As<int32>(InteractionType); +} diff --git a/src/server/game/Server/Packets/BankPackets.h b/src/server/game/Server/Packets/BankPackets.h index f43f672bc95..f81a1c02bfe 100644 --- a/src/server/game/Server/Packets/BankPackets.h +++ b/src/server/game/Server/Packets/BankPackets.h @@ -22,6 +22,8 @@ #include "ItemPacketsCommon.h" #include "ObjectGuid.h" +enum class PlayerInteractionType : int32; + namespace WorldPackets { namespace Bank @@ -34,6 +36,7 @@ namespace WorldPackets void Read() override; WorldPackets::Item::InvUpdate Inv; + ::BankType BankType = ::BankType::Character; uint8 Bag = 0; uint8 Slot = 0; }; @@ -95,6 +98,17 @@ namespace WorldPackets ObjectGuid Banker; }; + + class BankerActivate final : public ClientPacket + { + public: + explicit BankerActivate(WorldPacket&& packet) : ClientPacket(CMSG_BANKER_ACTIVATE, std::move(packet)) { } + + void Read() override; + + ObjectGuid Banker; + PlayerInteractionType InteractionType = { }; + }; } } #endif // BankPackets_h__ diff --git a/src/server/game/Server/Packets/CalendarPackets.cpp b/src/server/game/Server/Packets/CalendarPackets.cpp index 07cb5393c06..8d1dd199bb4 100644 --- a/src/server/game/Server/Packets/CalendarPackets.cpp +++ b/src/server/game/Server/Packets/CalendarPackets.cpp @@ -22,7 +22,7 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Calendar::CalendarSendCal data << uint64(eventInfo.EventID); data << uint8(eventInfo.EventType); data << eventInfo.Date; - data << uint32(eventInfo.Flags); + data << uint16(eventInfo.Flags); data << int32(eventInfo.TextureID); data << uint64(eventInfo.EventClubID); data << eventInfo.OwnerGuid; @@ -285,7 +285,7 @@ WorldPacket const* WorldPackets::Calendar::CalendarSendEvent::Write() _worldPacket << uint64(EventID); _worldPacket << uint8(GetEventType); _worldPacket << int32(TextureID); - _worldPacket << uint32(Flags); + _worldPacket << uint16(Flags); _worldPacket << Date; _worldPacket << LockDate; _worldPacket << uint64(EventClubID); @@ -307,7 +307,7 @@ WorldPacket const* WorldPackets::Calendar::CalendarInviteAlert::Write() { _worldPacket << uint64(EventID); _worldPacket << Date; - _worldPacket << uint32(Flags); + _worldPacket << uint16(Flags); _worldPacket << uint8(EventType); _worldPacket << int32(TextureID); _worldPacket << uint64(EventClubID); @@ -320,6 +320,7 @@ WorldPacket const* WorldPackets::Calendar::CalendarInviteAlert::Write() _worldPacket << OwnerGuid; _worldPacket << BitsSize<8>(EventName); + _worldPacket << Bits<1>(Unknown_1100); _worldPacket.FlushBits(); _worldPacket.WriteString(EventName); @@ -383,7 +384,7 @@ WorldPacket const* WorldPackets::Calendar::CalendarEventUpdatedAlert::Write() _worldPacket << OriginalDate; _worldPacket << Date; _worldPacket << LockDate; - _worldPacket << uint32(Flags); + _worldPacket << uint16(Flags); _worldPacket << uint32(TextureID); _worldPacket << uint8(EventType); diff --git a/src/server/game/Server/Packets/CalendarPackets.h b/src/server/game/Server/Packets/CalendarPackets.h index e76b4162f02..1d1ae538fac 100644 --- a/src/server/game/Server/Packets/CalendarPackets.h +++ b/src/server/game/Server/Packets/CalendarPackets.h @@ -103,7 +103,7 @@ namespace WorldPackets uint8 EventType = 0; uint32 TextureID = 0; WowTime Time; - uint32 Flags = 0; + uint16 Flags = 0; }; class CalendarUpdateEvent final : public ClientPacket @@ -185,7 +185,7 @@ namespace WorldPackets std::string EventName; uint8 EventType = 0; WowTime Date; - uint32 Flags = 0; + uint16 Flags = 0; int32 TextureID = 0; uint64 EventClubID = 0; ObjectGuid OwnerGuid; @@ -228,7 +228,7 @@ namespace WorldPackets uint64 EventID = 0; WowTime Date; WowTime LockDate; - uint32 Flags = 0; + uint16 Flags = 0; int32 TextureID = 0; uint8 GetEventType = 0; uint8 EventType = 0; @@ -249,13 +249,14 @@ namespace WorldPackets ObjectGuid InvitedByGuid; uint64 InviteID = 0; uint64 EventID = 0; - uint32 Flags = 0; + uint16 Flags = 0; WowTime Date; int32 TextureID = 0; uint8 Status = 0; uint8 EventType = 0; uint8 ModeratorStatus = 0; std::string EventName; + bool Unknown_1100 = false; }; class CalendarInvite final : public ClientPacket @@ -358,7 +359,7 @@ namespace WorldPackets uint64 EventClubID = 0; uint64 EventID = 0; WowTime Date; - uint32 Flags = 0; + uint16 Flags = 0; WowTime LockDate; WowTime OriginalDate; int32 TextureID = 0; diff --git a/src/server/game/Server/Packets/CharacterPackets.cpp b/src/server/game/Server/Packets/CharacterPackets.cpp index 5dd7ba275cf..1fd503aa176 100644 --- a/src/server/game/Server/Packets/CharacterPackets.cpp +++ b/src/server/game/Server/Packets/CharacterPackets.cpp @@ -79,7 +79,7 @@ EnumCharacters::EnumCharacters(WorldPacket&& packet) : ClientPacket(std::move(pa ASSERT(GetOpcode() == CMSG_ENUM_CHARACTERS || GetOpcode() == CMSG_ENUM_CHARACTERS_DELETED_BY_CLIENT); } -EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) +EnumCharactersResult::CharacterInfoBasic::CharacterInfoBasic(Field const* fields) { // 0 1 2 3 4 5 // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.level, " @@ -95,6 +95,7 @@ EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) // "character_declinedname.genitive" Guid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64()); + VirtualRealmAddress = GetVirtualRealmAddress(); GuildClubMemberID = ::Battlenet::Services::Clubs::CreateClubMemberId(Guid); Name = fields[1].GetString(); RaceID = fields[2].GetUInt8(); @@ -137,7 +138,6 @@ EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) Flags2 = CHAR_CUSTOMIZE_FLAG_RACE; Flags3 = 0; - Flags4 = 0; FirstLogin = (atLoginFlags & AT_LOGIN_FIRST) != 0; // show pet at selection character in character list only for non-ghost character @@ -151,7 +151,6 @@ EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) } } - BoostInProgress = false; ProfessionIds[0] = 0; ProfessionIds[1] = 0; @@ -182,80 +181,114 @@ EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) } } -ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfo::VisualItemInfo const& visualItem) +ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfoBasic::VisualItemInfo const& visualItem) { data << uint32(visualItem.DisplayID); - data << uint32(visualItem.DisplayEnchantID); - data << int32(visualItem.SecondaryItemModifiedAppearanceID); data << uint8(visualItem.InvType); + data << uint32(visualItem.DisplayEnchantID); data << uint8(visualItem.Subclass); + data << int32(visualItem.SecondaryItemModifiedAppearanceID); + data << uint32(visualItem.ItemID); return data; } -ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfo const& charInfo) +ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfoBasic const& charInfo) { - ASSERT(charInfo.MailSenders.size() == charInfo.MailSenderTypes.size()); - data << charInfo.Guid; - data << uint64(charInfo.GuildClubMemberID); + data << uint32(charInfo.VirtualRealmAddress); data << uint8(charInfo.ListPosition); data << uint8(charInfo.RaceID); - data << uint8(charInfo.ClassID); data << uint8(charInfo.SexID); + data << uint8(charInfo.ClassID); + data << int16(charInfo.SpecID); data << uint32(charInfo.Customizations.size()); data << uint8(charInfo.ExperienceLevel); - data << int32(charInfo.ZoneID); data << int32(charInfo.MapID); + data << int32(charInfo.ZoneID); data << charInfo.PreloadPos; + data << uint64(charInfo.GuildClubMemberID); data << charInfo.GuildGUID; data << uint32(charInfo.Flags); data << uint32(charInfo.Flags2); data << uint32(charInfo.Flags3); + data << uint8(charInfo.unkWod61x); + data << uint32(charInfo.PetCreatureDisplayID); data << uint32(charInfo.PetExperienceLevel); data << uint32(charInfo.PetCreatureFamilyID); - data << uint32(charInfo.ProfessionIds[0]); - data << uint32(charInfo.ProfessionIds[1]); - - for (EnumCharactersResult::CharacterInfo::VisualItemInfo const& visualItem : charInfo.VisualItems) + for (EnumCharactersResult::CharacterInfoBasic::VisualItemInfo const& visualItem : charInfo.VisualItems) data << visualItem; - data << charInfo.LastPlayedTime; - data << int16(charInfo.SpecID); data << int32(charInfo.Unknown703); + data << charInfo.LastPlayedTime; data << int32(charInfo.LastLoginVersion); - data << uint32(charInfo.Flags4); - data << uint32(charInfo.MailSenders.size()); - data << uint32(charInfo.MailSenderTypes.size()); - data << uint32(charInfo.OverrideSelectScreenFileDataID); data << charInfo.PersonalTabard; + + data << uint32(charInfo.ProfessionIds[0]); + data << uint32(charInfo.ProfessionIds[1]); + data << int32(charInfo.TimerunningSeasonID); + data << uint32(charInfo.OverrideSelectScreenFileDataID); for (ChrCustomizationChoice const& customization : charInfo.Customizations) data << customization; - if (!charInfo.MailSenderTypes.empty()) - data.append(charInfo.MailSenderTypes.data(), charInfo.MailSenderTypes.size()); - data << BitsSize<6>(charInfo.Name); data << Bits<1>(charInfo.FirstLogin); - data << Bits<1>(charInfo.BoostInProgress); - data << Bits<5>(charInfo.unkWod61x); - data << Bits<1>(charInfo.RpeResetAvailable); - data << Bits<1>(charInfo.RpeResetQuestClearAvailable); - for (std::string const& str : charInfo.MailSenders) + data.FlushBits(); + + data.WriteString(charInfo.Name); + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterRestrictionAndMailData const& restrictionsAndMails) +{ + ASSERT(restrictionsAndMails.MailSenders.size() == restrictionsAndMails.MailSenderTypes.size()); + + data << Bits<1>(restrictionsAndMails.BoostInProgress); + data << Bits<1>(restrictionsAndMails.RpeResetAvailable); + data << Bits<1>(restrictionsAndMails.RpeResetQuestClearAvailable); + data.FlushBits(); + + data << uint32(restrictionsAndMails.Flags4); + data << uint32(restrictionsAndMails.MailSenders.size()); + data << uint32(restrictionsAndMails.MailSenderTypes.size()); + + if (!restrictionsAndMails.MailSenderTypes.empty()) + data.append(restrictionsAndMails.MailSenderTypes.data(), restrictionsAndMails.MailSenderTypes.size()); + + for (std::string const& str : restrictionsAndMails.MailSenders) data << Bits<6>(str.length() + 1); data.FlushBits(); - for (std::string const& str : charInfo.MailSenders) + for (std::string const& str : restrictionsAndMails.MailSenders) if (!str.empty()) data << str; - data.WriteString(charInfo.Name); + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfo const& charInfo) +{ + data << charInfo.Basic; + data << charInfo.RestrictionsAndMails; + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::RegionwideCharacterListEntry const& charInfo) +{ + data << charInfo.Basic; + data << uint64(charInfo.Money); + data << float(charInfo.CurrentSeasonMythicPlusOverallScore); + data << int32(charInfo.CurrentSeasonBestPvpRating); + data << int8(charInfo.PvpRatingBracket); + data << int16(charInfo.PvpRatingAssociatedSpecID); return data; } @@ -289,22 +322,57 @@ ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::RaceLimitDisableI return data; } +ByteBuffer& operator<<(ByteBuffer& data, WarbandGroupMember const& warbandGroupMember) +{ + data << int32(warbandGroupMember.WarbandScenePlacementID); + data << int32(warbandGroupMember.Type); + if (warbandGroupMember.Type == 0) + data << warbandGroupMember.Guid; + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, WarbandGroup const& warbandGroup) +{ + data << uint64(warbandGroup.GroupID); + data << uint8(warbandGroup.Unknown_1100); + data << int32(warbandGroup.Flags); + data << uint32(warbandGroup.Members.size()); + + for (WarbandGroupMember const& member : warbandGroup.Members) + data << member; + + return data; +} + +EnumCharactersResult::CharacterInfo::CharacterInfo(Field const* fields) : Basic(fields) +{ +} + +EnumCharactersResult::RegionwideCharacterListEntry::RegionwideCharacterListEntry(Field const* fields) : Basic(fields) +{ +} + WorldPacket const* EnumCharactersResult::Write() { _worldPacket.reserve(9 + Characters.size() * sizeof(CharacterInfo) + RaceUnlockData.size() * sizeof(RaceUnlock)); _worldPacket << Bits<1>(Success); + _worldPacket << Bits<1>(Realmless); _worldPacket << Bits<1>(IsDeletedCharacters); _worldPacket << Bits<1>(IsNewPlayerRestrictionSkipped); _worldPacket << Bits<1>(IsNewPlayerRestricted); _worldPacket << Bits<1>(IsNewPlayer); _worldPacket << Bits<1>(IsTrialAccountRestricted); _worldPacket << OptionalInit(DisabledClassesMask); + _worldPacket << Bits<1>(DontCreateCharacterDisplays); _worldPacket << uint32(Characters.size()); + _worldPacket << uint32(RegionwideCharacters.size()); _worldPacket << int32(MaxCharacterLevel); _worldPacket << uint32(RaceUnlockData.size()); _worldPacket << uint32(UnlockedConditionalAppearances.size()); _worldPacket << uint32(RaceLimitDisables.size()); + _worldPacket << uint32(WarbandGroups.size()); if (DisabledClassesMask) _worldPacket << uint32(*DisabledClassesMask); @@ -315,9 +383,15 @@ WorldPacket const* EnumCharactersResult::Write() for (RaceLimitDisableInfo const& raceLimitDisableInfo : RaceLimitDisables) _worldPacket << raceLimitDisableInfo; + for (WarbandGroup const& warbandGroup : WarbandGroups) + _worldPacket << warbandGroup; + for (CharacterInfo const& charInfo : Characters) _worldPacket << charInfo; + for (RegionwideCharacterListEntry const& charInfo : RegionwideCharacters) + _worldPacket << charInfo; + for (RaceUnlock const& raceUnlock : RaceUnlockData) _worldPacket << raceUnlock; @@ -590,6 +664,7 @@ void AlterApperance::Read() _worldPacket >> NewSex; _worldPacket >> CustomizedRace; _worldPacket >> CustomizedChrModelID; + _worldPacket >> UnalteredVisualRaceID; for (ChrCustomizationChoice& customization : Customizations) _worldPacket >> customization; diff --git a/src/server/game/Server/Packets/CharacterPackets.h b/src/server/game/Server/Packets/CharacterPackets.h index 89d4312a6fc..e061ce3f7fa 100644 --- a/src/server/game/Server/Packets/CharacterPackets.h +++ b/src/server/game/Server/Packets/CharacterPackets.h @@ -116,10 +116,25 @@ namespace WorldPackets int32 BackgroundColor = -1; }; + struct WarbandGroupMember + { + int32 WarbandScenePlacementID = 0; + int32 Type = 0; + ObjectGuid Guid; + }; + + struct WarbandGroup + { + uint64 GroupID = 0; + uint8 Unknown_1100 = 0; + int32 Flags = 0; ///< enum WarbandGroupFlags { Collapsed = 1 } + std::vector<WarbandGroupMember> Members; + }; + class EnumCharactersResult final : public ServerPacket { public: - struct CharacterInfo + struct CharacterInfoBasic { /** * @fn void WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Field* fields); @@ -128,9 +143,10 @@ namespace WorldPackets * * @param fields Field set of CharacterDatabaseStatements::CHAR_SEL_ENUM */ - CharacterInfo(Field const* fields); + CharacterInfoBasic(Field const* fields); ObjectGuid Guid; + uint32 VirtualRealmAddress = 0; uint64 GuildClubMemberID = 0; ///< same as bgs.protocol.club.v1.MemberId.unique_id, guessed basing on SMSG_QUERY_PLAYER_NAME_RESPONSE (that one is known) std::string Name; uint8 ListPosition = 0; ///< Order of the characters in list @@ -146,7 +162,6 @@ namespace WorldPackets uint32 Flags = 0; ///< Character flag @see enum CharacterFlags uint32 Flags2 = 0; ///< Character customization flags @see enum CharacterCustomizeFlags uint32 Flags3 = 0; ///< Character flags 3 @todo research - uint32 Flags4 = 0; bool FirstLogin = false; uint8 unkWod61x = 0; Timestamp<> LastPlayedTime; @@ -160,7 +175,6 @@ namespace WorldPackets uint32 PetExperienceLevel = 0; uint32 PetCreatureFamilyID = 0; - bool BoostInProgress = false; ///< @todo int32 ProfessionIds[2] = { }; ///< @todo struct VisualItemInfo @@ -170,14 +184,41 @@ namespace WorldPackets int32 SecondaryItemModifiedAppearanceID = 0; // also -1 is some special value uint8 InvType = 0; uint8 Subclass = 0; + uint32 ItemID = 0; }; std::array<VisualItemInfo, 19> VisualItems = { }; + CustomTabardInfo PersonalTabard; + }; + + struct CharacterRestrictionAndMailData + { + bool BoostInProgress = false; ///< @todo + uint32 Flags4 = 0; std::vector<std::string> MailSenders; std::vector<uint32> MailSenderTypes; bool RpeResetAvailable = false; bool RpeResetQuestClearAvailable = false; - CustomTabardInfo PersonalTabard; + }; + + struct CharacterInfo + { + CharacterInfo(Field const* fields); + + CharacterInfoBasic Basic; + CharacterRestrictionAndMailData RestrictionsAndMails; + }; + + struct RegionwideCharacterListEntry + { + RegionwideCharacterListEntry(Field const* fields); + + CharacterInfoBasic Basic; + uint64 Money = 0; + float CurrentSeasonMythicPlusOverallScore = 0.0f; + uint32 CurrentSeasonBestPvpRating = 0; + int8 PvpRatingBracket = 0; + int16 PvpRatingAssociatedSpecID = 0; }; struct RaceUnlock @@ -212,20 +253,24 @@ namespace WorldPackets WorldPacket const* Write() override; - bool Success = false; ///< + bool Success = false; + bool Realmless = false; bool IsDeletedCharacters = false; ///< used for character undelete list bool IsNewPlayerRestrictionSkipped = false; ///< allows client to skip new player restrictions bool IsNewPlayerRestricted = false; ///< forbids using level boost and class trials bool IsNewPlayer = false; ///< forbids hero classes and allied races bool IsTrialAccountRestricted = false; + bool DontCreateCharacterDisplays = false; int32 MaxCharacterLevel = 1; Optional<uint32> DisabledClassesMask; std::vector<CharacterInfo> Characters; ///< all characters on the list - std::vector<RaceUnlock> RaceUnlockData; ///< + std::vector<RegionwideCharacterListEntry> RegionwideCharacters; + std::vector<RaceUnlock> RaceUnlockData; std::vector<UnlockedConditionalAppearance> UnlockedConditionalAppearances; std::vector<RaceLimitDisableInfo> RaceLimitDisables; + std::vector<WarbandGroup> WarbandGroups; }; class CheckCharacterNameAvailability final : public ClientPacket @@ -656,6 +701,7 @@ namespace WorldPackets Array<ChrCustomizationChoice, 250> Customizations; int32 CustomizedRace = 0; int32 CustomizedChrModelID = 0; + int32 UnalteredVisualRaceID = 0; }; class BarberShopResult final : public ServerPacket diff --git a/src/server/game/Server/Packets/CombatLogPackets.cpp b/src/server/game/Server/Packets/CombatLogPackets.cpp index 9ba99eb837e..6a7e93a32fa 100644 --- a/src/server/game/Server/Packets/CombatLogPackets.cpp +++ b/src/server/game/Server/Packets/CombatLogPackets.cpp @@ -110,7 +110,7 @@ WorldPacket const* SpellExecuteLog::Write() { *this << powerDrainTarget.Victim; *this << uint32(powerDrainTarget.Points); - *this << uint32(powerDrainTarget.PowerType); + *this << int8(powerDrainTarget.PowerType); *this << float(powerDrainTarget.Amplitude); } } diff --git a/src/server/game/Server/Packets/CombatLogPacketsCommon.cpp b/src/server/game/Server/Packets/CombatLogPacketsCommon.cpp index 11b66971073..3be80ecc4ce 100644 --- a/src/server/game/Server/Packets/CombatLogPacketsCommon.cpp +++ b/src/server/game/Server/Packets/CombatLogPacketsCommon.cpp @@ -49,13 +49,13 @@ void SpellCastLogData::Initialize(Spell const* spell) bool primaryPowerAdded = false; for (SpellPowerCost const& cost : spell->GetPowerCost()) { - PowerData.emplace_back(int32(cost.Power), unitCaster->GetPower(Powers(cost.Power)), int32(cost.Amount)); + PowerData.emplace_back(int8(cost.Power), unitCaster->GetPower(Powers(cost.Power)), int32(cost.Amount)); if (cost.Power == primaryPowerType) primaryPowerAdded = true; } if (!primaryPowerAdded) - PowerData.emplace(PowerData.begin(), int32(primaryPowerType), unitCaster->GetPower(primaryPowerType), 0); + PowerData.emplace(PowerData.begin(), int8(primaryPowerType), unitCaster->GetPower(primaryPowerType), 0); } } @@ -165,7 +165,7 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastLogData const& spellCastLogDat for (SpellLogPowerData const& powerData : spellCastLogData.PowerData) { - data << int32(powerData.PowerType); + data << int8(powerData.PowerType); data << int32(powerData.Amount); data << int32(powerData.Cost); } diff --git a/src/server/game/Server/Packets/CombatLogPacketsCommon.h b/src/server/game/Server/Packets/CombatLogPacketsCommon.h index 084d3851555..feda3b7afda 100644 --- a/src/server/game/Server/Packets/CombatLogPacketsCommon.h +++ b/src/server/game/Server/Packets/CombatLogPacketsCommon.h @@ -30,9 +30,9 @@ namespace WorldPackets { struct SpellLogPowerData { - SpellLogPowerData(int32 powerType, int32 amount, int32 cost) : PowerType(powerType), Amount(amount), Cost(cost) { } + SpellLogPowerData(int8 powerType, int32 amount, int32 cost) : PowerType(powerType), Amount(amount), Cost(cost) { } - int32 PowerType = 0; + int8 PowerType = 0; int32 Amount = 0; int32 Cost = 0; }; diff --git a/src/server/game/Server/Packets/CombatPackets.cpp b/src/server/game/Server/Packets/CombatPackets.cpp index 33dd2c9a64a..51de6ecde50 100644 --- a/src/server/game/Server/Packets/CombatPackets.cpp +++ b/src/server/game/Server/Packets/CombatPackets.cpp @@ -107,8 +107,8 @@ WorldPacket const* WorldPackets::Combat::PowerUpdate::Write() _worldPacket << uint32(Powers.size()); for (PowerUpdatePower const& power : Powers) { - _worldPacket << int32(power.Power); _worldPacket << uint8(power.PowerType); + _worldPacket << int32(power.Power); } return &_worldPacket; @@ -116,7 +116,7 @@ WorldPacket const* WorldPackets::Combat::PowerUpdate::Write() WorldPacket const* WorldPackets::Combat::InterruptPowerRegen::Write() { - _worldPacket << int32(PowerType); + _worldPacket << int8(PowerType); return &_worldPacket; } diff --git a/src/server/game/Server/Packets/CombatPackets.h b/src/server/game/Server/Packets/CombatPackets.h index 27dc7ec44ad..42424d8f18b 100644 --- a/src/server/game/Server/Packets/CombatPackets.h +++ b/src/server/game/Server/Packets/CombatPackets.h @@ -163,7 +163,7 @@ namespace WorldPackets class InterruptPowerRegen final : public ServerPacket { public: - explicit InterruptPowerRegen(Powers powerType) : ServerPacket(SMSG_INTERRUPT_POWER_REGEN, 4), PowerType(powerType) { } + explicit InterruptPowerRegen(Powers powerType) : ServerPacket(SMSG_INTERRUPT_POWER_REGEN, 1), PowerType(powerType) { } WorldPacket const* Write() override; diff --git a/src/server/game/Server/Packets/CraftingPacketsCommon.cpp b/src/server/game/Server/Packets/CraftingPacketsCommon.cpp index d5518dda79e..ee03eedbb75 100644 --- a/src/server/game/Server/Packets/CraftingPacketsCommon.cpp +++ b/src/server/game/Server/Packets/CraftingPacketsCommon.cpp @@ -44,6 +44,9 @@ ByteBuffer& operator<<(ByteBuffer& data, CraftingData const& craftingData) data << craftingData.ItemGUID; data << int32(craftingData.Quantity); data << int32(craftingData.EnchantID); + data << int32(craftingData.ConcentrationCurrencyID); + data << int32(craftingData.ConcentrationSpent); + data << int32(craftingData.IngenuityRefund); for (SpellReducedReagent const& spellReducedReagent : craftingData.ResourcesReturned) data << spellReducedReagent; @@ -52,6 +55,8 @@ ByteBuffer& operator<<(ByteBuffer& data, CraftingData const& craftingData) data << Bits<1>(craftingData.field_29); data << Bits<1>(craftingData.field_2A); data << Bits<1>(craftingData.BonusCraft); + data << Bits<1>(craftingData.HasIngenuityProc); + data << Bits<1>(craftingData.ApplyConcentration); data.FlushBits(); data << craftingData.OldItem; diff --git a/src/server/game/Server/Packets/CraftingPacketsCommon.h b/src/server/game/Server/Packets/CraftingPacketsCommon.h index 9426662d460..2182a28627b 100644 --- a/src/server/game/Server/Packets/CraftingPacketsCommon.h +++ b/src/server/game/Server/Packets/CraftingPacketsCommon.h @@ -52,6 +52,11 @@ struct CraftingData Item::ItemInstance OldItem; Item::ItemInstance NewItem; int32 EnchantID = 0; + int32 ConcentrationCurrencyID = 0; + int32 ConcentrationSpent = 0; + int32 IngenuityRefund = 0; + bool HasIngenuityProc = false; + bool ApplyConcentration = false; }; ByteBuffer& operator<<(ByteBuffer& data, SpellReducedReagent const& spellReducedReagent); diff --git a/src/server/game/Server/Packets/EquipmentSetPackets.cpp b/src/server/game/Server/Packets/EquipmentSetPackets.cpp index 7d7fa640b9a..f8423393343 100644 --- a/src/server/game/Server/Packets/EquipmentSetPackets.cpp +++ b/src/server/game/Server/Packets/EquipmentSetPackets.cpp @@ -19,9 +19,9 @@ WorldPacket const* WorldPackets::EquipmentSet::EquipmentSetID::Write() { - _worldPacket << uint64(GUID); _worldPacket << int32(Type); _worldPacket << uint32(SetID); + _worldPacket << uint64(GUID); return &_worldPacket; } @@ -119,8 +119,8 @@ void WorldPackets::EquipmentSet::UseEquipmentSet::Read() WorldPacket const* WorldPackets::EquipmentSet::UseEquipmentSetResult::Write() { + _worldPacket << int32(Reason); _worldPacket << uint64(GUID); - _worldPacket << uint8(Reason); return &_worldPacket; } diff --git a/src/server/game/Server/Packets/EquipmentSetPackets.h b/src/server/game/Server/Packets/EquipmentSetPackets.h index a36c95829e0..ed4165b4236 100644 --- a/src/server/game/Server/Packets/EquipmentSetPackets.h +++ b/src/server/game/Server/Packets/EquipmentSetPackets.h @@ -94,7 +94,7 @@ namespace WorldPackets WorldPacket const* Write() override; uint64 GUID = 0; ///< Set Identifier - uint8 Reason = 0; + int32 Reason = 0; }; } } diff --git a/src/server/game/Server/Packets/GarrisonPackets.cpp b/src/server/game/Server/Packets/GarrisonPackets.cpp index c3212ea899c..20f14eaa47e 100644 --- a/src/server/game/Server/Packets/GarrisonPackets.cpp +++ b/src/server/game/Server/Packets/GarrisonPackets.cpp @@ -41,7 +41,7 @@ ByteBuffer& operator<<(ByteBuffer& data, GarrisonPlotInfo const& plotInfo) { data << uint32(plotInfo.GarrPlotInstanceID); data << plotInfo.PlotPos; - data << uint32(plotInfo.PlotType); + data << uint8(plotInfo.PlotType); return data; } @@ -232,7 +232,7 @@ ByteBuffer& operator<<(ByteBuffer& data, GarrisonInfo const& garrison) ASSERT(garrison.Missions.size() == garrison.MissionOvermaxRewards.size()); ASSERT(garrison.Missions.size() == garrison.CanStartMission.size()); - data << int32(garrison.GarrTypeID); + data << uint8(garrison.GarrTypeID); data << int32(garrison.GarrSiteID); data << int32(garrison.GarrSiteLevelID); data << uint32(garrison.Buildings.size()); @@ -310,7 +310,7 @@ ByteBuffer& operator<<(ByteBuffer& data, GarrisonInfo const& garrison) ByteBuffer& operator<<(ByteBuffer& data, FollowerSoftCapInfo const& followerSoftCapInfo) { - data << int32(followerSoftCapInfo.GarrFollowerTypeID); + data << uint8(followerSoftCapInfo.GarrFollowerTypeID); data << uint32(followerSoftCapInfo.Count); return data; } @@ -365,7 +365,7 @@ void GarrisonPurchaseBuilding::Read() WorldPacket const* GarrisonPlaceBuildingResult::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); _worldPacket << BuildingInfo; _worldPacket.WriteBit(PlayActivationCinematic); @@ -382,7 +382,7 @@ void GarrisonCancelConstruction::Read() WorldPacket const* GarrisonBuildingRemoved::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); _worldPacket << uint32(GarrPlotInstanceID); _worldPacket << uint32(GarrBuildingID); @@ -392,7 +392,7 @@ WorldPacket const* GarrisonBuildingRemoved::Write() WorldPacket const* GarrisonLearnBlueprintResult::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); _worldPacket << uint32(BuildingID); @@ -401,7 +401,7 @@ WorldPacket const* GarrisonLearnBlueprintResult::Write() WorldPacket const* GarrisonUnlearnBlueprintResult::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); _worldPacket << uint32(BuildingID); @@ -410,7 +410,7 @@ WorldPacket const* GarrisonUnlearnBlueprintResult::Write() WorldPacket const* GarrisonRequestBlueprintAndSpecializationDataResult::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(BlueprintsKnown ? BlueprintsKnown->size() : 0); _worldPacket << uint32(SpecializationsKnown ? SpecializationsKnown->size() : 0); if (BlueprintsKnown) @@ -443,7 +443,7 @@ WorldPacket const* GarrisonMapDataResponse::Write() WorldPacket const* GarrisonPlotPlaced::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << *PlotInfo; return &_worldPacket; @@ -458,7 +458,7 @@ WorldPacket const* GarrisonPlotRemoved::Write() WorldPacket const* GarrisonAddFollowerResult::Write() { - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); _worldPacket << Follower; @@ -467,9 +467,9 @@ WorldPacket const* GarrisonAddFollowerResult::Write() WorldPacket const* GarrisonRemoveFollowerResult::Write() { - _worldPacket << uint64(FollowerDBID); - _worldPacket << int32(GarrTypeID); + _worldPacket << uint8(GarrTypeID); _worldPacket << uint32(Result); + _worldPacket << uint64(FollowerDBID); _worldPacket << uint32(Destroyed); return &_worldPacket; diff --git a/src/server/game/Server/Packets/GarrisonPackets.h b/src/server/game/Server/Packets/GarrisonPackets.h index 983982842f8..4053c784582 100644 --- a/src/server/game/Server/Packets/GarrisonPackets.h +++ b/src/server/game/Server/Packets/GarrisonPackets.h @@ -68,7 +68,7 @@ namespace WorldPackets { uint32 GarrPlotInstanceID = 0; TaggedPosition<Position::XYZO> PlotPos; - uint32 PlotType = 0; + uint8 PlotType = 0; }; struct GarrisonBuildingInfo @@ -197,7 +197,7 @@ namespace WorldPackets struct GarrisonInfo { - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; uint32 GarrSiteID = 0; uint32 GarrSiteLevelID = 0; uint32 NumFollowerActivationsRemaining = 0; @@ -221,7 +221,7 @@ namespace WorldPackets struct FollowerSoftCapInfo { - int32 GarrFollowerTypeID; + uint8 GarrFollowerTypeID; uint32 Count; }; @@ -281,7 +281,7 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; uint32 Result = 0; GarrisonBuildingInfo BuildingInfo; bool PlayActivationCinematic = false; @@ -305,7 +305,7 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; uint32 Result = 0; uint32 GarrPlotInstanceID = 0; uint32 GarrBuildingID = 0; @@ -318,7 +318,7 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; uint32 BuildingID = 0; uint32 Result = 0; }; @@ -330,9 +330,9 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; - uint32 BuildingID = 0; + uint8 GarrTypeID = 0; uint32 Result = 0; + uint32 BuildingID = 0; }; class GarrisonRequestBlueprintAndSpecializationData final : public ClientPacket @@ -350,9 +350,9 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; - std::unordered_set<uint32> const* SpecializationsKnown = nullptr; + uint8 GarrTypeID = 0; std::unordered_set<uint32> const* BlueprintsKnown = nullptr; + std::unordered_set<uint32> const* SpecializationsKnown = nullptr; }; class GarrisonGetMapData final : public ClientPacket @@ -389,7 +389,7 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; GarrisonPlotInfo* PlotInfo = nullptr; }; @@ -410,7 +410,7 @@ namespace WorldPackets WorldPacket const* Write() override; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; GarrisonFollower Follower; uint32 Result = 0; }; @@ -418,13 +418,13 @@ namespace WorldPackets class GarrisonRemoveFollowerResult final : public ServerPacket { public: - GarrisonRemoveFollowerResult() : ServerPacket(SMSG_GARRISON_REMOVE_FOLLOWER_RESULT, 8 + 4 + 4 + 4) { } + GarrisonRemoveFollowerResult() : ServerPacket(SMSG_GARRISON_REMOVE_FOLLOWER_RESULT, 1 + 4 + 8 + 4) { } WorldPacket const* Write() override; - uint64 FollowerDBID = 0; - int32 GarrTypeID = 0; + uint8 GarrTypeID = 0; uint32 Result = 0; + uint64 FollowerDBID = 0; uint32 Destroyed = 0; }; diff --git a/src/server/game/Server/Packets/GuildPackets.cpp b/src/server/game/Server/Packets/GuildPackets.cpp index 88c971c8ae7..db54693206f 100644 --- a/src/server/game/Server/Packets/GuildPackets.cpp +++ b/src/server/game/Server/Packets/GuildPackets.cpp @@ -109,6 +109,11 @@ WorldPacket const* WorldPackets::Guild::GuildCommandResult::Write() return &_worldPacket; } +void WorldPackets::Guild::AcceptGuildInvite::Read() +{ + _worldPacket >> GuildGuid; +} + void WorldPackets::Guild::DeclineGuildInvites::Read() { Allow = _worldPacket.ReadBit(); @@ -214,7 +219,6 @@ WorldPacket const* WorldPackets::Guild::GuildEventPresenceChange::Write() _worldPacket.WriteBits(Name.length(), 6); _worldPacket.WriteBit(LoggedOn); - _worldPacket.WriteBit(Mobile); _worldPacket.FlushBits(); _worldPacket.WriteString(Name); diff --git a/src/server/game/Server/Packets/GuildPackets.h b/src/server/game/Server/Packets/GuildPackets.h index 31f9c6ba62d..f78d582c83f 100644 --- a/src/server/game/Server/Packets/GuildPackets.h +++ b/src/server/game/Server/Packets/GuildPackets.h @@ -173,7 +173,9 @@ namespace WorldPackets public: AcceptGuildInvite(WorldPacket&& packet) : ClientPacket(CMSG_ACCEPT_GUILD_INVITE, std::move(packet)) { } - void Read() override { } + void Read() override; + + ObjectGuid GuildGuid; }; class GuildDeclineInvitation final : public ClientPacket @@ -250,7 +252,6 @@ namespace WorldPackets ObjectGuid Guid; uint32 VirtualRealmAddress = 0; std::string Name; - bool Mobile = false; bool LoggedOn = false; }; diff --git a/src/server/game/Server/Packets/InstancePackets.cpp b/src/server/game/Server/Packets/InstancePackets.cpp index 41e73128573..86caa86b6ee 100644 --- a/src/server/game/Server/Packets/InstancePackets.cpp +++ b/src/server/game/Server/Packets/InstancePackets.cpp @@ -108,9 +108,11 @@ WorldPacket const* WorldPackets::Instance::PendingRaidLock::Write() WorldPacket const* WorldPackets::Instance::RaidInstanceMessage::Write() { - _worldPacket << uint8(Type); + _worldPacket << int32(Type); _worldPacket << uint32(MapID); _worldPacket << uint32(DifficultyID); + _worldPacket << int32(TimeLeft); + _worldPacket << BitsSize<8>(WarningMessage); _worldPacket << Bits<1>(Locked); _worldPacket << Bits<1>(Extended); _worldPacket.FlushBits(); diff --git a/src/server/game/Server/Packets/InstancePackets.h b/src/server/game/Server/Packets/InstancePackets.h index 86f6838946f..ab980ca148f 100644 --- a/src/server/game/Server/Packets/InstancePackets.h +++ b/src/server/game/Server/Packets/InstancePackets.h @@ -157,9 +157,11 @@ namespace WorldPackets WorldPacket const* Write() override; - uint8 Type = 0; + int32 Type = 0; uint32 MapID = 0; uint32 DifficultyID = 0; + int32 TimeLeft = 0; + std::string_view WarningMessage; // GlobalStrings tag bool Locked = false; bool Extended = false; }; diff --git a/src/server/game/Server/Packets/ItemPackets.cpp b/src/server/game/Server/Packets/ItemPackets.cpp index 7dc3dc23138..5dccbe3e1c9 100644 --- a/src/server/game/Server/Packets/ItemPackets.cpp +++ b/src/server/game/Server/Packets/ItemPackets.cpp @@ -254,10 +254,11 @@ WorldPacket const* WorldPackets::Item::ItemPushResult::Write() _worldPacket << int32(QuestLogItemID); _worldPacket << int32(Quantity); _worldPacket << int32(QuantityInInventory); + _worldPacket << int32(QuantityInQuestLog); _worldPacket << int32(DungeonEncounterID); _worldPacket << int32(BattlePetSpeciesID); _worldPacket << int32(BattlePetBreedID); - _worldPacket << uint32(BattlePetBreedQuality); + _worldPacket << uint8(BattlePetBreedQuality); _worldPacket << int32(BattlePetLevel); _worldPacket << ItemGUID; _worldPacket << uint32(Toasts.size()); diff --git a/src/server/game/Server/Packets/ItemPackets.h b/src/server/game/Server/Packets/ItemPackets.h index 60287883441..e1b33cc99db 100644 --- a/src/server/game/Server/Packets/ItemPackets.h +++ b/src/server/game/Server/Packets/ItemPackets.h @@ -347,10 +347,11 @@ namespace WorldPackets // only set if different than real ID (similar to CreatureTemplate.KillCredit) int32 Quantity = 0; int32 QuantityInInventory = 0; + int32 QuantityInQuestLog = 0; int32 DungeonEncounterID = 0; int32 BattlePetSpeciesID = 0; int32 BattlePetBreedID = 0; - uint32 BattlePetBreedQuality = 0; + uint8 BattlePetBreedQuality = 0; int32 BattlePetLevel = 0; ObjectGuid ItemGUID; std::vector<UiEventToast> Toasts; @@ -488,6 +489,14 @@ namespace WorldPackets ObjectGuid Item; }; + class SortAccountBankBags final : public ClientPacket + { + public: + explicit SortAccountBankBags(WorldPacket&& packet) : ClientPacket(CMSG_SORT_ACCOUNT_BANK_BAGS, std::move(packet)) { } + + void Read() override { } + }; + class SortBags final : public ClientPacket { public: @@ -545,7 +554,7 @@ namespace WorldPackets void Read() override; - uint32 BagIndex = 0; + uint8 BagIndex = 0; BagSlotFlags FlagToChange = { }; bool On = false; }; @@ -557,7 +566,7 @@ namespace WorldPackets void Read() override; - uint32 BagIndex = 0; + uint8 BagIndex = 0; BagSlotFlags FlagToChange = { }; bool On = false; }; diff --git a/src/server/game/Server/Packets/ItemPacketsCommon.cpp b/src/server/game/Server/Packets/ItemPacketsCommon.cpp index e68a6f35dca..9fdc43bc91b 100644 --- a/src/server/game/Server/Packets/ItemPacketsCommon.cpp +++ b/src/server/game/Server/Packets/ItemPacketsCommon.cpp @@ -163,16 +163,16 @@ ByteBuffer& operator>>(ByteBuffer& data, ItemBonuses& itemBonusInstanceData) ByteBuffer& operator<<(ByteBuffer& data, ItemMod const& itemMod) { - data << int32(itemMod.Value); data << uint8(itemMod.Type); + data << int32(itemMod.Value); return data; } ByteBuffer& operator>>(ByteBuffer& data, ItemMod& itemMod) { - data >> itemMod.Value; data >> As<uint8>(itemMod.Type); + data >> itemMod.Value; return data; } diff --git a/src/server/game/Server/Packets/MovementPackets.cpp b/src/server/game/Server/Packets/MovementPackets.cpp index 895c12fb704..242a0c0594b 100644 --- a/src/server/game/Server/Packets/MovementPackets.cpp +++ b/src/server/game/Server/Packets/MovementPackets.cpp @@ -691,6 +691,7 @@ WorldPacket const* WorldPackets::Movement::NewWorld::Write() _worldPacket << Loc; _worldPacket << uint32(Reason); _worldPacket << MovementOffset; + _worldPacket << int32(Counter); return &_worldPacket; } diff --git a/src/server/game/Server/Packets/MovementPackets.h b/src/server/game/Server/Packets/MovementPackets.h index 77cc00d71c7..ed05e244c19 100644 --- a/src/server/game/Server/Packets/MovementPackets.h +++ b/src/server/game/Server/Packets/MovementPackets.h @@ -283,6 +283,7 @@ namespace WorldPackets uint32 Reason = 0; TeleportLocation Loc; TaggedPosition<Position::XYZ> MovementOffset; // Adjusts all pending movement events by this offset + int32 Counter = 0; }; class WorldPortResponse final : public ClientPacket diff --git a/src/server/game/Server/Packets/NPCPackets.cpp b/src/server/game/Server/Packets/NPCPackets.cpp index 4a81fef3f0b..7ba4257f4f1 100644 --- a/src/server/game/Server/Packets/NPCPackets.cpp +++ b/src/server/game/Server/Packets/NPCPackets.cpp @@ -51,6 +51,7 @@ ByteBuffer& operator<<(ByteBuffer& data, ClientGossipOptions const& gossipOption data << Bits<2>(gossipOption.Status); data << OptionalInit(gossipOption.SpellID); data << OptionalInit(gossipOption.OverrideIconID); + data << Bits<8>(gossipOption.FailureDescription.length() + 1); data.FlushBits(); data << gossipOption.Treasure; @@ -64,6 +65,9 @@ ByteBuffer& operator<<(ByteBuffer& data, ClientGossipOptions const& gossipOption if (gossipOption.OverrideIconID) data << int32(*gossipOption.OverrideIconID); + if (!gossipOption.FailureDescription.empty()) + data << gossipOption.FailureDescription; + return data; } @@ -74,9 +78,12 @@ ByteBuffer& operator<<(ByteBuffer& data, ClientGossipText const& gossipText) data << int32(gossipText.QuestType); data << int32(gossipText.QuestFlags[0]); data << int32(gossipText.QuestFlags[1]); + data << int32(gossipText.QuestFlags[2]); data << Bits<1>(gossipText.Repeatable); + data << Bits<1>(gossipText.ResetByScheduler); data << Bits<1>(gossipText.Important); + data << Bits<1>(gossipText.Meta); data << BitsSize<9>(gossipText.QuestTitle); data.FlushBits(); @@ -104,6 +111,7 @@ WorldPacket const* GossipMessage::Write() { _worldPacket << GossipGUID; _worldPacket << int32(GossipID); + _worldPacket << int32(LfgDungeonsID); _worldPacket << int32(FriendshipFactionID); _worldPacket << uint32(GossipOptions.size()); _worldPacket << uint32(GossipText.size()); diff --git a/src/server/game/Server/Packets/NPCPackets.h b/src/server/game/Server/Packets/NPCPackets.h index 79b2bd45625..41b96bfc763 100644 --- a/src/server/game/Server/Packets/NPCPackets.h +++ b/src/server/game/Server/Packets/NPCPackets.h @@ -34,7 +34,6 @@ namespace WorldPackets { namespace NPC { - // CMSG_BANKER_ACTIVATE // CMSG_BINDER_ACTIVATE // CMSG_BINDER_CONFIRM // CMSG_GOSSIP_HELLO @@ -90,6 +89,7 @@ namespace WorldPackets TreasureLootList Treasure; Optional<int32> SpellID; Optional<int32> OverrideIconID; + std::string FailureDescription; }; struct ClientGossipText @@ -98,9 +98,11 @@ namespace WorldPackets int32 ContentTuningID = 0; int32 QuestType = 0; bool Repeatable = false; + bool ResetByScheduler = false; bool Important = false; + bool Meta = false; std::string QuestTitle; - std::array<int32, 2> QuestFlags = { }; + std::array<int32, 3> QuestFlags = { }; }; ByteBuffer& operator<<(ByteBuffer& data, ClientGossipText const& gossipText); @@ -119,6 +121,7 @@ namespace WorldPackets Optional<int32> TextID; // in classic variants this still holds npc_text id Optional<int32> BroadcastTextID; int32 GossipID = 0; + int32 LfgDungeonsID = 0; }; class GossipSelectOption final : public ClientPacket diff --git a/src/server/game/Server/Packets/PartyPackets.cpp b/src/server/game/Server/Packets/PartyPackets.cpp index fc8365dd507..5b7e79a164b 100644 --- a/src/server/game/Server/Packets/PartyPackets.cpp +++ b/src/server/game/Server/Packets/PartyPackets.cpp @@ -508,6 +508,7 @@ WorldPacket const* WorldPackets::Party::PartyUpdate::Write() _worldPacket << uint32(SequenceNum); _worldPacket << LeaderGUID; _worldPacket << uint8(LeaderFactionGroup); + _worldPacket << int32(PingRestriction); _worldPacket << uint32(PlayerList.size()); _worldPacket.WriteBit(LfgInfos.has_value()); _worldPacket.WriteBit(LootSettings.has_value()); @@ -736,7 +737,7 @@ WorldPacket const* WorldPackets::Party::BroadcastSummonResponse::Write() void WorldPackets::Party::SetRestrictPingsToAssistants::Read() { _worldPacket >> OptionalInit(PartyIndex); - _worldPacket >> Bits<1>(RestrictPingsToAssistants); + _worldPacket >> As<int32>(RestrictTo); if (PartyIndex) _worldPacket >> PartyIndex.emplace(); } @@ -764,8 +765,9 @@ void WorldPackets::Party::SendPingWorldPoint::Read() _worldPacket >> SenderGUID; _worldPacket >> MapID; _worldPacket >> Point; - _worldPacket >> As<uint8>(Type); + _worldPacket >> As<int32>(Type); _worldPacket >> PinFrameID; + _worldPacket >> Transport; } WorldPacket const* WorldPackets::Party::ReceivePingWorldPoint::Write() @@ -775,6 +777,7 @@ WorldPacket const* WorldPackets::Party::ReceivePingWorldPoint::Write() _worldPacket << Point; _worldPacket << uint8(Type); _worldPacket << PinFrameID; + _worldPacket << Transport; return &_worldPacket; } diff --git a/src/server/game/Server/Packets/PartyPackets.h b/src/server/game/Server/Packets/PartyPackets.h index a865f1f1e7c..1adaa3d33dd 100644 --- a/src/server/game/Server/Packets/PartyPackets.h +++ b/src/server/game/Server/Packets/PartyPackets.h @@ -561,6 +561,8 @@ namespace WorldPackets int32 MyIndex = 0; int32 SequenceNum = 0; + RestrictPingsTo PingRestriction = RestrictPingsTo::None; + std::vector<PartyPlayerInfo> PlayerList; Optional<PartyLFGInfo> LfgInfos; @@ -674,7 +676,7 @@ namespace WorldPackets void Read() override; Optional<uint8> PartyIndex; - bool RestrictPingsToAssistants = false; + RestrictPingsTo RestrictTo = RestrictPingsTo::None; }; class SendPingUnit final : public ClientPacket @@ -715,6 +717,7 @@ namespace WorldPackets TaggedPosition<Position::XYZ> Point; PingSubjectType Type = PingSubjectType::Max; uint32 PinFrameID = 0; + ObjectGuid Transport; }; class ReceivePingWorldPoint final : public ServerPacket @@ -729,6 +732,7 @@ namespace WorldPackets TaggedPosition<Position::XYZ> Point; PingSubjectType Type = PingSubjectType::Max; uint32 PinFrameID = 0; + ObjectGuid Transport; }; class CancelPingPin final : public ServerPacket diff --git a/src/server/game/Server/Packets/QueryPackets.cpp b/src/server/game/Server/Packets/QueryPackets.cpp index 72bde99ff5d..3e1f6aefd51 100644 --- a/src/server/game/Server/Packets/QueryPackets.cpp +++ b/src/server/game/Server/Packets/QueryPackets.cpp @@ -374,9 +374,9 @@ WorldPacket const* CorpseLocation::Write() _worldPacket << Player; _worldPacket << ActualMapID; - _worldPacket << Position; _worldPacket << MapID; _worldPacket << Transport; + _worldPacket << Position; return &_worldPacket; } diff --git a/src/server/game/Server/Packets/QuestPackets.cpp b/src/server/game/Server/Packets/QuestPackets.cpp index 1d8dc537de5..d1f31ccc7a7 100644 --- a/src/server/game/Server/Packets/QuestPackets.cpp +++ b/src/server/game/Server/Packets/QuestPackets.cpp @@ -182,7 +182,7 @@ WorldPacket const* QueryQuestInfoResponse::Write() _worldPacket << uint32(Info.Objectives.size()); _worldPacket << uint64(Info.AllowableRaces.RawValue); - _worldPacket << int32(Info.TreasurePickerID); + _worldPacket << uint32(Info.TreasurePickerID.size()); _worldPacket << int32(Info.Expansion); _worldPacket << int32(Info.ManagedWorldStateID); _worldPacket << int32(Info.QuestSessionBonus); @@ -194,6 +194,9 @@ WorldPacket const* QueryQuestInfoResponse::Write() for (QuestCompleteDisplaySpell const& rewardDisplaySpell : Info.RewardDisplaySpell) _worldPacket << rewardDisplaySpell; + if (!Info.TreasurePickerID.empty()) + _worldPacket.append(Info.TreasurePickerID.data(), Info.TreasurePickerID.size()); + _worldPacket << BitsSize<9>(Info.LogTitle); _worldPacket << BitsSize<12>(Info.LogDescription); _worldPacket << BitsSize<12>(Info.QuestDescription); @@ -204,12 +207,13 @@ WorldPacket const* QueryQuestInfoResponse::Write() _worldPacket << BitsSize<8>(Info.PortraitTurnInName); _worldPacket << BitsSize<11>(Info.QuestCompletionLog); _worldPacket << Bits<1>(Info.ReadyForTranslation); + _worldPacket << Bits<1>(Info.ResetByScheduler); _worldPacket.FlushBits(); for (QuestObjective const& questObjective : Info.Objectives) { _worldPacket << uint32(questObjective.ID); - _worldPacket << uint8(questObjective.Type); + _worldPacket << int32(questObjective.Type); _worldPacket << int8(questObjective.StorageIndex); _worldPacket << int32(questObjective.ObjectID); _worldPacket << int32(questObjective.Amount); @@ -276,11 +280,26 @@ WorldPacket const* QuestUpdateAddPvPCredit::Write() return &_worldPacket; } +ByteBuffer& operator<<(ByteBuffer& data, QuestRewardItem const& questRewardItem) +{ + data << int32(questRewardItem.ItemID); + data << int32(questRewardItem.ItemQty); + data << OptionalInit(questRewardItem.ContextFlags); + data.FlushBits(); + if (questRewardItem.ContextFlags) + data << As<int32>(*questRewardItem.ContextFlags); + + return data; +} + ByteBuffer& operator<<(ByteBuffer& data, QuestChoiceItem const& questChoiceItem) { data << Bits<2>(questChoiceItem.LootItemType); + data << OptionalInit(questChoiceItem.ContextFlags); data << questChoiceItem.Item; data << int32(questChoiceItem.Quantity); + if (questChoiceItem.ContextFlags) + data << As<int32>(*questChoiceItem.ContextFlags); return data; } @@ -289,23 +308,35 @@ ByteBuffer& operator>>(ByteBuffer& data, QuestChoiceItem& questChoiceItem) { data.ResetBitPos(); data >> Bits<2>(questChoiceItem.LootItemType); + data >> OptionalInit(questChoiceItem.ContextFlags); data >> questChoiceItem.Item; data >> questChoiceItem.Quantity; + if (questChoiceItem.ContextFlags) + data >> As<int32>(*questChoiceItem.ContextFlags); + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, QuestRewardCurrency const& questRewardCurrency) +{ + data << int32(questRewardCurrency.CurrencyID); + data << int32(questRewardCurrency.CurrencyQty); + data << int32(questRewardCurrency.BonusQty); + data << OptionalInit(questRewardCurrency.ContextFlags); + data.FlushBits(); + if (questRewardCurrency.ContextFlags) + data << As<int32>(*questRewardCurrency.ContextFlags); return data; } ByteBuffer& operator<<(ByteBuffer& data, QuestRewards const& questRewards) { + for (QuestRewardItem const& item : questRewards.Items) + data << item; + data << int32(questRewards.ChoiceItemCount); data << int32(questRewards.ItemCount); - - for (uint32 i = 0; i < QUEST_REWARD_ITEM_COUNT; ++i) - { - data << int32(questRewards.ItemID[i]); - data << int32(questRewards.ItemQty[i]); - } - data << int32(questRewards.Money); data << int32(questRewards.XP); data << int64(questRewards.ArtifactXP); @@ -326,22 +357,21 @@ ByteBuffer& operator<<(ByteBuffer& data, QuestRewards const& questRewards) data << int32(questRewards.SpellCompletionID); - for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) - { - data << int32(questRewards.CurrencyID[i]); - data << int32(questRewards.CurrencyQty[i]); - } - data << int32(questRewards.SkillLineID); data << int32(questRewards.NumSkillUps); - data << int32(questRewards.TreasurePickerID); + data << uint32(questRewards.TreasurePickerID.size()); + if (!questRewards.TreasurePickerID.empty()) + data.append(questRewards.TreasurePickerID.data(), questRewards.TreasurePickerID.size()); - for (QuestChoiceItem const& choiceItem : questRewards.ChoiceItems) - data << choiceItem; + for (QuestRewardCurrency const& currency : questRewards.Currencies) + data << currency; data << Bits<1>(questRewards.IsBoostSpell); data.FlushBits(); + for (QuestChoiceItem const& choiceItem : questRewards.ChoiceItems) + data << choiceItem; + return data; } @@ -354,6 +384,7 @@ ByteBuffer& operator<<(ByteBuffer& data, QuestGiverOfferReward const& offer) data << int32(offer.QuestFlags[1]); // FlagsEx data << int32(offer.QuestFlags[2]); // FlagsEx2 data << int32(offer.SuggestedPartyMembers); + data << int32(offer.QuestInfoID); data << int32(offer.Emotes.size()); for (QuestDescEmote const& emote : offer.Emotes) { @@ -456,6 +487,7 @@ WorldPacket const* QuestGiverQuestDetails::Write() _worldPacket << uint32(DescEmotes.size()); _worldPacket << uint32(Objectives.size()); _worldPacket << int32(QuestStartItemID); + _worldPacket << int32(QuestInfoID); _worldPacket << int32(QuestSessionBonus); _worldPacket << int32(QuestGiverCreatureID); _worldPacket << uint32(ConditionalDescriptionText.size()); @@ -472,9 +504,9 @@ WorldPacket const* QuestGiverQuestDetails::Write() for (QuestObjectiveSimple const& obj : Objectives) { _worldPacket << int32(obj.ID); + _worldPacket << int32(obj.Type); _worldPacket << int32(obj.ObjectID); _worldPacket << int32(obj.Amount); - _worldPacket << uint8(obj.Type); } _worldPacket << BitsSize<9>(QuestTitle); @@ -521,6 +553,7 @@ WorldPacket const* QuestGiverRequestItems::Write() _worldPacket << int32(Collect.size()); _worldPacket << int32(Currency.size()); _worldPacket << int32(StatusFlags); + _worldPacket << int32(QuestInfoID); for (QuestObjectiveCollect const& obj : Collect) { diff --git a/src/server/game/Server/Packets/QuestPackets.h b/src/server/game/Server/Packets/QuestPackets.h index a6c89c0cd69..f119eac4e31 100644 --- a/src/server/game/Server/Packets/QuestPackets.h +++ b/src/server/game/Server/Packets/QuestPackets.h @@ -185,7 +185,7 @@ namespace WorldPackets int32 CompleteSoundKitID = 0; int32 AreaGroupID = 0; int64 TimeAllowed = 0; - int32 TreasurePickerID = 0; + std::span<int32 const> TreasurePickerID; int32 Expansion = 0; int32 ManagedWorldStateID = 0; int32 QuestSessionBonus = 0; @@ -205,6 +205,7 @@ namespace WorldPackets int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT] = { }; int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = { }; bool ReadyForTranslation = false; + bool ResetByScheduler = false; }; class QueryQuestInfoResponse final : public ServerPacket @@ -257,11 +258,27 @@ namespace WorldPackets uint16 Count = 0; }; + struct QuestRewardItem + { + int32 ItemID = 0; + int32 ItemQty = 0; + Optional<QuestRewardContextFlags> ContextFlags; + }; + struct QuestChoiceItem { ::LootItemType LootItemType = ::LootItemType::Item; Item::ItemInstance Item; int32 Quantity = 0; + Optional<QuestRewardContextFlags> ContextFlags; + }; + + struct QuestRewardCurrency + { + int32 CurrencyID = 0; + int32 CurrencyQty = 0; + int32 BonusQty = 0; + Optional<QuestRewardContextFlags> ContextFlags; }; struct QuestRewards @@ -279,16 +296,14 @@ namespace WorldPackets int32 SpellCompletionID = 0; int32 SkillLineID = 0; int32 NumSkillUps = 0; - int32 TreasurePickerID = 0; + std::span<int32 const> TreasurePickerID; std::array<QuestChoiceItem, QUEST_REWARD_CHOICES_COUNT> ChoiceItems = { }; - std::array<int32, QUEST_REWARD_ITEM_COUNT> ItemID = { }; - std::array<int32, QUEST_REWARD_ITEM_COUNT> ItemQty = { }; + std::array<QuestRewardItem, QUEST_REWARD_ITEM_COUNT> Items = { }; std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionID = { }; std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionValue = { }; std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionOverride = { }; std::array<int32, QUEST_REWARD_REPUTATIONS_COUNT> FactionCapIn = { }; - std::array<int32, QUEST_REWARD_CURRENCY_COUNT> CurrencyID = { }; - std::array<int32, QUEST_REWARD_CURRENCY_COUNT> CurrencyQty = { }; + std::array<QuestRewardCurrency, QUEST_REWARD_CURRENCY_COUNT> Currencies = { }; bool IsBoostSpell = false; }; @@ -309,6 +324,7 @@ namespace WorldPackets QuestRewards Rewards; std::vector<QuestDescEmote> Emotes; std::array<int32, 3> QuestFlags = { }; + int32 QuestInfoID = 0; }; class QuestGiverOfferRewardMessage final : public ServerPacket @@ -390,9 +406,9 @@ namespace WorldPackets struct QuestObjectiveSimple { int32 ID = 0; + int32 Type = 0; int32 ObjectID = 0; int32 Amount = 0; - uint8 Type = 0; }; class QuestGiverQuestDetails final : public ServerPacket @@ -417,6 +433,7 @@ namespace WorldPackets int32 PortraitGiverMount = 0; int32 PortraitGiverModelSceneID = 0; int32 QuestStartItemID = 0; + int32 QuestInfoID = 0; int32 QuestSessionBonus = 0; int32 QuestGiverCreatureID = 0; std::string PortraitGiverText; @@ -466,6 +483,7 @@ namespace WorldPackets std::vector<QuestObjectiveCollect> Collect; std::vector<QuestCurrency> Currency; int32 StatusFlags = 0; + int32 QuestInfoID = 0; uint32 QuestFlags[3] = { }; std::string QuestTitle; std::string CompletionText; diff --git a/src/server/game/Server/Packets/ReputationPackets.cpp b/src/server/game/Server/Packets/ReputationPackets.cpp index aff39c3bbde..fece28f80b7 100644 --- a/src/server/game/Server/Packets/ReputationPackets.cpp +++ b/src/server/game/Server/Packets/ReputationPackets.cpp @@ -18,18 +18,37 @@ #include "ReputationPackets.h" #include "PacketUtilities.h" +namespace WorldPackets::Reputation +{ +ByteBuffer& operator<<(ByteBuffer& data, FactionData const& factionData) +{ + data << int32(factionData.FactionID); + data << uint16(factionData.Flags); + data << int32(factionData.Standing); + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, FactionBonusData const& factionBonusData) +{ + data << int32(factionBonusData.FactionID); + data << Bits<1>(factionBonusData.FactionHasBonus); + data.FlushBits(); + + return data; +} +} + WorldPacket const* WorldPackets::Reputation::InitializeFactions::Write() { - for (uint16 i = 0; i < FactionCount; ++i) - { - _worldPacket << uint16(FactionFlags[i]); - _worldPacket << int32(FactionStandings[i]); - } + _worldPacket << uint32(Factions.size()); + _worldPacket << uint32(Bonuses.size()); - for (uint16 i = 0; i < FactionCount; ++i) - _worldPacket.WriteBit(FactionHasBonus[i]); + for (FactionData const& faction : Factions) + _worldPacket << faction; - _worldPacket.FlushBits(); + for (FactionBonusData const& bonus : Bonuses) + _worldPacket << bonus; return &_worldPacket; } diff --git a/src/server/game/Server/Packets/ReputationPackets.h b/src/server/game/Server/Packets/ReputationPackets.h index c38c4235914..98b0146e9b4 100644 --- a/src/server/game/Server/Packets/ReputationPackets.h +++ b/src/server/game/Server/Packets/ReputationPackets.h @@ -25,18 +25,28 @@ namespace WorldPackets { namespace Reputation { - static constexpr uint16 FactionCount = 1000; + struct FactionData + { + int32 FactionID = 0; + uint16 Flags = 0; + int32 Standing = 0; + }; + + struct FactionBonusData + { + int32 FactionID = 0; + bool FactionHasBonus = false; + }; class InitializeFactions final : public ServerPacket { public: - InitializeFactions() : ServerPacket(SMSG_INITIALIZE_FACTIONS, FactionCount * (4 + 2) + FactionCount / 8) { } + InitializeFactions() : ServerPacket(SMSG_INITIALIZE_FACTIONS, 0x1000) { } WorldPacket const* Write() override; - std::array<int32, FactionCount> FactionStandings = { }; - std::array<bool, FactionCount> FactionHasBonus = { }; ///< @todo: implement faction bonus - std::array<uint16, FactionCount> FactionFlags = { }; ///< @see enum FactionFlags + std::vector<FactionData> Factions; + std::vector<FactionBonusData> Bonuses; }; class RequestForcedReactions final : public ClientPacket diff --git a/src/server/game/Server/Packets/ScenePackets.cpp b/src/server/game/Server/Packets/ScenePackets.cpp index 98ead11342e..bab779d2fb0 100644 --- a/src/server/game/Server/Packets/ScenePackets.cpp +++ b/src/server/game/Server/Packets/ScenePackets.cpp @@ -26,6 +26,7 @@ WorldPacket const* WorldPackets::Scenes::PlayScene::Write() _worldPacket << int32(SceneScriptPackageID); _worldPacket << TransportGUID; _worldPacket << Location; + _worldPacket << int32(MovieID); _worldPacket << Bits<1>(Encrypted); _worldPacket.FlushBits(); diff --git a/src/server/game/Server/Packets/ScenePackets.h b/src/server/game/Server/Packets/ScenePackets.h index af33a9e68ab..f5c091d6803 100644 --- a/src/server/game/Server/Packets/ScenePackets.h +++ b/src/server/game/Server/Packets/ScenePackets.h @@ -37,6 +37,7 @@ namespace WorldPackets uint32 PlaybackFlags = 0; uint32 SceneInstanceID = 0; int32 SceneScriptPackageID = 0; + int32 MovieID = 0; ObjectGuid TransportGUID; TaggedPosition<Position::XYZO> Location; bool Encrypted = false; diff --git a/src/server/game/Server/Packets/SocialPackets.cpp b/src/server/game/Server/Packets/SocialPackets.cpp index 7e7d7e188e5..839a9ea91f0 100644 --- a/src/server/game/Server/Packets/SocialPackets.cpp +++ b/src/server/game/Server/Packets/SocialPackets.cpp @@ -50,7 +50,6 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Social::ContactInfo const data << uint32(contact.Level); data << uint32(contact.ClassID); data.WriteBits(contact.Notes.length(), 10); - data.WriteBit(contact.Mobile); data.FlushBits(); data.WriteString(contact.Notes); @@ -93,7 +92,6 @@ WorldPacket const* WorldPackets::Social::FriendStatus::Write() _worldPacket << uint32(Level); _worldPacket << uint32(ClassID); _worldPacket.WriteBits(Notes.length(), 10); - _worldPacket.WriteBit(Mobile); _worldPacket.FlushBits(); _worldPacket.WriteString(Notes); diff --git a/src/server/game/Server/Packets/SocialPackets.h b/src/server/game/Server/Packets/SocialPackets.h index 3007cb3800b..9ee43e163b1 100644 --- a/src/server/game/Server/Packets/SocialPackets.h +++ b/src/server/game/Server/Packets/SocialPackets.h @@ -53,7 +53,6 @@ namespace WorldPackets uint32 AreaID = 0; uint32 Level = 0; uint32 ClassID = CLASS_NONE; - bool Mobile = false; }; class ContactList final : public ServerPacket @@ -85,7 +84,6 @@ namespace WorldPackets uint32 Level = 0; uint32 AreaID = 0; uint8 FriendResult = 0; ///< @see enum FriendsResult - bool Mobile = false; }; struct QualifiedGUID diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp index e4a06ff214f..486ac112d34 100644 --- a/src/server/game/Server/Packets/SpellPackets.cpp +++ b/src/server/game/Server/Packets/SpellPackets.cpp @@ -225,6 +225,7 @@ ByteBuffer& operator>>(ByteBuffer& buffer, SpellCastRequest& request) request.OptionalCurrencies.resize(buffer.read<uint32>()); request.OptionalReagents.resize(buffer.read<uint32>()); request.RemovedModifications.resize(buffer.read<uint32>()); + buffer >> request.CraftingFlags; for (SpellExtraCurrencyCost& optionalCurrency : request.OptionalCurrencies) buffer >> optionalCurrency; @@ -339,8 +340,8 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellHitStatus const& spellHitStatus) ByteBuffer& operator<<(ByteBuffer& data, SpellPowerData const& spellPowerData) { - data << int32(spellPowerData.Cost); data << int8(spellPowerData.Type); + data << int32(spellPowerData.Cost); return data; } @@ -750,6 +751,7 @@ WorldPacket const* PlayOrphanSpellVisual::Write() _worldPacket << SourceRotation; _worldPacket << TargetLocation; _worldPacket << Target; + _worldPacket << TargetTransport; _worldPacket << int32(SpellVisualID); _worldPacket << float(TravelSpeed); _worldPacket << float(LaunchDelay); diff --git a/src/server/game/Server/Packets/SpellPackets.h b/src/server/game/Server/Packets/SpellPackets.h index 42c58e35772..c5efa757a5a 100644 --- a/src/server/game/Server/Packets/SpellPackets.h +++ b/src/server/game/Server/Packets/SpellPackets.h @@ -251,6 +251,7 @@ namespace WorldPackets Array<SpellCraftingReagent, 6> RemovedModifications; Array<SpellExtraCurrencyCost, 5 /*MAX_ITEM_EXT_COST_CURRENCIES*/> OptionalCurrencies; Optional<uint64> CraftingOrderID; + uint8 CraftingFlags = 0; // 1 = ApplyConcentration ObjectGuid CraftingNPC; int32 Misc[2] = { }; }; @@ -713,6 +714,7 @@ namespace WorldPackets WorldPacket const* Write() override; ObjectGuid Target; // Exclusive with TargetLocation + ObjectGuid TargetTransport; TaggedPosition<Position::XYZ> SourceLocation; int32 SpellVisualID = 0; bool SpeedAsTime = false; diff --git a/src/server/game/Server/Packets/SystemPackets.cpp b/src/server/game/Server/Packets/SystemPackets.cpp index 3e0bee090bb..c14bc777465 100644 --- a/src/server/game/Server/Packets/SystemPackets.cpp +++ b/src/server/game/Server/Packets/SystemPackets.cpp @@ -82,6 +82,8 @@ WorldPacket const* FeatureSystemStatus::Write() _worldPacket << int32(ActiveSeason); _worldPacket << uint32(GameRuleValues.size()); + _worldPacket << int32(ActiveTimerunningSeasonID); + _worldPacket << int32(RemainingTimerunningSeasonSeconds); _worldPacket << int16(MaxPlayerNameQueriesPerPacket); _worldPacket << int16(PlayerNameQueryTelemetryInterval); @@ -134,19 +136,25 @@ WorldPacket const* FeatureSystemStatus::Write() _worldPacket << Bits<1>(ChatDisabledByPlayer); _worldPacket << Bits<1>(LFGListCustomRequiresAuthenticator); _worldPacket << Bits<1>(AddonsDisabled); + _worldPacket << Bits<1>(TimerunningEnabled); _worldPacket << Bits<1>(WarGamesEnabled); _worldPacket << Bits<1>(ContentTrackingEnabled); _worldPacket << Bits<1>(IsSellAllJunkEnabled); - _worldPacket << Bits<1>(IsGroupFinderEnabled); + _worldPacket << Bits<1>(IsGroupFinderEnabled); _worldPacket << Bits<1>(IsLFDEnabled); _worldPacket << Bits<1>(IsLFREnabled); _worldPacket << Bits<1>(IsPremadeGroupEnabled); _worldPacket << Bits<1>(CanShowSetRoleButton); _worldPacket << Bits<1>(false); // unused 10.2.7 - _worldPacket << Bits<1>(false); // unused 10.2.7 + _worldPacket << Bits<1>(GuildEventsEditsEnabled); + _worldPacket << Bits<1>(GuildTradeSkillsEnabled); _worldPacket << BitsSize<7>(Unknown1027); + _worldPacket << Bits<1>(BNSendWhisperUseV2Services); + + _worldPacket << Bits<1>(BNSendGameDataUseV2Services); + _worldPacket << Bits<1>(IsAccountCurrencyTransferEnabled); _worldPacket.FlushBits(); @@ -213,10 +221,11 @@ WorldPacket const* FeatureSystemStatusGlueScreen::Write() _worldPacket << Bits<1>(IsBoostEnabled); _worldPacket << Bits<1>(TrialBoostEnabled); _worldPacket << Bits<1>(TokenBalanceEnabled); + _worldPacket << Bits<1>(PaidCharacterTransfersBetweenBnetAccountsEnabled); _worldPacket << Bits<1>(LiveRegionCharacterListEnabled); _worldPacket << Bits<1>(LiveRegionCharacterCopyEnabled); - _worldPacket << Bits<1>(LiveRegionAccountCopyEnabled); + _worldPacket << Bits<1>(LiveRegionAccountCopyEnabled); _worldPacket << Bits<1>(LiveRegionKeyBindingsCopyEnabled); _worldPacket << Bits<1>(Unknown901CheckoutRelated); _worldPacket << Bits<1>(false); // unused, 10.0.2 @@ -224,14 +233,19 @@ WorldPacket const* FeatureSystemStatusGlueScreen::Write() _worldPacket << Bits<1>(IsNameReservationEnabled); _worldPacket << OptionalInit(LaunchETA); _worldPacket << Bits<1>(TimerunningEnabled); - _worldPacket << Bits<1>(AddonsDisabled); + _worldPacket << Bits<1>(AddonsDisabled); _worldPacket << Bits<1>(Unused1000); _worldPacket << Bits<1>(AccountSaveDataExportEnabled); _worldPacket << Bits<1>(AccountLockedByExport); _worldPacket << Bits<11>(RealmHiddenAlert.length() + 1); + _worldPacket << Bits<1>(BNSendWhisperUseV2Services); + + _worldPacket << Bits<1>(BNSendGameDataUseV2Services); + _worldPacket << Bits<1>(CharacterSelectListModeRealmless); + _worldPacket.FlushBits(); if (EuropaTicketSystemStatus) diff --git a/src/server/game/Server/Packets/SystemPackets.h b/src/server/game/Server/Packets/SystemPackets.h index 4a326f33206..8c1ff5f18e5 100644 --- a/src/server/game/Server/Packets/SystemPackets.h +++ b/src/server/game/Server/Packets/SystemPackets.h @@ -165,6 +165,7 @@ namespace WorldPackets bool ChatDisabledByPlayer = false; bool LFGListCustomRequiresAuthenticator = false; bool AddonsDisabled = false; + bool TimerunningEnabled = false; bool WarGamesEnabled = false; // classic only bool ContentTrackingEnabled = false; bool IsSellAllJunkEnabled = false; @@ -173,11 +174,18 @@ namespace WorldPackets bool IsLFREnabled = true; // classic only bool IsPremadeGroupEnabled = true; // classic only bool CanShowSetRoleButton = true; + bool GuildEventsEditsEnabled = true; + bool GuildTradeSkillsEnabled = true; + bool BNSendWhisperUseV2Services = true; ///< BNSendWhisper will send to v2.WhisperService instead of v1.NotificationService + bool BNSendGameDataUseV2Services = true; ///< BNSendGameData will send to v2.NotificationService instead of v1.NotificationService + bool IsAccountCurrencyTransferEnabled = false; SocialQueueConfig QuickJoinConfig; SquelchInfo Squelch; RafSystemFeatureInfo RAFSystem; std::vector<GameRuleValuePair> GameRuleValues; + int32 ActiveTimerunningSeasonID = 0; + int32 RemainingTimerunningSeasonSeconds = 0; std::string Unknown1027; // related to movement lua functions used by keybinds AddonChatThrottleParams AddonChatThrottle; }; @@ -208,6 +216,7 @@ namespace WorldPackets bool IsBoostEnabled = false; // classic only bool TrialBoostEnabled = false; // NYI bool TokenBalanceEnabled = false; // NYI + bool PaidCharacterTransfersBetweenBnetAccountsEnabled = false; bool LiveRegionCharacterListEnabled = false; // NYI bool LiveRegionCharacterCopyEnabled = false; // NYI bool LiveRegionAccountCopyEnabled = false; // NYI @@ -219,6 +228,9 @@ namespace WorldPackets bool Unused1000 = false; bool AccountSaveDataExportEnabled = false; bool AccountLockedByExport = false; + bool BNSendWhisperUseV2Services = true; ///< BNSendWhisper will send to v2.WhisperService instead of v1.NotificationService + bool BNSendGameDataUseV2Services = true; ///< BNSendGameData will send to v2.NotificationService instead of v1.NotificationService + bool CharacterSelectListModeRealmless = false; Optional<EuropaTicketConfig> EuropaTicketSystemStatus; std::vector<int32> LiveRegionCharacterCopySourceRegions; uint32 TokenPollTimeSeconds = 0; // NYI diff --git a/src/server/game/Server/Packets/TraitPacketsCommon.cpp b/src/server/game/Server/Packets/TraitPacketsCommon.cpp index aa8d6ca5e6f..0d3158ef4b9 100644 --- a/src/server/game/Server/Packets/TraitPacketsCommon.cpp +++ b/src/server/game/Server/Packets/TraitPacketsCommon.cpp @@ -31,6 +31,16 @@ TraitEntry::TraitEntry(UF::TraitEntry const& ufEntry) GrantedRanks = ufEntry.GrantedRanks; } +TraitSubTreeCache::TraitSubTreeCache() = default; + +TraitSubTreeCache::TraitSubTreeCache(UF::TraitSubTreeCache const& ufSubTreeCache) +{ + TraitSubTreeID = ufSubTreeCache.TraitSubTreeID; + for (UF::TraitEntry const& ufEntry : ufSubTreeCache.Entries) + Entries.emplace_back(ufEntry); + Active = ufSubTreeCache.Active; +} + TraitConfig::TraitConfig() = default; TraitConfig::TraitConfig(UF::TraitConfig const& ufConfig) @@ -67,6 +77,35 @@ ByteBuffer& operator<<(ByteBuffer& data, TraitEntry const& traitEntry) return data; } +ByteBuffer& operator>>(ByteBuffer& data, TraitSubTreeCache& traitSubTreeCache) +{ + data >> traitSubTreeCache.TraitSubTreeID; + uint32 entriesSize = data.read<uint32>(); + if (entriesSize > 100) + throw PacketArrayMaxCapacityException(entriesSize, 100); + + for (TraitEntry& traitEntry : traitSubTreeCache.Entries) + data >> traitEntry; + + data >> Bits<1>(traitSubTreeCache.Active); + + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, TraitSubTreeCache const& traitSubTreeCache) +{ + data << int32(traitSubTreeCache.TraitSubTreeID); + data << uint32(traitSubTreeCache.Entries.size()); + + for (TraitEntry const& traitEntry : traitSubTreeCache.Entries) + data << traitEntry; + + data << Bits<1>(traitSubTreeCache.Active); + data.FlushBits(); + + return data; +} + ByteBuffer& operator>>(ByteBuffer& data, TraitConfig& traitConfig) { data >> traitConfig.ID; @@ -76,6 +115,13 @@ ByteBuffer& operator>>(ByteBuffer& data, TraitConfig& traitConfig) throw PacketArrayMaxCapacityException(entriesSize, 100); traitConfig.Entries.resize(entriesSize); + + uint32 subtreesSize = data.read<uint32>(); + if (subtreesSize > 10) + throw PacketArrayMaxCapacityException(subtreesSize, 10); + + traitConfig.SubTrees.resize(subtreesSize); + switch (traitConfig.Type) { case TraitConfigType::Combat: @@ -97,6 +143,10 @@ ByteBuffer& operator>>(ByteBuffer& data, TraitConfig& traitConfig) data >> traitEntry; uint32 nameLength = data.ReadBits(9); + + for (TraitSubTreeCache& traitSubTreeCache : traitConfig.SubTrees) + data >> traitSubTreeCache; + traitConfig.Name = data.ReadString(nameLength, false); return data; @@ -107,6 +157,7 @@ ByteBuffer& operator<<(ByteBuffer& data, TraitConfig const& traitConfig) data << int32(traitConfig.ID); data << int32(traitConfig.Type); data << uint32(traitConfig.Entries.size()); + data << uint32(traitConfig.SubTrees.size()); switch (traitConfig.Type) { case TraitConfigType::Combat: @@ -128,6 +179,10 @@ ByteBuffer& operator<<(ByteBuffer& data, TraitConfig const& traitConfig) data << traitEntry; data.WriteBits(traitConfig.Name.length(), 9); + + for (TraitSubTreeCache const& traitSubTreeCache : traitConfig.SubTrees) + data << traitSubTreeCache; + data.FlushBits(); data.WriteString(static_cast<std::string const&>(traitConfig.Name)); diff --git a/src/server/game/Server/Packets/TraitPacketsCommon.h b/src/server/game/Server/Packets/TraitPacketsCommon.h index b6d143e7baf..8cf075bc7a8 100644 --- a/src/server/game/Server/Packets/TraitPacketsCommon.h +++ b/src/server/game/Server/Packets/TraitPacketsCommon.h @@ -27,6 +27,7 @@ namespace UF { struct TraitConfig; struct TraitEntry; +struct TraitSubTreeCache; } namespace WorldPackets::Traits @@ -42,6 +43,16 @@ struct TraitEntry int32 GrantedRanks = 0; }; +struct TraitSubTreeCache +{ + TraitSubTreeCache(); + explicit TraitSubTreeCache(UF::TraitSubTreeCache const& ufSubTreeCache); + + int32 TraitSubTreeID = 0; + std::vector<TraitEntry> Entries; + bool Active = false; +}; + struct TraitConfig { TraitConfig(); @@ -55,11 +66,14 @@ struct TraitConfig int32 SkillLineID = 0; int32 TraitSystemID = 0; std::vector<TraitEntry> Entries; + std::vector<TraitSubTreeCache> SubTrees; String<259> Name; }; ByteBuffer& operator>>(ByteBuffer& data, TraitEntry& traitEntry); ByteBuffer& operator<<(ByteBuffer& data, TraitEntry const& traitEntry); +ByteBuffer& operator>>(ByteBuffer& data, TraitSubTreeCache& traitSubTreeCache); +ByteBuffer& operator<<(ByteBuffer& data, TraitSubTreeCache const& traitSubTreeCache); ByteBuffer& operator>>(ByteBuffer& data, TraitConfig& traitConfig); ByteBuffer& operator<<(ByteBuffer& data, TraitConfig const& traitConfig); } |
