refactor(Core): Improve struct alignment and codestyle (#12335)

refactor(Core): improve struct alignment and codestyle
This commit is contained in:
Maelthyr
2022-07-10 20:19:11 +02:00
committed by GitHub
parent 12a07ff91f
commit 2c7b274bc5
18 changed files with 661 additions and 663 deletions

View File

@@ -62,15 +62,15 @@ namespace lfg
private:
// General
LfgState m_State; ///< State if group in LFG
LfgState m_OldState; ///< Old State
ObjectGuid m_Leader; ///< Leader GUID
LfgGuidSet m_Players; ///< Players in group
LfgState m_State; ///< State if group in LFG
LfgState m_OldState; ///< Old State
ObjectGuid m_Leader; ///< Leader GUID
LfgGuidSet m_Players; ///< Players in group
// Dungeon
uint32 m_Dungeon; ///< Dungeon entry
uint32 m_Dungeon; ///< Dungeon entry
bool _isLFGGroup;
// Vote Kick
uint8 m_KicksLeft; ///< Number of kicks left
uint8 m_KicksLeft; ///< Number of kicks left
};
} // namespace lfg

View File

@@ -38,9 +38,9 @@ namespace lfg
enum LfgOptions
{
LFG_OPTION_ENABLE_DUNGEON_FINDER = 0x01,
LFG_OPTION_ENABLE_RAID_BROWSER = 0x02,
LFG_OPTION_ENABLE_SEASONAL_BOSSES = 0x04
LFG_OPTION_ENABLE_DUNGEON_FINDER = 0x01,
LFG_OPTION_ENABLE_RAID_BROWSER = 0x02,
LFG_OPTION_ENABLE_SEASONAL_BOSSES = 0x04
};
enum LFGMgrEnum
@@ -330,7 +330,7 @@ namespace lfg
Quest const* quest;
};
/// Reward info
// Reward info
struct LfgReward
{
LfgReward(uint32 _maxLevel = 0, uint32 _firstQuest = 0, uint32 _otherQuest = 0):
@@ -341,35 +341,35 @@ namespace lfg
uint32 otherQuest;
};
/// Stores player data related to proposal to join
// Stores player data related to proposal to join
struct LfgProposalPlayer
{
LfgProposalPlayer() = default;
uint8 role{0}; ///< Proposed role
LfgAnswer accept{LFG_ANSWER_PENDING}; ///< Accept status (-1 not answer | 0 Not agree | 1 agree)
uint8 role{0}; ///< Proposed role
LfgAnswer accept{LFG_ANSWER_PENDING}; ///< Accept status (-1 not answer | 0 Not agree | 1 agree)
ObjectGuid group; ///< Original group guid. 0 if no original group
};
/// Stores group data related to proposal to join
// Stores group data related to proposal to join
struct LfgProposal
{
LfgProposal(uint32 dungeon = 0): dungeonId(dungeon)
{ }
uint32 id{0}; ///< Proposal Id
uint32 id{0}; ///< Proposal Id
uint32 dungeonId; ///< Dungeon to join
LfgProposalState state{LFG_PROPOSAL_INITIATING}; ///< State of the proposal
LfgProposalState state{LFG_PROPOSAL_INITIATING}; ///< State of the proposal
ObjectGuid group; ///< Proposal group (0 if new)
ObjectGuid leader; ///< Leader guid.
time_t cancelTime{0}; ///< Time when we will cancel this proposal
uint32 encounters{0}; ///< Dungeon Encounters
bool isNew{true}; ///< Determines if it's new group or not
time_t cancelTime{0}; ///< Time when we will cancel this proposal
uint32 encounters{0}; ///< Dungeon Encounters
bool isNew{true}; ///< Determines if it's new group or not
Lfg5Guids queues; ///< Queue Ids to remove/readd
LfgGuidList showorder; ///< Show order in update window
LfgProposalPlayerContainer players; ///< Players data
};
/// Stores all rolecheck info of a group that wants to join
// Stores all rolecheck info of a group that wants to join
struct LfgRoleCheck
{
time_t cancelTime; ///< Time when the rolecheck will fail
@@ -380,7 +380,7 @@ namespace lfg
ObjectGuid leader; ///< Leader of the group
};
/// Stores information of a current vote to kick someone from a group
// Stores information of a current vote to kick someone from a group
struct LfgPlayerBoot
{
time_t cancelTime; ///< Time left to vote

View File

@@ -24,7 +24,6 @@
namespace lfg
{
enum LfgCompatibility
{
LFG_COMPATIBILITY_PENDING,
@@ -38,7 +37,7 @@ namespace lfg
LFG_COMPATIBLES_MATCH // Must be the last one
};
/// Stores player or group queue info
// Stores player or group queue info
struct LfgQueueData
{
LfgQueueData();
@@ -48,21 +47,21 @@ namespace lfg
dps(LFG_DPS_NEEDED), dungeons(std::move(_dungeons)), roles(std::move(_roles))
{ }
time_t joinTime; ///< Player queue join time (to calculate wait times)
time_t lastRefreshTime; ///< pussywizard
uint8 tanks{LFG_TANKS_NEEDED}; ///< Tanks needed
uint8 healers{LFG_HEALERS_NEEDED}; ///< Healers needed
uint8 dps{LFG_DPS_NEEDED}; ///< Dps needed
LfgDungeonSet dungeons; ///< Selected Player/Group Dungeon/s
LfgRolesMap roles; ///< Selected Player Role/s
Lfg5Guids bestCompatible; ///< Best compatible combination of people queued
time_t joinTime; // Player queue join time (to calculate wait times)
time_t lastRefreshTime; // pussywizard
uint8 tanks{LFG_TANKS_NEEDED}; // Tanks needed
uint8 healers{LFG_HEALERS_NEEDED}; // Healers needed
uint8 dps{LFG_DPS_NEEDED}; // Dps needed
LfgDungeonSet dungeons; // Selected Player/Group Dungeon/s
LfgRolesMap roles; // Selected Player Role/s
Lfg5Guids bestCompatible; // Best compatible combination of people queued
};
struct LfgWaitTime
{
LfgWaitTime() = default;
int32 time{-1}; ///< Wait time
uint32 number{0}; ///< Number of people used to get that wait time
int32 time{-1}; // Wait time
uint32 number{0}; // Number of people used to get that wait time
};
typedef std::map<uint32, LfgWaitTime> LfgWaitTimesContainer;
@@ -110,19 +109,18 @@ namespace lfg
LfgCompatibility CheckCompatibility(Lfg5Guids const& checkWith, const ObjectGuid& newGuid, uint64& foundMask, uint32& foundCount, const std::set<Lfg5Guids>& currentCompatibles);
// Queue
uint32 m_QueueStatusTimer; ///< used to check interval of sending queue status
LfgQueueDataContainer QueueDataStore; ///< Queued groups
LfgCompatibleContainer CompatibleList; ///< Compatible dungeons
LfgCompatibleContainer CompatibleTempList; ///< new compatibles are added to this container while main one is being iterated
uint32 m_QueueStatusTimer; // used to check interval of sending queue status
LfgQueueDataContainer QueueDataStore; // Queued groups
LfgCompatibleContainer CompatibleList; // Compatible dungeons
LfgCompatibleContainer CompatibleTempList; // new compatibles are added to this container while main one is being iterated
LfgWaitTimesContainer waitTimesAvgStore; ///< Average wait time to find a group queuing as multiple roles
LfgWaitTimesContainer waitTimesTankStore; ///< Average wait time to find a group queuing as tank
LfgWaitTimesContainer waitTimesHealerStore; ///< Average wait time to find a group queuing as healer
LfgWaitTimesContainer waitTimesDpsStore; ///< Average wait time to find a group queuing as dps
LfgGuidList newToQueueStore; ///< New groups to add to queue
LfgWaitTimesContainer waitTimesAvgStore; // Average wait time to find a group queuing as multiple roles
LfgWaitTimesContainer waitTimesTankStore; // Average wait time to find a group queuing as tank
LfgWaitTimesContainer waitTimesHealerStore; // Average wait time to find a group queuing as healer
LfgWaitTimesContainer waitTimesDpsStore; // Average wait time to find a group queuing as dps
LfgGuidList newToQueueStore; // New groups to add to queue
LfgGuidList restoredAfterProposal;
};
} // namespace lfg
}
#endif