aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server/Packets
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-09-07 01:10:07 +0200
committerShauren <shauren.trinity@gmail.com>2023-09-07 01:10:07 +0200
commit8efeb202a500bda46283127f66fb85f6b91f9e76 (patch)
treec6c12b633d144d26927f615af4d3d64b07e62dcc /src/server/game/Server/Packets
parent0bf5cf33c7dd909202ef492b69e317652e923f96 (diff)
Core: Update to 10.1.7
Diffstat (limited to 'src/server/game/Server/Packets')
-rw-r--r--src/server/game/Server/Packets/ItemPackets.cpp8
-rw-r--r--src/server/game/Server/Packets/ItemPackets.h4
-rw-r--r--src/server/game/Server/Packets/LFGPackets.cpp21
-rw-r--r--src/server/game/Server/Packets/LFGPackets.h22
-rw-r--r--src/server/game/Server/Packets/MiscPackets.cpp4
-rw-r--r--src/server/game/Server/Packets/MiscPackets.h2
-rw-r--r--src/server/game/Server/Packets/PartyPackets.cpp106
-rw-r--r--src/server/game/Server/Packets/PartyPackets.h52
-rw-r--r--src/server/game/Server/Packets/SpellPackets.cpp28
-rw-r--r--src/server/game/Server/Packets/SpellPackets.h10
-rw-r--r--src/server/game/Server/Packets/SystemPackets.cpp7
-rw-r--r--src/server/game/Server/Packets/SystemPackets.h1
12 files changed, 146 insertions, 119 deletions
diff --git a/src/server/game/Server/Packets/ItemPackets.cpp b/src/server/game/Server/Packets/ItemPackets.cpp
index b85bee2752d..16dabff8f30 100644
--- a/src/server/game/Server/Packets/ItemPackets.cpp
+++ b/src/server/game/Server/Packets/ItemPackets.cpp
@@ -152,7 +152,7 @@ WorldPacket const* WorldPackets::Item::SetProficiency::Write()
WorldPacket const* WorldPackets::Item::InventoryChangeFailure::Write()
{
- _worldPacket << int8(BagResult);
+ _worldPacket << int32(BagResult);
_worldPacket << Item[0];
_worldPacket << Item[1];
_worldPacket << uint8(ContainerBSlot); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_WRONG_BAG_TYPE_2
@@ -238,8 +238,10 @@ void WorldPackets::Item::DestroyItem::Read()
WorldPacket const* WorldPackets::Item::SellResponse::Write()
{
_worldPacket << VendorGUID;
- _worldPacket << ItemGUID;
- _worldPacket << uint8(Reason);
+ _worldPacket << uint32(ItemGUIDs.size());
+ _worldPacket << int32(Reason);
+ for (ObjectGuid const& itemGuid : ItemGUIDs)
+ _worldPacket << itemGuid;
return &_worldPacket;
}
diff --git a/src/server/game/Server/Packets/ItemPackets.h b/src/server/game/Server/Packets/ItemPackets.h
index 702ed6c8adf..d2cb9df3944 100644
--- a/src/server/game/Server/Packets/ItemPackets.h
+++ b/src/server/game/Server/Packets/ItemPackets.h
@@ -212,7 +212,7 @@ namespace WorldPackets
WorldPacket const* Write() override;
- int8 BagResult = EQUIP_ERR_OK; /// @see enum InventoryResult
+ int32 BagResult = EQUIP_ERR_OK; /// @see enum InventoryResult
uint8 ContainerBSlot = 0;
ObjectGuid SrcContainer;
ObjectGuid DstContainer;
@@ -320,7 +320,7 @@ namespace WorldPackets
WorldPacket const* Write() override;
ObjectGuid VendorGUID;
- ObjectGuid ItemGUID;
+ std::vector<ObjectGuid> ItemGUIDs;
SellResult Reason = SELL_ERR_UNK;
};
diff --git a/src/server/game/Server/Packets/LFGPackets.cpp b/src/server/game/Server/Packets/LFGPackets.cpp
index 8e966cd4c99..0e933141dcf 100644
--- a/src/server/game/Server/Packets/LFGPackets.cpp
+++ b/src/server/game/Server/Packets/LFGPackets.cpp
@@ -20,10 +20,12 @@
void WorldPackets::LFG::DFJoin::Read()
{
QueueAsGroup = _worldPacket.ReadBit();
+ bool hasPartyIndex = _worldPacket.ReadBit();
Unknown = _worldPacket.ReadBit();
- _worldPacket >> PartyIndex;
_worldPacket >> Roles;
Slots.resize(_worldPacket.read<uint32>());
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
for (uint32& slot : Slots)
_worldPacket >> slot;
}
@@ -43,8 +45,10 @@ void WorldPackets::LFG::DFProposalResponse::Read()
void WorldPackets::LFG::DFSetRoles::Read()
{
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> RolesDesired;
- _worldPacket >> PartyIndex;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::LFG::DFBootPlayerVote::Read()
@@ -60,7 +64,8 @@ void WorldPackets::LFG::DFTeleport::Read()
void WorldPackets::LFG::DFGetSystemInfo::Read()
{
Player = _worldPacket.ReadBit();
- _worldPacket >> PartyIndex;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGBlackListSlot const& lfgBlackListSlot)
@@ -105,7 +110,7 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerQuestReward
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerQuestReward const& playerQuestReward)
{
- data << uint32(playerQuestReward.Mask);
+ data << uint8(playerQuestReward.Mask);
data << int32(playerQuestReward.RewardMoney);
data << int32(playerQuestReward.RewardXP);
data << uint32(playerQuestReward.Item.size());
@@ -196,7 +201,7 @@ WorldPacket const* WorldPackets::LFG::LFGUpdateStatus::Write()
_worldPacket << uint8(SubType);
_worldPacket << uint8(Reason);
_worldPacket << uint32(Slots.size());
- _worldPacket << uint32(RequestedRoles);
+ _worldPacket << uint8(RequestedRoles);
_worldPacket << uint32(SuspendedPlayers.size());
_worldPacket << uint32(QueueMapID);
@@ -220,7 +225,7 @@ WorldPacket const* WorldPackets::LFG::LFGUpdateStatus::Write()
WorldPacket const* WorldPackets::LFG::RoleChosen::Write()
{
_worldPacket << Player;
- _worldPacket << uint32(RoleMask);
+ _worldPacket << uint8(RoleMask);
_worldPacket.WriteBit(Accepted);
_worldPacket.FlushBits();
@@ -230,7 +235,7 @@ WorldPacket const* WorldPackets::LFG::RoleChosen::Write()
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGRoleCheckUpdateMember const& lfgRoleCheckUpdateMember)
{
data << lfgRoleCheckUpdateMember.Guid;
- data << uint32(lfgRoleCheckUpdateMember.RolesDesired);
+ data << uint8(lfgRoleCheckUpdateMember.RolesDesired);
data << uint8(lfgRoleCheckUpdateMember.Level);
data.WriteBit(lfgRoleCheckUpdateMember.RoleCheckComplete);
data.FlushBits();
@@ -356,7 +361,7 @@ WorldPacket const* WorldPackets::LFG::LfgBootPlayer::Write()
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGProposalUpdatePlayer const& lfgProposalUpdatePlayer)
{
- data << uint32(lfgProposalUpdatePlayer.Roles);
+ data << uint8(lfgProposalUpdatePlayer.Roles);
data.WriteBit(lfgProposalUpdatePlayer.Me);
data.WriteBit(lfgProposalUpdatePlayer.SameParty);
data.WriteBit(lfgProposalUpdatePlayer.MyParty);
diff --git a/src/server/game/Server/Packets/LFGPackets.h b/src/server/game/Server/Packets/LFGPackets.h
index 133daa6a2bc..80f1f689c28 100644
--- a/src/server/game/Server/Packets/LFGPackets.h
+++ b/src/server/game/Server/Packets/LFGPackets.h
@@ -42,8 +42,8 @@ namespace WorldPackets
bool QueueAsGroup = false;
bool Unknown = false; // Always false in 7.2.5
- uint8 PartyIndex = 0;
- uint32 Roles = 0;
+ Optional<uint8> PartyIndex;
+ uint8 Roles = 0;
Array<uint32, 50> Slots;
};
@@ -77,8 +77,8 @@ namespace WorldPackets
void Read() override;
- uint32 RolesDesired = 0;
- uint8 PartyIndex = 0;
+ uint8 RolesDesired = 0;
+ Optional<uint8> PartyIndex;
};
class DFBootPlayerVote final : public ClientPacket
@@ -108,7 +108,7 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
bool Player = false;
};
@@ -159,7 +159,7 @@ namespace WorldPackets
struct LfgPlayerQuestReward
{
- uint32 Mask = 0; // Roles required for this reward, only used by ShortageReward in SMSG_LFG_PLAYER_INFO
+ uint8 Mask = 0; // Roles required for this reward, only used by ShortageReward in SMSG_LFG_PLAYER_INFO
int32 RewardMoney = 0; // Only used by SMSG_LFG_PLAYER_INFO
int32 RewardXP = 0;
std::vector<LfgPlayerQuestRewardItem> Item;
@@ -226,7 +226,7 @@ namespace WorldPackets
uint8 SubType = 0;
uint8 Reason = 0;
std::vector<uint32> Slots;
- uint32 RequestedRoles = 0;
+ uint8 RequestedRoles = 0;
std::vector<ObjectGuid> SuspendedPlayers;
uint32 QueueMapID = 0;
bool NotifyUI = false;
@@ -245,18 +245,18 @@ namespace WorldPackets
WorldPacket const* Write() override;
ObjectGuid Player;
- uint32 RoleMask = 0;
+ uint8 RoleMask = 0;
bool Accepted = false;
};
struct LFGRoleCheckUpdateMember
{
LFGRoleCheckUpdateMember() = default;
- LFGRoleCheckUpdateMember(ObjectGuid guid, uint32 rolesDesired, uint8 level, bool roleCheckComplete)
+ LFGRoleCheckUpdateMember(ObjectGuid guid, uint8 rolesDesired, uint8 level, bool roleCheckComplete)
: Guid(guid), RolesDesired(rolesDesired), Level(level), RoleCheckComplete(roleCheckComplete) { }
ObjectGuid Guid;
- uint32 RolesDesired = 0;
+ uint8 RolesDesired = 0;
uint8 Level = 0;
bool RoleCheckComplete = false;
};
@@ -371,7 +371,7 @@ namespace WorldPackets
struct LFGProposalUpdatePlayer
{
- uint32 Roles = 0;
+ uint8 Roles = 0;
bool Me = false;
bool SameParty = false;
bool MyParty = false;
diff --git a/src/server/game/Server/Packets/MiscPackets.cpp b/src/server/game/Server/Packets/MiscPackets.cpp
index ca8bec42391..5b5b4b19571 100644
--- a/src/server/game/Server/Packets/MiscPackets.cpp
+++ b/src/server/game/Server/Packets/MiscPackets.cpp
@@ -407,9 +407,11 @@ WorldPacket const* WorldPackets::Misc::PlayMusic::Write()
void WorldPackets::Misc::RandomRollClient::Read()
{
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> Min;
_worldPacket >> Max;
- _worldPacket >> PartyIndex;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Misc::RandomRoll::Write()
diff --git a/src/server/game/Server/Packets/MiscPackets.h b/src/server/game/Server/Packets/MiscPackets.h
index d39bcb26e0a..a064d06633b 100644
--- a/src/server/game/Server/Packets/MiscPackets.h
+++ b/src/server/game/Server/Packets/MiscPackets.h
@@ -529,7 +529,7 @@ namespace WorldPackets
int32 Min = 0;
int32 Max = 0;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class RandomRoll final : public ServerPacket
diff --git a/src/server/game/Server/Packets/PartyPackets.cpp b/src/server/game/Server/Packets/PartyPackets.cpp
index 0f18a0069ce..8b329508115 100644
--- a/src/server/game/Server/Packets/PartyPackets.cpp
+++ b/src/server/game/Server/Packets/PartyPackets.cpp
@@ -44,18 +44,18 @@ WorldPacket const* WorldPackets::Party::PartyCommandResult::Write()
void WorldPackets::Party::PartyInviteClient::Read()
{
- uint32 targetNameLen, targetRealmLen;
+ bool hasPartyIndex = _worldPacket.ReadBit();
- _worldPacket >> PartyIndex;
-
- targetNameLen = _worldPacket.ReadBits(9);
- targetRealmLen = _worldPacket.ReadBits(9);
+ uint32 targetNameLen = _worldPacket.ReadBits(9);
+ uint32 targetRealmLen = _worldPacket.ReadBits(9);
_worldPacket >> ProposedRoles;
_worldPacket >> TargetGUID;
TargetName = _worldPacket.ReadString(targetNameLen);
TargetRealm = _worldPacket.ReadString(targetRealmLen);
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::PartyInvite::Write()
@@ -72,7 +72,7 @@ WorldPacket const* WorldPackets::Party::PartyInvite::Write()
_worldPacket << InviterGUID;
_worldPacket << InviterBNetAccountId;
_worldPacket << uint16(Unk1);
- _worldPacket << uint32(ProposedRoles);
+ _worldPacket << uint8(ProposedRoles);
_worldPacket << uint32(LfgSlots.size());
_worldPacket << uint32(LfgCompletedMask);
@@ -84,7 +84,7 @@ WorldPacket const* WorldPackets::Party::PartyInvite::Write()
return &_worldPacket;
}
-void WorldPackets::Party::PartyInvite::Initialize(Player* const inviter, int32 proposedRoles, bool canAccept)
+void WorldPackets::Party::PartyInvite::Initialize(Player const* inviter, int32 proposedRoles, bool canAccept)
{
CanAccept = canAccept;
@@ -99,24 +99,26 @@ void WorldPackets::Party::PartyInvite::Initialize(Player* const inviter, int32 p
void WorldPackets::Party::PartyInviteResponse::Read()
{
- _worldPacket >> PartyIndex;
-
+ bool hasPartyIndex = _worldPacket.ReadBit();
Accept = _worldPacket.ReadBit();
-
bool hasRolesDesired = _worldPacket.ReadBit();
+
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
+
if (hasRolesDesired)
- {
- RolesDesired.emplace();
- _worldPacket >> *RolesDesired;
- }
+ _worldPacket >> RolesDesired.emplace();
}
void WorldPackets::Party::PartyUninvite::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
+ uint32 reasonLen = _worldPacket.ReadBits(8);
+
_worldPacket >> TargetGUID;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
- uint8 reasonLen = _worldPacket.ReadBits(8);
Reason = _worldPacket.ReadString(reasonLen);
}
@@ -131,8 +133,10 @@ WorldPacket const* WorldPackets::Party::GroupDecline::Write()
void WorldPackets::Party::RequestPartyMemberStats::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> TargetGUID;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Party::PartyMemberPhase const& phase)
@@ -244,54 +248,65 @@ WorldPacket const* WorldPackets::Party::PartyMemberFullState::Write()
void WorldPackets::Party::SetPartyLeader::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> TargetGUID;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::SetPartyAssignment::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
+ Set = _worldPacket.ReadBit();
_worldPacket >> Assignment;
_worldPacket >> Target;
- Set = _worldPacket.ReadBit();
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::SetRole::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> TargetGUID;
_worldPacket >> Role;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::RoleChangedInform::Write()
{
- _worldPacket << PartyIndex;
+ _worldPacket << uint8(PartyIndex);
_worldPacket << From;
_worldPacket << ChangedUnit;
- _worldPacket << OldRole;
- _worldPacket << NewRole;
+ _worldPacket << uint8(OldRole);
+ _worldPacket << uint8(NewRole);
return &_worldPacket;
}
void WorldPackets::Party::LeaveGroup::Read()
{
- _worldPacket >> PartyIndex;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::SetLootMethod::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> LootMethod;
_worldPacket >> LootMasterGUID;
_worldPacket >> LootThreshold;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::MinimapPingClient::Read()
{
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> PositionX;
_worldPacket >> PositionY;
- _worldPacket >> PartyIndex;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::MinimapPing::Write()
@@ -305,9 +320,11 @@ WorldPacket const* WorldPackets::Party::MinimapPing::Write()
void WorldPackets::Party::UpdateRaidTarget::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> Target;
_worldPacket >> Symbol;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::SendRaidTargetUpdateSingle::Write()
@@ -341,19 +358,23 @@ void WorldPackets::Party::ConvertRaid::Read()
void WorldPackets::Party::RequestPartyJoinUpdates::Read()
{
- _worldPacket >> PartyIndex;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::SetAssistantLeader::Read()
{
- _worldPacket >> PartyIndex;
- _worldPacket >> Target;
+ bool hasPartyIndex = _worldPacket.ReadBit();
Apply = _worldPacket.ReadBit();
+ _worldPacket >> Target;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::DoReadyCheck::Read()
{
- _worldPacket >> PartyIndex;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::ReadyCheckStarted::Write()
@@ -368,8 +389,9 @@ WorldPacket const* WorldPackets::Party::ReadyCheckStarted::Write()
void WorldPackets::Party::ReadyCheckResponseClient::Read()
{
- _worldPacket >> PartyIndex;
IsReady = _worldPacket.ReadBit();
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::ReadyCheckResponse::Write()
@@ -399,7 +421,8 @@ void WorldPackets::Party::OptOutOfLoot::Read()
void WorldPackets::Party::InitiateRolePoll::Read()
{
- _worldPacket >> PartyIndex;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
WorldPacket const* WorldPackets::Party::RolePollInform::Write()
@@ -507,22 +530,27 @@ WorldPacket const* WorldPackets::Party::PartyUpdate::Write()
void WorldPackets::Party::SetEveryoneIsAssistant::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
EveryoneIsAssistant = _worldPacket.ReadBit();
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::ChangeSubGroup::Read()
{
_worldPacket >> TargetGUID;
- _worldPacket >> PartyIndex;
_worldPacket >> NewSubGroup;
+ if (_worldPacket.ReadBit())
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::SwapSubGroups::Read()
{
- _worldPacket >> PartyIndex;
+ bool hasPartyIndex = _worldPacket.ReadBit();
_worldPacket >> FirstTarget;
_worldPacket >> SecondTarget;
+ if (hasPartyIndex)
+ _worldPacket >> PartyIndex.emplace();
}
void WorldPackets::Party::ClearRaidMarker::Read()
@@ -600,8 +628,8 @@ void WorldPackets::Party::PartyMemberFullState::Initialize(Player const* player)
MemberStats.PositionZ = int16(player->GetPositionZ());
MemberStats.SpecID = AsUnderlyingType(player->GetPrimarySpecialization());
- MemberStats.PartyType[0] = player->m_playerData->PartyType & 0xF;
- MemberStats.PartyType[1] = player->m_playerData->PartyType >> 4;
+ MemberStats.PartyType[0] = player->m_playerData->PartyType[0];
+ MemberStats.PartyType[1] = player->m_playerData->PartyType[1];
MemberStats.WmoGroupID = 0;
MemberStats.WmoDoodadPlacementID = 0;
diff --git a/src/server/game/Server/Packets/PartyPackets.h b/src/server/game/Server/Packets/PartyPackets.h
index 498967d1b74..179c881b3d9 100644
--- a/src/server/game/Server/Packets/PartyPackets.h
+++ b/src/server/game/Server/Packets/PartyPackets.h
@@ -50,7 +50,7 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
uint32 ProposedRoles = 0;
std::string TargetName;
std::string TargetRealm;
@@ -64,7 +64,7 @@ namespace WorldPackets
WorldPacket const* Write() override;
- void Initialize(Player* const inviter, int32 proposedRoles, bool canAccept);
+ void Initialize(Player const* inviter, int32 proposedRoles, bool canAccept);
bool MightCRZYou = false;
bool MustBeBNetFriend = false;
@@ -84,7 +84,7 @@ namespace WorldPackets
bool IsXRealm = false;
// Lfg
- uint32 ProposedRoles = 0;
+ uint8 ProposedRoles = 0;
uint32 LfgCompletedMask = 0;
std::vector<uint32> LfgSlots;
};
@@ -96,9 +96,9 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
bool Accept = false;
- Optional<uint32> RolesDesired;
+ Optional<uint8> RolesDesired;
};
class PartyUninvite final : public ClientPacket
@@ -108,7 +108,7 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid TargetGUID;
std::string Reason;
};
@@ -138,7 +138,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid TargetGUID;
};
@@ -236,7 +236,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid TargetGUID;
};
@@ -247,9 +247,9 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid TargetGUID;
- int32 Role = 0;
+ uint8 Role = 0;
};
class RoleChangedInform final : public ServerPacket
@@ -259,11 +259,11 @@ namespace WorldPackets
WorldPacket const* Write() override;
- int8 PartyIndex = 0;
+ uint8 PartyIndex = 0;
ObjectGuid From;
ObjectGuid ChangedUnit;
- int32 OldRole = 0;
- int32 NewRole = 0;
+ uint8 OldRole = 0;
+ uint8 NewRole = 0;
};
class LeaveGroup final : public ClientPacket
@@ -273,7 +273,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class SetLootMethod final : public ClientPacket
@@ -283,7 +283,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid LootMasterGUID;
uint8 LootMethod = 0u;
uint32 LootThreshold = 0u;
@@ -296,7 +296,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
float PositionX = 0.f;
float PositionY = 0.f;
};
@@ -320,7 +320,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid Target;
int8 Symbol = 0;
};
@@ -366,7 +366,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class SetAssistantLeader final : public ClientPacket
@@ -377,7 +377,7 @@ namespace WorldPackets
void Read() override;
ObjectGuid Target;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
bool Apply = false;
};
@@ -388,7 +388,7 @@ namespace WorldPackets
void Read() override;
uint8 Assignment = 0;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
ObjectGuid Target;
bool Set = false;
};
@@ -400,7 +400,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class ReadyCheckStarted final : public ServerPacket
@@ -423,7 +423,7 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
bool IsReady = false;
};
@@ -475,7 +475,7 @@ namespace WorldPackets
void Read() override;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class RolePollInform final : public ServerPacket
@@ -575,7 +575,7 @@ namespace WorldPackets
void Read() override;
- uint8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
bool EveryoneIsAssistant = false;
};
@@ -587,7 +587,7 @@ namespace WorldPackets
void Read() override;
ObjectGuid TargetGUID;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
uint8 NewSubGroup = 0u;
};
@@ -600,7 +600,7 @@ namespace WorldPackets
ObjectGuid FirstTarget;
ObjectGuid SecondTarget;
- int8 PartyIndex = 0;
+ Optional<uint8> PartyIndex;
};
class ClearRaidMarker final : public ClientPacket
diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp
index ed8239331c8..83ff89ef569 100644
--- a/src/server/game/Server/Packets/SpellPackets.cpp
+++ b/src/server/game/Server/Packets/SpellPackets.cpp
@@ -153,9 +153,7 @@ WorldPacket const* AuraUpdate::Write()
ByteBuffer& operator>>(ByteBuffer& buffer, TargetLocation& location)
{
buffer >> location.Transport;
- buffer >> location.Location.m_positionX;
- buffer >> location.Location.m_positionY;
- buffer >> location.Location.m_positionZ;
+ buffer >> location.Location;
return buffer;
}
@@ -290,9 +288,7 @@ WorldPacket const* SpellPrepare::Write()
ByteBuffer& operator<<(ByteBuffer& data, TargetLocation const& targetLocation)
{
data << targetLocation.Transport;
- data << float(targetLocation.Location.m_positionX);
- data << float(targetLocation.Location.m_positionY);
- data << float(targetLocation.Location.m_positionZ);
+ data << targetLocation.Location;
return data;
}
@@ -328,11 +324,10 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellTargetData const& spellTargetData)
ByteBuffer& operator<<(ByteBuffer& data, SpellMissStatus const& spellMissStatus)
{
- data.WriteBits(spellMissStatus.Reason, 4);
+ data << uint8(spellMissStatus.Reason);
if (spellMissStatus.Reason == SPELL_MISS_REFLECT)
- data.WriteBits(spellMissStatus.ReflectStatus, 4);
+ data << uint8(spellMissStatus.ReflectStatus);
- data.FlushBits();
return data;
}
@@ -367,13 +362,6 @@ ByteBuffer& operator<<(ByteBuffer& data, MissileTrajectoryResult const& missileT
return data;
}
-ByteBuffer& operator<<(ByteBuffer& data, SpellAmmo const& spellAmmo)
-{
- data << int32(spellAmmo.DisplayID);
- data << int8(spellAmmo.InventoryType);
- return data;
-}
-
ByteBuffer& operator<<(ByteBuffer& data, CreatureImmunities const& immunities)
{
data << int32(immunities.School);
@@ -401,7 +389,7 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
data << uint32(spellCastData.CastFlagsEx);
data << uint32(spellCastData.CastTime);
data << spellCastData.MissileTrajectory;
- data << int32(spellCastData.Ammo.DisplayID);
+ data << int32(spellCastData.AmmoDisplayID);
data << uint8(spellCastData.DestLocSpellCastIndex);
data << spellCastData.Immunities;
data << spellCastData.Predict;
@@ -414,9 +402,6 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
data.WriteBits(spellCastData.TargetPoints.size(), 16);
data.FlushBits();
- for (SpellMissStatus const& missStatus : spellCastData.MissStatus)
- data << missStatus;
-
data << spellCastData.Target;
for (ObjectGuid const& hitTarget : spellCastData.HitTargets)
@@ -428,6 +413,9 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
for (SpellHitStatus const& hitStatus : spellCastData.HitStatus)
data << hitStatus;
+ for (SpellMissStatus const& missStatus : spellCastData.MissStatus)
+ data << missStatus;
+
for (SpellPowerData const& power : spellCastData.RemainingPower)
data << power;
diff --git a/src/server/game/Server/Packets/SpellPackets.h b/src/server/game/Server/Packets/SpellPackets.h
index 6872687f1d1..bc0e8a6f24b 100644
--- a/src/server/game/Server/Packets/SpellPackets.h
+++ b/src/server/game/Server/Packets/SpellPackets.h
@@ -195,7 +195,7 @@ namespace WorldPackets
struct TargetLocation
{
ObjectGuid Transport;
- Position Location;
+ TaggedPosition<Position::XYZ> Location;
};
struct SpellTargetData
@@ -336,12 +336,6 @@ namespace WorldPackets
float Pitch = 0.0f;
};
- struct SpellAmmo
- {
- int32 DisplayID = 0;
- int8 InventoryType = 0;
- };
-
struct CreatureImmunities
{
uint32 School = 0;
@@ -374,7 +368,7 @@ namespace WorldPackets
std::vector<SpellPowerData> RemainingPower;
Optional<RuneData> RemainingRunes;
MissileTrajectoryResult MissileTrajectory;
- SpellAmmo Ammo;
+ int32 AmmoDisplayID;
uint8 DestLocSpellCastIndex = 0;
std::vector<TargetLocation> TargetPoints;
CreatureImmunities Immunities;
diff --git a/src/server/game/Server/Packets/SystemPackets.cpp b/src/server/game/Server/Packets/SystemPackets.cpp
index 6a6c4b74ea0..3b1bb5c7175 100644
--- a/src/server/game/Server/Packets/SystemPackets.cpp
+++ b/src/server/game/Server/Packets/SystemPackets.cpp
@@ -211,6 +211,10 @@ WorldPacket const* FeatureSystemStatusGlueScreen::Write()
_worldPacket.WriteBit(AccountSaveDataExportEnabled);
_worldPacket.WriteBit(AccountLockedByExport);
+ _worldPacket.WriteBit(RealmHiddenAlert.has_value());
+
+ if (RealmHiddenAlert)
+ _worldPacket.WriteBits(RealmHiddenAlert->length() + 1, 11);
_worldPacket.FlushBits();
@@ -238,6 +242,9 @@ WorldPacket const* FeatureSystemStatusGlueScreen::Write()
if (LaunchETA)
_worldPacket << int32(*LaunchETA);
+ if (RealmHiddenAlert && !RealmHiddenAlert->empty())
+ _worldPacket.WriteString(*RealmHiddenAlert);
+
if (!LiveRegionCharacterCopySourceRegions.empty())
_worldPacket.append(LiveRegionCharacterCopySourceRegions.data(), LiveRegionCharacterCopySourceRegions.size());
diff --git a/src/server/game/Server/Packets/SystemPackets.h b/src/server/game/Server/Packets/SystemPackets.h
index bdbb066d33d..d6ef99f2c81 100644
--- a/src/server/game/Server/Packets/SystemPackets.h
+++ b/src/server/game/Server/Packets/SystemPackets.h
@@ -219,6 +219,7 @@ namespace WorldPackets
Optional<int32> LaunchETA;
std::vector<DebugTimeEventInfo> DebugTimeEvents;
int32 Unused1007 = 0;
+ Optional<std::string> RealmHiddenAlert;
};
class MOTD final : public ServerPacket