mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Initialize arrays of primitive types
This commit is contained in:
@@ -122,10 +122,10 @@ struct AuctionSearchFilters
|
||||
struct SubclassFilter
|
||||
{
|
||||
uint32 SubclassMask = FILTER_SKIP_CLASS;
|
||||
std::array<uint32, MAX_ITEM_SUBCLASS_TOTAL> InvTypes;
|
||||
std::array<uint32, MAX_ITEM_SUBCLASS_TOTAL> InvTypes = { };
|
||||
};
|
||||
|
||||
std::array<SubclassFilter, MAX_ITEM_CLASS> Classes;
|
||||
std::array<SubclassFilter, MAX_ITEM_CLASS> Classes = { };
|
||||
};
|
||||
|
||||
//this class is used as auctionhouse instance
|
||||
|
||||
@@ -637,8 +637,12 @@ void WorldSession::HandleAuctionListItems(WorldPackets::AuctionHouse::AuctionLis
|
||||
{
|
||||
for (auto const& subClassFilter : classFilter.SubClassFilters)
|
||||
{
|
||||
filters->Classes[classFilter.ItemClass].SubclassMask |= 1 << subClassFilter.ItemSubclass;
|
||||
filters->Classes[classFilter.ItemClass].InvTypes[subClassFilter.ItemSubclass] = subClassFilter.InvTypeMask;
|
||||
if (classFilter.ItemClass < MAX_ITEM_CLASS)
|
||||
{
|
||||
filters->Classes[classFilter.ItemClass].SubclassMask |= 1 << subClassFilter.ItemSubclass;
|
||||
if (subClassFilter.ItemSubclass < MAX_ITEM_SUBCLASS_TOTAL)
|
||||
filters->Classes[classFilter.ItemClass].InvTypes[subClassFilter.ItemSubclass] = subClassFilter.InvTypeMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -510,8 +510,8 @@ class TC_GAME_API Quest
|
||||
protected:
|
||||
|
||||
// quest_detais table
|
||||
uint32 DetailsEmote[QUEST_EMOTE_COUNT] = {};
|
||||
uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT] = {};
|
||||
uint32 DetailsEmote[QUEST_EMOTE_COUNT] = { };
|
||||
uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT] = { };
|
||||
|
||||
// quest_request_items table
|
||||
uint32 EmoteOnComplete = 0;
|
||||
@@ -521,8 +521,8 @@ class TC_GAME_API Quest
|
||||
std::string RequestItemsText;
|
||||
|
||||
// quest_offer_reward table
|
||||
uint32 OfferRewardEmote[QUEST_EMOTE_COUNT] = {};
|
||||
uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT] = {};
|
||||
uint32 OfferRewardEmote[QUEST_EMOTE_COUNT] = { };
|
||||
uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT] = { };
|
||||
std::string OfferRewardText;
|
||||
|
||||
// quest_template_addon table (custom data)
|
||||
|
||||
@@ -339,6 +339,7 @@ uint8 const WherePacketHmac[] =
|
||||
|
||||
WorldPackets::Auth::ConnectTo::ConnectTo() : ServerPacket(SMSG_CONNECT_TO, 8 + 4 + 256 + 1)
|
||||
{
|
||||
Payload.Where.fill(0);
|
||||
HexStrToByteArray("F41DCB2D728CF3337A4FF338FA89DB01BBBE9C3B65E9DA96268687353E48B94C", Payload.PanamaKey);
|
||||
Payload.Adler32 = 0xA0A66C10;
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ namespace WorldPackets
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
std::array<uint8, 16> Challenge;
|
||||
uint32 DosChallenge[8]; ///< Encryption seeds
|
||||
std::array<uint8, 16> Challenge = { };
|
||||
uint32 DosChallenge[8] = { }; ///< Encryption seeds
|
||||
uint8 DosZeroBits = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace WorldPackets
|
||||
void Read() override;
|
||||
|
||||
uint32 Token = 0;
|
||||
std::array<uint8, 32> Secret;
|
||||
std::array<uint8, 32> Secret = { };
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace WorldPackets
|
||||
uint8 HairStyle = 0;
|
||||
uint8 HairColor = 0;
|
||||
uint8 FacialHairStyle = 0;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
uint8 OutfitId = 0;
|
||||
Optional<int32> TemplateSet;
|
||||
std::string Name;
|
||||
@@ -78,7 +78,7 @@ namespace WorldPackets
|
||||
uint8 HairColorID = 0;
|
||||
uint8 FacialHairStyleID = 0;
|
||||
uint8 SkinID = 0;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
};
|
||||
|
||||
struct CharRaceOrFactionChangeInfo
|
||||
@@ -93,7 +93,7 @@ namespace WorldPackets
|
||||
std::string Name;
|
||||
uint8 FaceID = 0;
|
||||
uint8 HairStyleID = 0;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
};
|
||||
|
||||
struct CharacterUndeleteInfo
|
||||
@@ -131,7 +131,7 @@ namespace WorldPackets
|
||||
uint8 HairStyle = 0;
|
||||
uint8 HairColor = 0;
|
||||
uint8 FacialHair = 0;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
uint8 Level = 0;
|
||||
int32 ZoneId = 0;
|
||||
int32 MapId = 0;
|
||||
@@ -155,7 +155,7 @@ namespace WorldPackets
|
||||
} Pet;
|
||||
|
||||
bool BoostInProgress = false; ///< @todo
|
||||
int32 ProfessionIds[2]; ///< @todo
|
||||
int32 ProfessionIds[2] = { }; ///< @todo
|
||||
|
||||
struct VisualItemInfo
|
||||
{
|
||||
@@ -164,7 +164,7 @@ namespace WorldPackets
|
||||
uint8 InventoryType = 0;
|
||||
};
|
||||
|
||||
std::array<VisualItemInfo, 23> VisualItems;
|
||||
std::array<VisualItemInfo, 23> VisualItems = { };
|
||||
};
|
||||
|
||||
struct RestrictedFactionChangeRuleInfo
|
||||
@@ -329,7 +329,7 @@ namespace WorldPackets
|
||||
uint8 FacialHairStyleID = 0;
|
||||
uint8 FaceID = 0;
|
||||
uint8 RaceID = RACE_NONE;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
};
|
||||
|
||||
CharFactionChangeResult() : ServerPacket(SMSG_CHAR_FACTION_CHANGE_RESULT, 20 + sizeof(CharFactionChangeDisplayInfo)) { }
|
||||
@@ -598,7 +598,7 @@ namespace WorldPackets
|
||||
uint32 NewFacialHair = 0;
|
||||
uint32 NewSkinColor = 0;
|
||||
uint32 NewFace = 0;
|
||||
std::array<uint32, PLAYER_CUSTOM_DISPLAY_SIZE> NewCustomDisplay;
|
||||
std::array<uint32, PLAYER_CUSTOM_DISPLAY_SIZE> NewCustomDisplay = { };
|
||||
};
|
||||
|
||||
class BarberShopResult final : public ServerPacket
|
||||
@@ -711,7 +711,7 @@ namespace WorldPackets
|
||||
uint8 HairStyleID = 0;
|
||||
uint8 FacialHairStyleID = 0;
|
||||
uint8 FaceID = 0;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
|
||||
std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay = { };
|
||||
};
|
||||
|
||||
class CharCustomizeFailed final : public ServerPacket
|
||||
|
||||
@@ -479,7 +479,7 @@ namespace WorldPackets
|
||||
void Read() override;
|
||||
|
||||
ObjectGuid ItemGuid;
|
||||
std::array<ObjectGuid, MAX_ITEM_PROTO_SOCKETS> GemItem;
|
||||
std::array<ObjectGuid, MAX_ITEM_PROTO_SOCKETS> GemItem = { };
|
||||
};
|
||||
|
||||
class SocketGemsResult final : public ServerPacket
|
||||
|
||||
@@ -317,8 +317,8 @@ namespace WorldPackets
|
||||
uint32 Slot = 0;
|
||||
uint32 AvgWaitTimeMe = 0;
|
||||
uint32 AvgWaitTime = 0;
|
||||
uint32 AvgWaitTimeByRole[3] = {};
|
||||
uint8 LastNeeded[3] = {};
|
||||
uint32 AvgWaitTimeByRole[3] = { };
|
||||
uint8 LastNeeded[3] = { };
|
||||
uint32 QueuedTime = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -479,8 +479,8 @@ namespace WorldPackets
|
||||
|
||||
int32 Level = 0;
|
||||
int32 HealthDelta = 0;
|
||||
std::array<int32, 6> PowerDelta;
|
||||
std::array<int32, MAX_STATS> StatDelta;
|
||||
std::array<int32, 6> PowerDelta = { };
|
||||
std::array<int32, MAX_STATS> StatDelta = { };
|
||||
int32 Cp = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace WorldPackets
|
||||
int32 MoneyCost = 0;
|
||||
int32 ReqSkillLine = 0;
|
||||
int32 ReqSkillRank = 0;
|
||||
std::array<int32, 3> ReqAbility;
|
||||
std::array<int32, 3> ReqAbility = { };
|
||||
uint8 Usable = 0;
|
||||
uint8 ReqLevel = 0;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "PacketUtilities.h"
|
||||
#include "Errors.h"
|
||||
#include <sstream>
|
||||
#include <array>
|
||||
|
||||
WorldPackets::PacketArrayMaxCapacityException::PacketArrayMaxCapacityException(std::size_t requestedSize, std::size_t sizeLimit)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace WorldPackets
|
||||
uint8 CommandState = 0;
|
||||
uint8 Flag = 0;
|
||||
|
||||
std::array<int, 10> ActionButtons;
|
||||
std::array<int, 10> ActionButtons = { };
|
||||
|
||||
std::vector<uint32> Actions;
|
||||
std::vector<PetSpellCooldown> Cooldowns;
|
||||
|
||||
@@ -45,6 +45,13 @@ namespace WorldPackets
|
||||
|
||||
struct CreatureStats
|
||||
{
|
||||
CreatureStats()
|
||||
{
|
||||
Flags.fill(0);
|
||||
ProxyCreatureID.fill(0);
|
||||
CreatureDisplayID.fill(0);
|
||||
}
|
||||
|
||||
std::string Title;
|
||||
std::string TitleAlt;
|
||||
std::string CursorName;
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace WorldPackets
|
||||
int32 RewardMoneyDifficulty = 0;
|
||||
float RewardMoneyMultiplier = 1.0f;
|
||||
int32 RewardBonusMoney = 0;
|
||||
int32 RewardDisplaySpell[QUEST_REWARD_DISPLAY_SPELL_COUNT] = {}; // reward spell, this spell will be displayed (icon)
|
||||
int32 RewardDisplaySpell[QUEST_REWARD_DISPLAY_SPELL_COUNT] = { }; // reward spell, this spell will be displayed (icon)
|
||||
int32 RewardSpell = 0;
|
||||
int32 RewardHonor = 0;
|
||||
float RewardKillHonor = 0.0f;
|
||||
@@ -159,17 +159,17 @@ namespace WorldPackets
|
||||
int32 QuestRewardID = 0;
|
||||
int32 Expansion = 0;
|
||||
std::vector<QuestObjective> Objectives;
|
||||
int32 RewardItems[QUEST_REWARD_ITEM_COUNT] = {};
|
||||
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT] = {};
|
||||
int32 ItemDrop[QUEST_ITEM_DROP_COUNT] = {};
|
||||
int32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT] = {};
|
||||
int32 RewardItems[QUEST_REWARD_ITEM_COUNT] = { };
|
||||
int32 RewardAmount[QUEST_REWARD_ITEM_COUNT] = { };
|
||||
int32 ItemDrop[QUEST_ITEM_DROP_COUNT] = { };
|
||||
int32 ItemDropQuantity[QUEST_ITEM_DROP_COUNT] = { };
|
||||
QuestInfoChoiceItem UnfilteredChoiceItems[QUEST_REWARD_CHOICES_COUNT];
|
||||
int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT] = {};
|
||||
int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = {};
|
||||
int32 RewardFactionID[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 RewardFactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 RewardFactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 RewardCurrencyID[QUEST_REWARD_CURRENCY_COUNT] = { };
|
||||
int32 RewardCurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = { };
|
||||
};
|
||||
|
||||
class QueryQuestInfoResponse final : public ServerPacket
|
||||
@@ -239,20 +239,20 @@ namespace WorldPackets
|
||||
int32 Honor = 0;
|
||||
int32 Title = 0;
|
||||
int32 FactionFlags = 0;
|
||||
int32 SpellCompletionDisplayID[QUEST_REWARD_DISPLAY_SPELL_COUNT] = {};
|
||||
int32 SpellCompletionDisplayID[QUEST_REWARD_DISPLAY_SPELL_COUNT] = { };
|
||||
int32 SpellCompletionID = 0;
|
||||
int32 SkillLineID = 0;
|
||||
int32 NumSkillUps = 0;
|
||||
int32 RewardID = 0;
|
||||
QuestChoiceItem ChoiceItems[QUEST_REWARD_CHOICES_COUNT];
|
||||
int32 ItemID[QUEST_REWARD_ITEM_COUNT] = {};
|
||||
int32 ItemQty[QUEST_REWARD_ITEM_COUNT] = {};
|
||||
int32 FactionID[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 FactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 FactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 FactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = {};
|
||||
int32 CurrencyID[QUEST_REWARD_CURRENCY_COUNT] = {};
|
||||
int32 CurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = {};
|
||||
int32 ItemID[QUEST_REWARD_ITEM_COUNT] = { };
|
||||
int32 ItemQty[QUEST_REWARD_ITEM_COUNT] = { };
|
||||
int32 FactionID[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 FactionValue[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 FactionOverride[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 FactionCapIn[QUEST_REWARD_REPUTATIONS_COUNT] = { };
|
||||
int32 CurrencyID[QUEST_REWARD_CURRENCY_COUNT] = { };
|
||||
int32 CurrencyQty[QUEST_REWARD_CURRENCY_COUNT] = { };
|
||||
bool IsBoostSpell = false;
|
||||
};
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace WorldPackets
|
||||
int32 SuggestedPartyMembers = 0;
|
||||
QuestRewards Rewards;
|
||||
std::vector<QuestDescEmote> Emotes;
|
||||
int32 QuestFlags[2] = {}; // Flags and FlagsEx
|
||||
int32 QuestFlags[2] = { }; // Flags and FlagsEx
|
||||
};
|
||||
|
||||
class QuestGiverOfferRewardMessage final : public ServerPacket
|
||||
@@ -356,7 +356,7 @@ namespace WorldPackets
|
||||
ObjectGuid InformUnit;
|
||||
int32 QuestID = 0;
|
||||
int32 QuestPackageID = 0;
|
||||
uint32 QuestFlags[2] = {};
|
||||
uint32 QuestFlags[2] = { };
|
||||
int32 SuggestedPartyMembers = 0;
|
||||
QuestRewards Rewards;
|
||||
std::vector<QuestObjectiveSimple> Objectives;
|
||||
@@ -410,7 +410,7 @@ namespace WorldPackets
|
||||
std::vector<QuestObjectiveCollect> Collect;
|
||||
std::vector<QuestCurrency> Currency;
|
||||
int32 StatusFlags = 0;
|
||||
uint32 QuestFlags[2] = {};
|
||||
uint32 QuestFlags[2] = { };
|
||||
std::string QuestTitle;
|
||||
std::string CompletionText;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user