Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
LFGMgr.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_LFGMGR_H
7#define SF_LFGMGR_H
8
9#include "DBCStructure.h"
10#include "Field.h"
11#include "LFG.h"
12#include "LFGGroupData.h"
13#include "LFGPlayerData.h"
14#include "LFGQueue.h"
15#include "Platform/Singleton.h"
16
17class Group;
18class Player;
19class Quest;
20
21namespace lfg
22{
23
29
41
43 {
57 LFG_FLAG_UNK12 = 0x1000, // FLEX + HEROIC SCENARIOS, requires premade flag?
58 };
59
68
76
79 {
80 // 7 = "You can't do that right now" | 5 = No client reaction
81 LFG_TELEPORTERROR_OK = 0, // Internal use
88 LFG_TELEPORTERROR_CHARMING = 8 // FIXME - It can be 7 or 8 (Need proper data)
89 };
90
93 {
94 // 3 = No client reaction | 18 = "Rolecheck failed"
95 LFG_JOIN_OK = 0x00, // Joined (no client msg)
96 LFG_JOIN_FAILED = 0x1C, // RoleCheck has Failed
98 LFG_JOIN_INTERNAL_ERROR = 0x1F, // Internal LFG Error
99 LFG_JOIN_NOT_MEET_REQS = 0x20, // You do not meet the requirements for the chosen dungeons
100 LFG_JOIN_MIXED_RAID_DUNGEON = 0x21, // You cannot mix dungeons, raids, and random when picking dungeons
101 LFG_JOIN_MULTI_REALM = 0x22, // The dungeon you chose does not support players from multiple realms
102 LFG_JOIN_DISCONNECTED = 0x23, // One or more party members are pending invites or disconnected
103 LFG_JOIN_PARTY_INFO_FAILED = 0x24, // Could not retrieve information about some party members
104 LFG_JOIN_DUNGEON_INVALID = 0x25, // One or more dungeons was not valid
105 LFG_JOIN_DESERTER = 0x26, // You can not queue for dungeons until your deserter debuff wears off
106 LFG_JOIN_PARTY_DESERTER = 0x27, // One or more party members has a deserter debuff
107 LFG_JOIN_RANDOM_COOLDOWN = 0x28, // You can not queue for random dungeons while on random dungeon cooldown
108 LFG_JOIN_PARTY_RANDOM_COOLDOWN = 0x29, // One or more party members are on random dungeon cooldown
109 LFG_JOIN_TOO_MUCH_MEMBERS = 0x2A, // You can not enter dungeons with more that 5 party members
110 LFG_JOIN_USING_BG_SYSTEM = 0x2B, // You can not use the dungeon system while in BG or arenas
111 LFG_JOIN_ROLE_CHECK_FAILED = 0x2C // Role check failed, client shows special error
112 };
113
116 {
117 LFG_ROLECHECK_DEFAULT = 0, // Internal use = Not initialized.
118 LFG_ROLECHECK_FINISHED = 1, // Role check finished
119 LFG_ROLECHECK_INITIALITING = 2, // Role check begins
120 LFG_ROLECHECK_MISSING_ROLE = 3, // Someone didn't selected a role after 2 mins
121 LFG_ROLECHECK_WRONG_ROLES = 4, // Can't form a group with that role selection
122 LFG_ROLECHECK_ABORTED = 5, // Someone leave the group
123 LFG_ROLECHECK_NO_ROLE = 6 // Someone selected no role
124 };
125
126 // Forward declaration (just to have all typedef together)
127 struct LFGDungeonData;
128 struct LfgReward;
129 struct LfgQueueInfo;
130 struct LfgRoleCheck;
131 struct LfgProposal;
132 struct LfgProposalPlayer;
133 struct LfgPlayerBoot;
134
135 typedef std::map<uint8, LFGQueue> LfgQueueContainer;
136 typedef std::multimap<uint32, LfgReward const*> LfgRewardContainer;
137 typedef std::pair<LfgRewardContainer::const_iterator, LfgRewardContainer::const_iterator> LfgRewardContainerBounds;
138 typedef std::map<uint8, LfgDungeonSet> LfgCachedDungeonContainer;
139 typedef std::map<uint64, LfgAnswer> LfgAnswerContainer;
140 typedef std::map<uint64, LfgRoleCheck> LfgRoleCheckContainer;
141 typedef std::map<uint32, LfgProposal> LfgProposalContainer;
142 typedef std::map<uint64, LfgProposalPlayer> LfgProposalPlayerContainer;
143 typedef std::map<uint64, LfgPlayerBoot> LfgPlayerBootContainer;
144 typedef std::map<uint64, LfgGroupData> LfgGroupDataContainer;
145 typedef std::map<uint64, LfgPlayerData> LfgPlayerDataContainer;
147
148 // Data needed by SMSG_LFG_JOIN_RESULT
157
158 // Data needed by SMSG_LFG_UPDATE_STATUS
160 {
162 LfgUpdateData(LfgUpdateType _type, LfgDungeonSet const& _dungeons, std::string const& _comment) :
163 updateType(_type), state(LFG_STATE_NONE), dungeons(_dungeons), comment(_comment) { }
164 LfgUpdateData(LfgUpdateType _type, LfgState _state, LfgDungeonSet const& _dungeons, std::string const& _comment = "") :
165 updateType(_type), state(_state), dungeons(_dungeons), comment(_comment) { }
166
170 std::string comment;
171 };
172
173 // Data needed by SMSG_LFG_QUEUE_STATUS
175 {
176 LfgQueueStatusData(uint8 _queueId = 0, uint32 _dungeonId = 0, time_t _joinTime = 0, int32 _waitTime = -1, int32 _waitTimeAvg = -1, int32 _waitTimeTank = -1, int32 _waitTimeHealer = -1,
177 int32 _waitTimeDps = -1, uint32 _queuedTime = 0, uint8 _tanks = 0, uint8 _healers = 0, uint8 _dps = 0) :
178 queueId(_queueId), dungeonId(_dungeonId), joinTime(_joinTime), waitTime(_waitTime), waitTimeAvg(_waitTimeAvg), waitTimeTank(_waitTimeTank),
179 waitTimeHealer(_waitTimeHealer), waitTimeDps(_waitTimeDps), queuedTime(_queuedTime), tanks(_tanks), healers(_healers), dps(_dps) { }
180
183 time_t joinTime;
193 };
194
196 {
197 LfgPlayerRewardData(uint32 random, uint32 current, bool _done, Quest const* _quest) :
198 rdungeonEntry(random), sdungeonEntry(current), done(_done), quest(_quest) { }
201 bool done;
202 Quest const* quest;
203 };
204
207 {
208 LfgReward(uint32 _maxLevel = 0, uint32 _firstQuest = 0, uint32 _otherQuest = 0) :
209 maxLevel(_maxLevel), firstQuest(_firstQuest), otherQuest(_otherQuest) { }
210
214 };
215
224
244
255
265
267 {
268 LFGDungeonData() : id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
269 maxlevel(0), difficulty(DIFFICULTY_NONE), category(0), requiredItemLevel(0), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
270 { }
271 LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->m_ID), name(dbc->m_Name), map(dbc->m_ContinentID),
272 type(dbc->m_Type), expansion(dbc->m_ExpansionLevel), group(dbc->m_GroupID),
273 minlevel(dbc->m_MinLevel), maxlevel(dbc->m_MaxLevel), difficulty(DifficultyID(dbc->m_DifficultyID)),
274 category(uint8(dbc->m_SubType)), requiredItemLevel(0), seasonal(dbc->m_Flags& LFG_FLAG_SEASONAL), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
275 { }
276
278 std::string name;
289 float x, y, z, o;
290
291 // Helpers
292 uint32 Entry() const { return id + (type << 24); }
293 };
294
295 class LFGMgr
296 {
297 friend class Skyfire::Singleton<LFGMgr, Skyfire::NullMutex>;
298
299 private:
300 LFGMgr();
301 ~LFGMgr();
302
303 public:
304 // Functions used outside lfg namespace
305 void Update(uint32 diff);
306
307 // World.cpp
309 void FinishDungeon(uint64 gguid, uint32 dungeonId);
311 void LoadRewards();
313 void LoadLFGDungeons(bool reload = false);
314
315 // Multiple files
317 bool selectedRandomLfgDungeon(uint64 guid);
319 bool inLfgDungeonMap(uint64 guid, uint32 map, DifficultyID difficulty);
321 LfgDungeonSet const& GetSelectedDungeons(uint64 guid);
323 LfgState GetState(uint64 guid);
325 uint32 GetDungeon(uint64 guid, bool asId = true);
327 uint32 GetDungeonMapId(uint64 guid);
329 bool IsVoteKickActive(uint64 gguid);
331 uint8 GetKicksLeft(uint64 gguid);
333 void _LoadFromDB(Field* fields, uint64 guid);
335 void SetupGroupMember(uint64 guid, uint64 gguid);
337 bool RestoreActiveQueue(uint64 guid);
339 bool SendActiveProposal(uint64 guid);
341 uint32 GetLFGDungeonEntry(uint32 id);
343 uint8 GetLFGDungeonCategory(uint32 id);
345 bool IsRaidFinderDungeon(uint32 dungeonId);
347 bool IsFlexibleRaidDungeon(uint32 dungeonId);
348
349 // cs_lfg
351 uint8 GetRoles(uint64 guid);
353 uint8 GetActiveQueueId(uint64 guid);
355 std::string const& GetComment(uint64 gguid);
359 void SetOptions(uint32 options);
361 bool isOptionEnabled(uint32 option);
371 void Clean();
373 std::string DumpQueueInfo(bool full = false);
375 std::string DumpPlayerInfo(uint64 guid);
377 std::string DumpGroupInfo(uint64 guid);
378
379 // LFGScripts
381 uint64 GetLeader(uint64 guid);
383 void SetTeam(uint64 guid, uint8 team);
385 void SetGroup(uint64 guid, uint64 group);
387 uint64 GetGroup(uint64 guid);
389 void SetLeader(uint64 gguid, uint64 leader);
391 void RemoveGroupData(uint64 guid);
393 void ClearDungeonGroupState(uint64 guid, uint32 dbGuid, char const* debugMsg, bool sendUpdate);
397 void AddPlayerToGroup(uint64 gguid, uint64 guid);
398
399 // LFGHandler
405 bool IsSeasonActive(uint32 dungeonId);
407 LfgReward const* GetRandomDungeonReward(uint32 dungeon, uint8 level);
411 void TeleportPlayer(Player* player, bool out, bool fromOpcode = false, bool forceChangeInstance = false);
413 void TeleportDungeonGroupOut(Group* group);
415 void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const& reason);
417 void UpdateBoot(uint64 guid, bool accept);
419 void UpdateProposal(uint32 proposalId, uint64 guid, bool accept);
421 void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = PLAYER_ROLE_NONE);
423 void SetRoles(uint64 guid, uint8 roles);
425 void SetComment(uint64 guid, std::string const& comment);
427 void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment);
429 void LeaveLfg(uint64 guid, bool disconnected = false);
431 void LeaveSoloLfg(uint64 guid, uint32 queueID, bool disconnected = false);
432
433 // LfgQueue
437 bool IsLfgGroup(uint64 guid);
441 uint32 AddProposal(LfgProposal& proposal);
443 uint8 GetQueueId(uint64 guid);
445 bool AllQueued(LfgGuidList const& check);
447 time_t GetQueueJoinTime(uint64 guid);
449 static bool CheckGroupRoles(LfgRolesMap& groles);
451 static bool CheckDpsOnlyRoles(LfgRolesMap& groles, uint8 neededDamage);
453 static bool CheckFlexibleRaidRoles(LfgRolesMap& groles, uint8 maxPlayers);
455 static bool HasIgnore(uint64 guid1, uint64 guid2);
457 static void SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data);
458
459 private:
460 uint8 GetTeam(uint64 guid);
461 void RestoreState(uint64 guid, char const* debugMsg);
462 void RestoreOrClearState(uint64 guid, char const* debugMsg);
463 void ClearState(uint64 guid, char const* debugMsg);
464 void ClearQueueState(uint64 guid, char const* debugMsg);
465 void ClearGroupQueueState(uint64 guid, char const* debugMsg, bool sendUpdate);
466 void SetActiveQueueId(uint64 guid, uint8 queueId);
467 void SetDungeon(uint64 guid, uint32 dungeon);
468 void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons);
469 void DecreaseKicksLeft(uint64 guid);
470 void SetState(uint64 guid, LfgState state);
471 void SetVoteKick(uint64 guid, bool active);
472 void RemovePlayerData(uint64 guid);
473 void GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap, bool isContinue);
474 void _SaveToDB(uint64 guid, uint32 db_guid);
476
477 // Proposals
478 void RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdateType type);
479 bool MakeNewGroup(LfgProposal const& proposal);
480
481 // Generic
482 LFGQueue& GetQueue(uint64 guid);
483
484 LfgDungeonSet const& GetDungeonsByRandom(uint32 randomdungeon);
486
487 void SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const& boot);
488 void SendLfgJoinResult(uint64 guid, LfgJoinResultData const& data);
489 void SendLfgRoleChosen(uint64 guid, uint64 pguid, uint8 roles);
490 void SendLfgRoleCheckUpdate(uint64 guid, LfgRoleCheck const& roleCheck);
491 void SendLfgUpdateStatus(uint64 guid, LfgUpdateData const& data, bool party);
492 void SendLfgUpdateProposal(uint64 guid, LfgProposal const& proposal);
493
494 LfgGuidSet const& GetPlayers(uint64 guid);
495
496 // General variables
502
505 // Reward System
508 // Rolecheck - Proposal - Vote Kicks
514 };
515
516} // namespace lfg
517
518#define sLFGMgr Skyfire::Singleton<lfg::LFGMgr, Skyfire::NullMutex>::instance()
519#endif
@ IN_MILLISECONDS
Definition Common.h:125
DifficultyID
Definition DBCEnums.h:330
@ DIFFICULTY_NONE
Definition DBCEnums.h:331
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
std::uint16_t uint16
Definition Define.h:78
#define UNORDERED_MAP
Definition Group.h:147
void SetActiveQueueId(uint64 guid, uint8 queueId)
Definition LFGMgr.cpp:2366
void SendLfgRoleCheckUpdate(uint64 guid, LfgRoleCheck const &roleCheck)
Definition LFGMgr.cpp:2543
void SetSelectedDungeons(uint64 guid, LfgDungeonSet const &dungeons)
Definition LFGMgr.cpp:2398
static bool CheckDpsOnlyRoles(LfgRolesMap &groles, uint8 neededDamage)
Assigns queued players to damage roles for role-neutral scenario queues.
Definition LFGMgr.cpp:1114
void RemovePlayerData(uint64 guid)
Definition LFGMgr.cpp:2410
bool inLfgDungeonMap(uint64 guid, uint32 map, DifficultyID difficulty)
Check if given guid applied for given map and difficulty. Used to know.
Definition LFGMgr.cpp:2979
uint32 GetLFGDungeonEntry(uint32 id)
Return Lfg dungeon entry for given dungeon id.
Definition LFGMgr.cpp:3006
void LoadLFGDungeons(bool reload=false)
Loads dungeons from dbc and adds teleport coords.
Definition LFGMgr.cpp:292
void SetupGroupMember(uint64 guid, uint64 gguid)
Initializes player data after loading group data from DB.
Definition LFGMgr.cpp:2952
void LeaveSoloLfg(uint64 guid, uint32 queueID, bool disconnected=false)
Leaves Solo lfg.
Definition LFGMgr.cpp:838
uint32 GetDungeon(uint64 guid, bool asId=true)
Get current dungeon.
Definition LFGMgr.cpp:2093
LfgProposalContainer ProposalsStore
Current Proposals.
Definition LFGMgr.h:510
uint64 GetGroup(uint64 guid)
Gets player group.
Definition LFGMgr.cpp:2503
std::string const & GetComment(uint64 gguid)
Get current player comment (used for LFR).
Definition LFGMgr.cpp:2150
void SetTeam(uint64 guid, uint8 team)
Sets player team.
Definition LFGMgr.cpp:2495
void ClearQueueState(uint64 guid, char const *debugMsg)
Definition LFGMgr.cpp:2305
bool RestoreActiveQueue(uint64 guid)
Restores the active queue id from saved queue data.
Definition LFGMgr.cpp:2728
bool IsRaidFinderDungeon(uint32 dungeonId)
Check whether the dungeon id belongs to a Raid Finder queue entry.
Definition LFGMgr.cpp:2049
void LeaveLfg(uint64 guid, bool disconnected=false)
Leaves lfg.
Definition LFGMgr.cpp:778
uint8 RemovePlayerFromGroup(uint64 gguid, uint64 guid)
Removes a player from a group.
Definition LFGMgr.cpp:2480
LFGDungeonContainer LfgDungeonStore
Definition LFGMgr.h:507
LfgPlayerBootContainer BootsStore
Current player kicks.
Definition LFGMgr.h:511
LfgDungeonSet const & GetSelectedDungeons(uint64 guid)
Get selected dungeons.
Definition LFGMgr.cpp:2156
uint8 GetTeam(uint64 guid)
Definition LFGMgr.cpp:2473
void SetComment(uint64 guid, std::string const &comment)
Sets player lfr comment.
Definition LFGMgr.cpp:2392
void ClearGroupQueueState(uint64 guid, char const *debugMsg, bool sendUpdate)
Definition LFGMgr.cpp:2318
void UpdateBoot(uint64 guid, bool accept)
Updates player boot proposal with new player answer.
Definition LFGMgr.cpp:1666
void SetGroup(uint64 guid, uint64 group)
Sets player group.
Definition LFGMgr.cpp:2508
void SendLfgUpdateStatus(uint64 guid, LfgUpdateData const &data, bool party)
Definition LFGMgr.cpp:2549
void Update(uint32 diff)
Definition LFGMgr.cpp:410
bool m_debugRequirementOverride
bypasses LFG entry requirements for server-wide debugging
Definition LFGMgr.h:500
std::string DumpQueueInfo(bool full=false)
Dumps the state of the queue - Only for internal testing.
Definition LFGMgr.cpp:2789
bool selectedRandomLfgDungeon(uint64 guid)
Check if given guid applied for random dungeon.
Definition LFGMgr.cpp:2963
void SetDebugRequirementOverride(bool enabled)
Sets the server-wide debug override for dungeon and raid finder requirements.
Definition LFGMgr.h:365
LfgGuidSet const & GetPlayers(uint64 guid)
Definition LFGMgr.cpp:2513
void DecreaseKicksLeft(uint64 guid)
Definition LFGMgr.cpp:2404
time_t GetQueueJoinTime(uint64 guid)
Gets queue join time.
Definition LFGMgr.cpp:2629
LfgUpdateData GetLfgStatus(uint64 guid)
Returns current lfg status.
Definition LFGMgr.cpp:2678
void RestoreOrClearState(uint64 guid, char const *debugMsg)
Definition LFGMgr.cpp:2272
void UpdateRoleCheck(uint64 gguid, uint64 guid=0, uint8 roles=PLAYER_ROLE_NONE)
Updates the role check with player answer.
Definition LFGMgr.cpp:894
uint32 GetOptions()
Gets current lfg options.
Definition LFGMgr.cpp:2668
LfgState GetState(uint64 guid)
Get current lfg state.
Definition LFGMgr.cpp:2061
LfgLockMap const GetLockedDungeons(uint64 guid)
Get locked dungeons.
Definition LFGMgr.cpp:2162
void GetCompatibleDungeons(LfgDungeonSet &dungeons, LfgGuidSet const &players, LfgLockPartyMap &lockMap, bool isContinue)
Definition LFGMgr.cpp:1021
LfgDungeonSet const & GetDungeonsByRandom(uint32 randomdungeon)
Definition LFGMgr.cpp:2005
void ClearDungeonGroupState(uint64 guid, uint32 dbGuid, char const *debugMsg, bool sendUpdate)
Clears active dungeon finder state for an LFG dungeon group.
Definition LFGMgr.cpp:2354
bool MakeNewGroup(LfgProposal const &proposal)
Definition LFGMgr.cpp:1152
void SetRoles(uint64 guid, uint8 roles)
Sets player lfg roles.
Definition LFGMgr.cpp:2386
static void SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const &data)
Sends queue status to player.
Definition LFGMgr.cpp:2573
uint8 GetKicksLeft(uint64 gguid)
Get kicks left in current group.
Definition LFGMgr.cpp:2244
void SetDungeon(uint64 guid, uint32 dungeon)
Definition LFGMgr.cpp:2380
void SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const &boot)
Definition LFGMgr.cpp:2561
bool IsVoteKickActive(uint64 gguid)
Get current vote kick state.
Definition LFGMgr.cpp:2136
void LoadRewards()
Loads rewards for random dungeons.
Definition LFGMgr.cpp:224
void SendLfgUpdateProposal(uint64 guid, LfgProposal const &proposal)
Definition LFGMgr.cpp:2567
LfgCachedDungeonContainer CachedDungeonMapStore
Stores all dungeons by groupType.
Definition LFGMgr.h:504
bool isOptionEnabled(uint32 option)
Checks if given lfg option is enabled.
Definition LFGMgr.cpp:2663
void Clean()
Clears queue - Only for internal testing.
Definition LFGMgr.cpp:2649
LfgRoleCheckContainer RoleChecksStore
Current Role checks.
Definition LFGMgr.h:509
void TeleportDungeonGroupOut(Group *group)
Teleport online members of an LFG dungeon group back to their saved entry points.
Definition LFGMgr.cpp:1873
void SetOptions(uint32 options)
Sets new lfg options.
Definition LFGMgr.cpp:2673
uint32 m_lfgProposalId
used as internal counter for proposals
Definition LFGMgr.h:498
void AddPlayerToGroup(uint64 gguid, uint64 guid)
Adds player to group.
Definition LFGMgr.cpp:2485
LFGDungeonData const * GetLFGDungeon(uint32 id)
Definition LFGMgr.cpp:283
void RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdateType type)
Definition LFGMgr.cpp:1490
bool m_debugFlexRaidMinimumOverride
allows flexible raid queues to form below normal minimum for debugging
Definition LFGMgr.h:501
void SetVoteKick(uint64 guid, bool active)
Definition LFGMgr.cpp:2143
void TeleportPlayer(Player *player, bool out, bool fromOpcode=false, bool forceChangeInstance=false)
Teleport a player to/from selected dungeon.
Definition LFGMgr.cpp:1738
uint64 GetLeader(uint64 guid)
Get leader of the group (using internal data).
Definition LFGMgr.cpp:2523
void JoinLfg(Player *player, uint8 roles, LfgDungeonSet &dungeons, std::string const &comment)
Join Lfg with selected roles, dungeons and comment.
Definition LFGMgr.cpp:538
uint8 GetActiveQueueId(uint64 guid)
Get active LFG queue id.
Definition LFGMgr.cpp:2119
LfgRewardContainer RewardMapStore
Stores rewards for random dungeons.
Definition LFGMgr.h:506
void RestoreState(uint64 guid, char const *debugMsg)
Definition LFGMgr.cpp:2251
uint8 GetQueueId(uint64 guid)
Returns queue id.
Definition LFGMgr.cpp:2584
LFGQueue & GetQueue(uint64 guid)
Definition LFGMgr.cpp:2605
uint8 GetPlayerCount(uint64 guid)
Gets the player count of given group.
Definition LFGMgr.cpp:2518
void SendLfgJoinResult(uint64 guid, LfgJoinResultData const &data)
Definition LFGMgr.cpp:2555
LfgGroupDataContainer GroupsStore
Group data.
Definition LFGMgr.h:513
static bool HasIgnore(uint64 guid1, uint64 guid2)
Checks if given players are ignoring each other.
Definition LFGMgr.cpp:2528
bool IsDebugRequirementOverrideEnabled() const
Gets the server-wide debug override for dungeon and raid finder requirements.
Definition LFGMgr.h:363
void ClearState(uint64 guid, char const *debugMsg)
Definition LFGMgr.cpp:2300
void UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
Updates proposal to join dungeon with player answer.
Definition LFGMgr.cpp:1308
uint32 m_options
Stores config options.
Definition LFGMgr.h:499
void _LoadFromDB(Field *fields, uint64 guid)
Load Lfg group info from DB.
Definition LFGMgr.cpp:173
static bool CheckGroupRoles(LfgRolesMap &groles)
Checks if given roles match, modifies given roles map with new roles.
Definition LFGMgr.cpp:1073
void SetState(uint64 guid, LfgState state)
Definition LFGMgr.cpp:2280
void SetLeader(uint64 gguid, uint64 leader)
Sets the leader of the group.
Definition LFGMgr.cpp:2490
uint8 GetRoles(uint64 guid)
Get current player roles.
Definition LFGMgr.cpp:2112
LfgPlayerDataContainer PlayersStore
Player data.
Definition LFGMgr.h:512
LfgQueueContainer QueuesStore
Queues.
Definition LFGMgr.h:503
uint32 AddProposal(LfgProposal &proposal)
Add a new Proposal.
Definition LFGMgr.cpp:1294
void FinishDungeon(uint64 gguid, uint32 dungeonId)
Finish the dungeon for the given group. All check are performed using internal lfg data.
Definition LFGMgr.cpp:1903
bool IsSeasonActive(uint32 dungeonId)
Checks if Seasonal dungeon is active.
Definition LFGMgr.cpp:2773
bool AllQueued(LfgGuidList const &check)
Checks if all players are queued.
Definition LFGMgr.cpp:2611
LfgType GetDungeonType(uint32 dungeon)
Definition LFGMgr.cpp:2040
static bool CheckFlexibleRaidRoles(LfgRolesMap &groles, uint8 maxPlayers)
Assigns queued players to their preferred combat role for flexible raid queues.
Definition LFGMgr.cpp:1125
void _SaveToDB(uint64 guid, uint32 db_guid)
Definition LFGMgr.cpp:203
void SetDebugFlexRaidMinimumOverride(bool enabled)
Sets the server-wide debug override for flexible raid minimum group size.
Definition LFGMgr.h:369
std::string DumpGroupInfo(uint64 guid)
Dumps queue-scoped group state - Only for internal testing.
Definition LFGMgr.cpp:2903
std::string DumpPlayerInfo(uint64 guid)
Dumps queue-scoped player state - Only for internal testing.
Definition LFGMgr.cpp:2850
LfgState GetOldState(uint64 guid)
Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON).
Definition LFGMgr.cpp:2077
bool IsFlexibleRaidDungeon(uint32 dungeonId)
Check whether the dungeon id belongs to a flexible raid queue entry.
Definition LFGMgr.cpp:2055
void SendLfgRoleChosen(uint64 guid, uint64 pguid, uint8 roles)
Definition LFGMgr.cpp:2537
LfgReward const * GetRandomDungeonReward(uint32 dungeon, uint8 level)
Gets the random dungeon reward corresponding to given dungeon and player level.
Definition LFGMgr.cpp:2019
bool IsLfgGroup(uint64 guid)
Check if given group guid is lfg.
Definition LFGMgr.cpp:2579
bool IsDebugFlexRaidMinimumOverrideEnabled() const
Gets the server-wide debug override for flexible raid minimum group size.
Definition LFGMgr.h:367
bool SendActiveProposal(uint64 guid)
Resends an active dungeon proposal to a player if one exists.
Definition LFGMgr.cpp:2710
void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const &reason)
Inits new proposal to boot a player.
Definition LFGMgr.cpp:1615
uint32 m_QueueTimer
used to check interval of update
Definition LFGMgr.h:497
void RemoveGroupData(uint64 guid)
Removes saved group data.
Definition LFGMgr.cpp:2418
uint32 GetDungeonMapId(uint64 guid)
Get the map id of the current dungeon.
Definition LFGMgr.cpp:2100
LfgDungeonSet GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion)
Returns all random and seasonal dungeons for given level and expansion.
Definition LFGMgr.cpp:3024
uint8 GetLFGDungeonCategory(uint32 id)
Return Lfg dungeon category for given dungeon id.
Definition LFGMgr.cpp:3015
Definition LFG.cpp:11
UNORDERED_MAP< uint32, LFGDungeonData > LFGDungeonContainer
Definition LFGMgr.h:146
LfgOptions
Definition LFGMgr.h:25
@ LFG_OPTION_ENABLE_DUNGEON_FINDER
Definition LFGMgr.h:26
@ LFG_OPTION_ENABLE_RAID_BROWSER
Definition LFGMgr.h:27
LfgTeleportError
Teleport errors.
Definition LFGMgr.h:79
@ LFG_TELEPORTERROR_INVALID_LOCATION
Definition LFGMgr.h:86
@ LFG_TELEPORTERROR_OK
Definition LFGMgr.h:81
@ LFG_TELEPORTERROR_FATIGUE
Definition LFGMgr.h:85
@ LFG_TELEPORTERROR_PLAYER_DEAD
Definition LFGMgr.h:82
@ LFG_TELEPORTERROR_CHARMING
Definition LFGMgr.h:88
@ LFG_TELEPORTERROR_FALLING
Definition LFGMgr.h:83
@ LFG_TELEPORTERROR_IN_COMBAT
Definition LFGMgr.h:87
@ LFG_TELEPORTERROR_IN_VEHICLE
Definition LFGMgr.h:84
LfgState
Definition LFG.h:61
@ LFG_STATE_NONE
Definition LFG.h:62
LfgUpdateType
Definition LFG.h:39
@ LFG_UPDATETYPE_DEFAULT
Definition LFG.h:40
LFGMgrEnum
Definition LFGMgr.h:31
@ LFG_SPELL_DUNGEON_COOLDOWN
Definition LFGMgr.h:36
@ LFG_TIME_BOOT
Definition LFGMgr.h:33
@ LFG_TIME_PROPOSAL
Definition LFGMgr.h:34
@ LFG_GROUP_KICK_VOTES_NEEDED
Definition LFGMgr.h:39
@ LFG_TIME_ROLECHECK
Definition LFGMgr.h:32
@ LFG_SPELL_LUCK_OF_THE_DRAW
Definition LFGMgr.h:38
@ LFG_QUEUEUPDATE_INTERVAL
Definition LFGMgr.h:35
@ LFG_SPELL_DUNGEON_DESERTER
Definition LFGMgr.h:37
LfgType
Determines the type of instance.
Definition LFGMgr.h:62
@ LFG_TYPE_NONE
Definition LFGMgr.h:63
@ LFG_TYPE_RANDOM
Definition LFGMgr.h:66
@ LFG_TYPE_RAID
Definition LFGMgr.h:65
@ LFG_TYPE_DUNGEON
Definition LFGMgr.h:64
LfgAnswer
Answer state (Also used to check compatibilites).
Definition LFG.h:91
@ LFG_ANSWER_PENDING
Definition LFG.h:92
std::map< uint64, LfgPlayerBoot > LfgPlayerBootContainer
Definition LFGMgr.h:143
std::map< uint32, LfgLockData > LfgLockMap
Definition LFG.h:108
std::map< uint64, LfgProposalPlayer > LfgProposalPlayerContainer
Definition LFGMgr.h:142
std::map< uint8, LfgDungeonSet > LfgCachedDungeonContainer
Definition LFGMgr.h:138
std::map< uint8, LFGQueue > LfgQueueContainer
Definition LFGMgr.h:135
std::set< uint32 > LfgDungeonSet
Definition LFG.h:107
std::map< uint64, LfgAnswer > LfgAnswerContainer
Definition LFGMgr.h:139
std::map< uint64, LfgGroupData > LfgGroupDataContainer
Definition LFGMgr.h:144
std::map< uint64, LfgRoleCheck > LfgRoleCheckContainer
Definition LFGMgr.h:140
std::list< uint64 > LfgGuidList
Definition LFG.h:111
LfgRoleCheckState
Role check states.
Definition LFGMgr.h:116
@ LFG_ROLECHECK_WRONG_ROLES
Definition LFGMgr.h:121
@ LFG_ROLECHECK_MISSING_ROLE
Definition LFGMgr.h:120
@ LFG_ROLECHECK_ABORTED
Definition LFGMgr.h:122
@ LFG_ROLECHECK_DEFAULT
Definition LFGMgr.h:117
@ LFG_ROLECHECK_FINISHED
Definition LFGMgr.h:118
@ LFG_ROLECHECK_NO_ROLE
Definition LFGMgr.h:123
@ LFG_ROLECHECK_INITIALITING
Definition LFGMgr.h:119
LfgFlags
Definition LFGMgr.h:43
@ LFG_FLAG_NONE
Definition LFGMgr.h:44
@ LFG_FLAG_SEASONAL
Definition LFGMgr.h:47
@ LFG_FLAG_UNK7
Definition LFGMgr.h:52
@ LFG_FLAG_UNK12
Definition LFGMgr.h:57
@ LFG_FLAG_UNK9
Definition LFGMgr.h:54
@ LFG_FLAG_UNK4
Definition LFGMgr.h:49
@ LFG_FLAG_UNK3
Definition LFGMgr.h:48
@ LFG_FLAG_UNK10
Definition LFGMgr.h:55
@ LFG_FLAG_UNK11
Definition LFGMgr.h:56
@ LFG_FLAG_UNK8
Definition LFGMgr.h:53
@ LFG_FLAG_UNK6
Definition LFGMgr.h:51
@ LFG_FLAG_UNK5
Definition LFGMgr.h:50
@ LFG_FLAG_UNK2
Definition LFGMgr.h:46
@ LFG_FLAG_UNK1
Definition LFGMgr.h:45
std::pair< LfgRewardContainer::const_iterator, LfgRewardContainer::const_iterator > LfgRewardContainerBounds
Definition LFGMgr.h:137
std::map< uint64, uint8 > LfgRolesMap
Definition LFG.h:112
std::map< uint64, LfgPlayerData > LfgPlayerDataContainer
Definition LFGMgr.h:145
std::map< uint32, LfgProposal > LfgProposalContainer
Definition LFGMgr.h:141
@ PLAYER_ROLE_NONE
Definition LFG.h:23
std::multimap< uint32, LfgReward const * > LfgRewardContainer
Definition LFGMgr.h:136
std::set< uint64 > LfgGuidSet
Definition LFG.h:110
std::map< uint64, LfgLockMap > LfgLockPartyMap
Definition LFG.h:109
LfgProposalState
Proposal states.
Definition LFGMgr.h:71
@ LFG_PROPOSAL_SUCCESS
Definition LFGMgr.h:74
@ LFG_PROPOSAL_FAILED
Definition LFGMgr.h:73
@ LFG_PROPOSAL_INITIATING
Definition LFGMgr.h:72
LfgJoinResult
Queue join results.
Definition LFGMgr.h:93
@ LFG_JOIN_TOO_MUCH_MEMBERS
Definition LFGMgr.h:109
@ LFG_JOIN_MULTI_REALM
Definition LFGMgr.h:101
@ LFG_JOIN_DISCONNECTED
Definition LFGMgr.h:102
@ LFG_JOIN_DUNGEON_INVALID
Definition LFGMgr.h:104
@ LFG_JOIN_ROLE_CHECK_FAILED
Definition LFGMgr.h:111
@ LFG_JOIN_USING_BG_SYSTEM
Definition LFGMgr.h:110
@ LFG_JOIN_INTERNAL_ERROR
Definition LFGMgr.h:98
@ LFG_JOIN_MIXED_RAID_DUNGEON
Definition LFGMgr.h:100
@ LFG_JOIN_DESERTER
Definition LFGMgr.h:105
@ LFG_JOIN_RANDOM_COOLDOWN
Definition LFGMgr.h:107
@ LFG_JOIN_PARTY_INFO_FAILED
Definition LFGMgr.h:103
@ LFG_JOIN_PARTY_RANDOM_COOLDOWN
Definition LFGMgr.h:108
@ LFG_JOIN_OK
Definition LFGMgr.h:95
@ LFG_JOIN_GROUP_FULL
Definition LFGMgr.h:97
@ LFG_JOIN_PARTY_DESERTER
Definition LFGMgr.h:106
@ LFG_JOIN_FAILED
Definition LFGMgr.h:96
@ LFG_JOIN_NOT_MEET_REQS
Definition LFGMgr.h:99
uint32 requiredItemLevel
Definition LFGMgr.h:287
std::string name
Definition LFGMgr.h:278
uint32 Entry() const
Definition LFGMgr.h:292
LFGDungeonData(LFGDungeonEntry const *dbc)
Definition LFGMgr.h:271
DifficultyID difficulty
Definition LFGMgr.h:285
LfgJoinResultData(LfgJoinResult _result=LFG_JOIN_OK, LfgRoleCheckState _state=LFG_ROLECHECK_DEFAULT)
Definition LFGMgr.h:151
LfgRoleCheckState state
Definition LFGMgr.h:154
LfgJoinResult result
Definition LFGMgr.h:153
LfgLockPartyMap lockmap
Definition LFGMgr.h:155
Stores information of a current vote to kick someone from a group.
Definition LFGMgr.h:258
uint64 victim
Player guid to be kicked (can't vote).
Definition LFGMgr.h:262
std::string reason
kick reason
Definition LFGMgr.h:263
time_t cancelTime
Time left to vote.
Definition LFGMgr.h:259
LfgAnswerContainer votes
Player votes (-1 not answer | 0 Not agree | 1 agree).
Definition LFGMgr.h:261
bool inProgress
Vote in progress.
Definition LFGMgr.h:260
Quest const * quest
Definition LFGMgr.h:202
LfgPlayerRewardData(uint32 random, uint32 current, bool _done, Quest const *_quest)
Definition LFGMgr.h:197
Stores group data related to proposal to join.
Definition LFGMgr.h:227
LfgGuidList showorder
Show order in update window.
Definition LFGMgr.h:241
uint32 dungeonId
Dungeon to join.
Definition LFGMgr.h:233
uint64 group
Proposal group (0 if new).
Definition LFGMgr.h:235
uint32 id
Proposal Id.
Definition LFGMgr.h:232
LfgGuidList queues
Queue Ids to remove/readd.
Definition LFGMgr.h:240
uint32 encounters
Dungeon Encounters.
Definition LFGMgr.h:238
uint64 leader
Leader guid.
Definition LFGMgr.h:236
LfgProposalPlayerContainer players
Players data.
Definition LFGMgr.h:242
bool isNew
Determines if it's new group or not.
Definition LFGMgr.h:239
LfgProposalState state
State of the proposal.
Definition LFGMgr.h:234
LfgProposal(uint32 dungeon=0)
Definition LFGMgr.h:228
time_t cancelTime
Time when we will cancel this proposal.
Definition LFGMgr.h:237
uint8 role
Proposed role.
Definition LFGMgr.h:220
LfgAnswer accept
Accept status (-1 not answer | 0 Not agree | 1 agree).
Definition LFGMgr.h:221
uint64 group
Original group guid. 0 if no original group.
Definition LFGMgr.h:222
LfgQueueStatusData(uint8 _queueId=0, uint32 _dungeonId=0, time_t _joinTime=0, int32 _waitTime=-1, int32 _waitTimeAvg=-1, int32 _waitTimeTank=-1, int32 _waitTimeHealer=-1, int32 _waitTimeDps=-1, uint32 _queuedTime=0, uint8 _tanks=0, uint8 _healers=0, uint8 _dps=0)
Definition LFGMgr.h:176
Reward info.
Definition LFGMgr.h:207
uint32 firstQuest
Definition LFGMgr.h:212
uint32 otherQuest
Definition LFGMgr.h:213
uint32 maxLevel
Definition LFGMgr.h:211
LfgReward(uint32 _maxLevel=0, uint32 _firstQuest=0, uint32 _otherQuest=0)
Definition LFGMgr.h:208
Stores all rolecheck info of a group that wants to join.
Definition LFGMgr.h:247
LfgDungeonSet dungeons
Dungeons group is applying for (expanded random dungeons).
Definition LFGMgr.h:251
LfgRolesMap roles
Player selected roles.
Definition LFGMgr.h:249
uint64 leader
Leader of the group.
Definition LFGMgr.h:253
LfgRoleCheckState state
State of the rolecheck.
Definition LFGMgr.h:250
time_t cancelTime
Time when the rolecheck will fail.
Definition LFGMgr.h:248
uint32 rDungeonId
Random Dungeon Id.
Definition LFGMgr.h:252
LfgUpdateData(LfgUpdateType _type=LFG_UPDATETYPE_DEFAULT)
Definition LFGMgr.h:161
LfgDungeonSet dungeons
Definition LFGMgr.h:169
LfgUpdateType updateType
Definition LFGMgr.h:167
LfgUpdateData(LfgUpdateType _type, LfgState _state, LfgDungeonSet const &_dungeons, std::string const &_comment="")
Definition LFGMgr.h:164
std::string comment
Definition LFGMgr.h:170
LfgUpdateData(LfgUpdateType _type, LfgDungeonSet const &_dungeons, std::string const &_comment)
Definition LFGMgr.h:162
LfgState state
Definition LFGMgr.h:168