TrinityCore
Loading...
Searching...
No Matches
lfg::LFGMgr Class Reference

#include <LFGMgr.h>

Public Member Functions

 LFGMgr (LFGMgr const &right)=delete
 
 LFGMgr (LFGMgr &&right)=delete
 
LFGMgr & operator= (LFGMgr const &right)=delete
 
LFGMgr & operator= (LFGMgr &&right)=delete
 
void Update (uint32 diff)
 
void OnDungeonEncounterDone (ObjectGuid gguid, std::span< uint32 const > dungeonEncounters, Map const *currMap)
 Check dungeon completion on encounter completion.
 
void FinishDungeon (ObjectGuid gguid, uint32 dungeonId, Map const *currMap)
 Finish the dungeon for the given group. All check are performed using internal lfg data.
 
void LoadRewards ()
 Loads rewards for random dungeons.
 
void LoadLFGDungeons ()
 Loads dungeons from dbc and adds teleport coords.
 
bool selectedRandomLfgDungeon (ObjectGuid guid)
 Check if given guid applied for random dungeon.
 
bool inLfgDungeonMap (ObjectGuid guid, uint32 map, Difficulty difficulty)
 Check if given guid applied for given map and difficulty. Used to know.
 
LfgDungeonSet const & GetSelectedDungeons (ObjectGuid guid)
 Get selected dungeons.
 
uint32 GetSelectedRandomDungeon (ObjectGuid guid)
 Get selected random dungeon.
 
LfgState GetState (ObjectGuid guid)
 Get current lfg state.
 
bool IsVoteKickActive (ObjectGuid gguid)
 Get current vote kick state.
 
uint32 GetDungeon (ObjectGuid guid, bool asId=true)
 Get current dungeon.
 
uint32 GetDungeonMapId (ObjectGuid guid)
 Get the map id of the current dungeon.
 
uint8 GetKicksLeft (ObjectGuid gguid)
 Get kicks left in current group.
 
void _LoadFromDB (Field *fields, ObjectGuid guid)
 Load Lfg group info from DB.
 
void SetupGroupMember (ObjectGuid guid, ObjectGuid gguid)
 Initializes player data after loading group data from DB.
 
uint32 GetLFGDungeonEntry (uint32 id)
 Return Lfg dungeon entry for given dungeon id.
 
uint8 GetRoles (ObjectGuid guid)
 Get current player roles.
 
uint32 GetOptions ()
 Gets current lfg options.
 
void SetOptions (uint32 options)
 Sets new lfg options.
 
bool isOptionEnabled (uint32 option)
 Checks if given lfg option is enabled.
 
void Clean ()
 Clears queue - Only for internal testing.
 
std::string DumpQueueInfo (bool full=false)
 Dumps the state of the queue - Only for internal testing.
 
ObjectGuid GetLeader (ObjectGuid guid)
 Get leader of the group (using internal data)
 
void SetTeam (ObjectGuid guid, uint8 team)
 Sets player team.
 
void SetGroup (ObjectGuid guid, ObjectGuid group)
 Sets player group.
 
ObjectGuid GetGroup (ObjectGuid guid)
 Gets player group.
 
void SetLeader (ObjectGuid gguid, ObjectGuid leader)
 Sets the leader of the group.
 
void RemoveGroupData (ObjectGuid guid)
 Removes saved group data.
 
uint8 RemovePlayerFromGroup (ObjectGuid gguid, ObjectGuid guid)
 Removes a player from a group.
 
void AddPlayerToGroup (ObjectGuid gguid, ObjectGuid guid)
 Adds player to group.
 
LfgLockMap GetLockedDungeons (ObjectGuid guid)
 Get locked dungeons.
 
LfgUpdateData GetLfgStatus (ObjectGuid guid)
 Returns current lfg status.
 
bool IsSeasonActive (uint32 dungeonId)
 Checks if Seasonal dungeon is active.
 
LfgReward const * GetRandomDungeonReward (uint32 dungeon, uint8 level)
 Gets the random dungeon reward corresponding to given dungeon and player level.
 
LfgDungeonSet GetRandomAndSeasonalDungeons (uint8 level, uint8 expansion, std::span< uint32 const > contentTuningReplacementConditionMask)
 Returns all random and seasonal dungeons for given level and expansion.
 
void TeleportPlayer (Player *player, bool out, bool fromOpcode=false)
 Teleport a player to/from selected dungeon.
 
void InitBoot (ObjectGuid gguid, ObjectGuid kguid, ObjectGuid vguid, std::string const &reason)
 Inits new proposal to boot a player.
 
void UpdateBoot (ObjectGuid guid, bool accept)
 Updates player boot proposal with new player answer.
 
void UpdateProposal (uint32 proposalId, ObjectGuid guid, bool accept)
 Updates proposal to join dungeon with player answer.
 
void UpdateRoleCheck (ObjectGuid gguid, ObjectGuid guid=ObjectGuid::Empty, uint8 roles=PLAYER_ROLE_NONE)
 Updates the role check with player answer.
 
void SetRoles (ObjectGuid guid, uint8 roles)
 Sets player lfg roles.
 
void JoinLfg (Player *player, uint8 roles, LfgDungeonSet &dungeons)
 Join Lfg with selected roles, dungeons and comment.
 
void LeaveLfg (ObjectGuid guid, bool disconnected=false)
 Leaves lfg.
 
WorldPackets::LFG::RideTicket const * GetTicket (ObjectGuid guid) const
 Gets unique join queue data.
 
LfgState GetOldState (ObjectGuid guid)
 Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
 
bool IsLfgGroup (ObjectGuid guid)
 Check if given group guid is lfg.
 
uint8 GetPlayerCount (ObjectGuid guid)
 Gets the player count of given group.
 
uint32 AddProposal (LfgProposal &proposal)
 Add a new Proposal.
 
uint8 GetQueueId (ObjectGuid guid)
 Returns queue id.
 
bool AllQueued (GuidList const &check)
 Checks if all players are queued.
 
time_t GetQueueJoinTime (ObjectGuid guid)
 Gets queue join time.
 

Static Public Member Functions

static LFGMgr * instance ()
 
static bool CheckGroupRoles (LfgRolesMap &groles)
 Checks if given roles match, modifies given roles map with new roles.
 
static bool HasIgnore (ObjectGuid guid1, ObjectGuid guid2)
 Checks if given players are ignoring each other.
 
static void SendLfgQueueStatus (ObjectGuid guid, LfgQueueStatusData const &data)
 Sends queue status to player.
 

Private Member Functions

 LFGMgr ()
 
 ~LFGMgr ()
 
uint8 GetTeam (ObjectGuid guid)
 
uint8 FilterClassRoles (Player *player, uint8 roles)
 
void RestoreState (ObjectGuid guid, char const *debugMsg)
 
void ClearState (ObjectGuid guid, char const *debugMsg)
 
void SetDungeon (ObjectGuid guid, uint32 dungeon)
 
void SetSelectedDungeons (ObjectGuid guid, LfgDungeonSet const &dungeons)
 
void DecreaseKicksLeft (ObjectGuid guid)
 
void SetTicket (ObjectGuid guid, WorldPackets::LFG::RideTicket const &ticket)
 
void SetState (ObjectGuid guid, LfgState state)
 
void SetVoteKick (ObjectGuid gguid, bool active)
 
void RemovePlayerData (ObjectGuid guid)
 
void GetCompatibleDungeons (LfgDungeonSet *dungeons, GuidSet const &players, LfgLockPartyMap *lockMap, std::vector< std::string_view > *playersMissingRequirement, bool isContinue)
 
void _SaveToDB (ObjectGuid guid, uint32 db_guid)
 
LFGDungeonData const * GetLFGDungeon (uint32 id)
 
void RemoveProposal (LfgProposalContainer::iterator itProposal, LfgUpdateType type)
 
void MakeNewGroup (LfgProposal const &proposal)
 
LFGQueue & GetQueue (ObjectGuid guid)
 
LfgDungeonSet const & GetDungeonsByRandom (uint32 randomdungeon)
 
LfgType GetDungeonType (uint32 dungeon)
 
void SendLfgBootProposalUpdate (ObjectGuid guid, LfgPlayerBoot const &boot)
 
void SendLfgJoinResult (ObjectGuid guid, LfgJoinResultData const &data)
 
void SendLfgRoleChosen (ObjectGuid guid, ObjectGuid pguid, uint8 roles)
 
void SendLfgRoleCheckUpdate (ObjectGuid guid, LfgRoleCheck const &roleCheck)
 
void SendLfgUpdateStatus (ObjectGuid guid, LfgUpdateData const &data, bool party)
 
void SendLfgUpdateProposal (ObjectGuid guid, LfgProposal const &proposal)
 
GuidSet const & GetPlayers (ObjectGuid guid)
 

Private Attributes

uint32 m_QueueTimer
 
uint32 m_lfgProposalId
 used to check interval of update
 
uint32 m_options
 used as internal counter for proposals
 
LfgQueueContainer QueuesStore
 Stores config options.
 
LfgCachedDungeonContainer CachedDungeonMapStore
 Queues.
 
LfgRewardContainer RewardMapStore
 Stores all dungeons by groupType.
 
LFGDungeonContainer LfgDungeonStore
 Stores rewards for random dungeons.
 
LfgRoleCheckContainer RoleChecksStore
 
LfgProposalContainer ProposalsStore
 Current Role checks.
 
LfgPlayerBootContainer BootsStore
 Current Proposals.
 
LfgPlayerDataContainer PlayersStore
 Current player kicks.
 
LfgGroupDataContainer GroupsStore
 Player data.
 

Detailed Description

Definition at line 318 of file LFGMgr.h.

Constructor & Destructor Documentation

◆ LFGMgr() [1/3]

lfg::LFGMgr::LFGMgr ( )
private

Definition at line 60 of file LFGMgr.cpp.

◆ ~LFGMgr()

lfg::LFGMgr::~LFGMgr ( )
private

Definition at line 65 of file LFGMgr.cpp.

References RewardMapStore.

◆ LFGMgr() [2/3]

lfg::LFGMgr::LFGMgr ( LFGMgr const &  right)
delete

◆ LFGMgr() [3/3]

lfg::LFGMgr::LFGMgr ( LFGMgr &&  right)
delete

Member Function Documentation

◆ _LoadFromDB()

void lfg::LFGMgr::_LoadFromDB ( Field *  fields,
ObjectGuid  guid 
)

◆ _SaveToDB()

void lfg::LFGMgr::_SaveToDB ( ObjectGuid  guid,
uint32  db_guid 
)
private

◆ AddPlayerToGroup()

void lfg::LFGMgr::AddPlayerToGroup ( ObjectGuid  gguid,
ObjectGuid  guid 
)

Adds player to group.

Definition at line 1949 of file LFGMgr.cpp.

References GroupsStore.

Referenced by SetupGroupMember().

◆ AddProposal()

uint32 lfg::LFGMgr::AddProposal ( LfgProposal &  proposal)

Add a new Proposal.

Definition at line 1038 of file LFGMgr.cpp.

References lfg::LfgProposal::id, m_lfgProposalId, and ProposalsStore.

◆ AllQueued()

bool lfg::LFGMgr::AllQueued ( GuidList const &  check)

Checks if all players are queued.

Definition at line 2067 of file LFGMgr.cpp.

References GetState(), lfg::GetStateString(), lfg::LFG_STATE_PROPOSAL, lfg::LFG_STATE_QUEUED, and TC_LOG_DEBUG.

◆ CheckGroupRoles()

bool lfg::LFGMgr::CheckGroupRoles ( LfgRolesMap &  groles)
static

Checks if given roles match, modifies given roles map with new roles.

Check if a group can be formed with the given group roles

Parameters
[in]grolesMap of roles to check
Returns
True if roles are compatible

Definition at line 878 of file LFGMgr.cpp.

References CheckGroupRoles(), lfg::LFG_DPS_NEEDED, lfg::LFG_HEALERS_NEEDED, lfg::LFG_TANKS_NEEDED, lfg::PLAYER_ROLE_DAMAGE, lfg::PLAYER_ROLE_HEALER, lfg::PLAYER_ROLE_NONE, and lfg::PLAYER_ROLE_TANK.

Referenced by lfg::LFGQueue::CheckCompatibility(), CheckGroupRoles(), and UpdateRoleCheck().

◆ Clean()

void lfg::LFGMgr::Clean ( )

Clears queue - Only for internal testing.

Definition at line 2097 of file LFGMgr.cpp.

References QueuesStore.

◆ ClearState()

void lfg::LFGMgr::ClearState ( ObjectGuid  guid,
char const *  debugMsg 
)
private

◆ DecreaseKicksLeft()

void lfg::LFGMgr::DecreaseKicksLeft ( ObjectGuid  guid)
private

Definition at line 1886 of file LFGMgr.cpp.

References GroupsStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by UpdateBoot().

◆ DumpQueueInfo()

std::string lfg::LFGMgr::DumpQueueInfo ( bool  full = false)

Dumps the state of the queue - Only for internal testing.

Definition at line 2139 of file LFGMgr.cpp.

References QueuesStore.

◆ FilterClassRoles()

uint8 lfg::LFGMgr::FilterClassRoles ( Player *  player,
uint8  roles 
)
private

Definition at line 1934 of file LFGMgr.cpp.

References Unit::GetClass(), MAX_SPECIALIZATIONS, lfg::PLAYER_ROLE_LEADER, and sDB2Manager.

Referenced by JoinLfg(), and UpdateRoleCheck().

◆ FinishDungeon()

◆ GetCompatibleDungeons()

void lfg::LFGMgr::GetCompatibleDungeons ( LfgDungeonSet *  dungeons,
GuidSet const &  players,
LfgLockPartyMap *  lockMap,
std::vector< std::string_view > *  playersMissingRequirement,
bool  isContinue 
)
private

Given a list of dungeons remove the dungeons players have restrictions.

Parameters
[in,out]dungeonsDungeons to check restrictions
[in]playersSet of players to check their dungeon restrictions
[out]lockMapMap of players Lock status info of given dungeons (Empty if dungeons is not empty)

Definition at line 818 of file LFGMgr.cpp.

References ASSERT, lfg::LFGDungeonData::difficulty, ObjectAccessor::FindConnectedPlayer(), GetLFGDungeon(), GetLockedDungeons(), WorldObject::GetName(), lfg::LFG_LOCKSTATUS_RAID_LOCKED, lfg::LFGDungeonData::map, and sInstanceLockMgr.

Referenced by JoinLfg().

◆ GetDungeon()

uint32 lfg::LFGMgr::GetDungeon ( ObjectGuid  guid,
bool  asId = true 
)

◆ GetDungeonMapId()

uint32 lfg::LFGMgr::GetDungeonMapId ( ObjectGuid  guid)

Get the map id of the current dungeon.

Definition at line 1686 of file LFGMgr.cpp.

References GetLFGDungeon(), GroupsStore, TC_LOG_TRACE, and ObjectGuid::ToString().

◆ GetDungeonsByRandom()

LfgDungeonSet const & lfg::LFGMgr::GetDungeonsByRandom ( uint32  randomdungeon)
private

Get the dungeon list that can be done given a random dungeon entry.

Parameters
[in]randomdungeonRandom dungeon id (if value = 0 will return all dungeons)
Returns
Set of dungeons that can be done.

Definition at line 1591 of file LFGMgr.cpp.

References CachedDungeonMapStore, GetLFGDungeon(), and lfg::LFGDungeonData::group.

Referenced by GetLockedDungeons(), and JoinLfg().

◆ GetDungeonType()

LfgType lfg::LFGMgr::GetDungeonType ( uint32  dungeonId)
private

Given a Dungeon id returns the dungeon Type

Parameters
[in]dungeondungeon id
Returns
Dungeon type

Definition at line 1626 of file LFGMgr.cpp.

References GetLFGDungeon(), lfg::LFG_TYPE_NONE, and lfg::LFGDungeonData::type.

Referenced by JoinLfg().

◆ GetGroup()

ObjectGuid lfg::LFGMgr::GetGroup ( ObjectGuid  guid)

Gets player group.

Definition at line 1967 of file LFGMgr.cpp.

References PlayersStore.

Referenced by inLfgDungeonMap(), LeaveLfg(), MakeNewGroup(), Update(), and UpdateBoot().

◆ GetKicksLeft()

uint8 lfg::LFGMgr::GetKicksLeft ( ObjectGuid  gguid)

Get kicks left in current group.

Definition at line 1806 of file LFGMgr.cpp.

References GroupsStore, TC_LOG_TRACE, and ObjectGuid::ToString().

◆ GetLeader()

ObjectGuid lfg::LFGMgr::GetLeader ( ObjectGuid  guid)

Get leader of the group (using internal data)

Definition at line 1987 of file LFGMgr.cpp.

References GroupsStore.

Referenced by LeaveLfg().

◆ GetLFGDungeon()

◆ GetLFGDungeonEntry()

uint32 lfg::LFGMgr::GetLFGDungeonEntry ( uint32  id)

Return Lfg dungeon entry for given dungeon id.

Definition at line 2194 of file LFGMgr.cpp.

References GetLFGDungeon().

Referenced by LoadRewards().

◆ GetLfgStatus()

LfgUpdateData lfg::LFGMgr::GetLfgStatus ( ObjectGuid  guid)

◆ GetLockedDungeons()

◆ GetOldState()

LfgState lfg::LFGMgr::GetOldState ( ObjectGuid  guid)

Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)

Definition at line 1652 of file LFGMgr.cpp.

References GroupsStore, ObjectGuid::IsParty(), PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by LeaveLfg().

◆ GetOptions()

uint32 lfg::LFGMgr::GetOptions ( )

Gets current lfg options.

Definition at line 2107 of file LFGMgr.cpp.

References m_options.

◆ GetPlayerCount()

uint8 lfg::LFGMgr::GetPlayerCount ( ObjectGuid  guid)

Gets the player count of given group.

Definition at line 1982 of file LFGMgr.cpp.

References GroupsStore.

◆ GetPlayers()

GuidSet const & lfg::LFGMgr::GetPlayers ( ObjectGuid  guid)
private

Definition at line 1977 of file LFGMgr.cpp.

References GroupsStore.

Referenced by FinishDungeon(), GetQueueId(), InitBoot(), and LeaveLfg().

◆ GetQueue()

LFGQueue & lfg::LFGMgr::GetQueue ( ObjectGuid  guid)
private

Definition at line 2061 of file LFGMgr.cpp.

References GetQueueId(), and QueuesStore.

Referenced by JoinLfg(), LeaveLfg(), RemoveProposal(), UpdateProposal(), and UpdateRoleCheck().

◆ GetQueueId()

uint8 lfg::LFGMgr::GetQueueId ( ObjectGuid  guid)

Returns queue id.

Definition at line 2048 of file LFGMgr.cpp.

References ObjectGuid::Empty, GetPlayers(), GetTeam(), ObjectGuid::IsEmpty(), and ObjectGuid::IsParty().

Referenced by GetQueue(), GetQueueJoinTime(), and JoinLfg().

◆ GetQueueJoinTime()

time_t lfg::LFGMgr::GetQueueJoinTime ( ObjectGuid  guid)

Gets queue join time.

Definition at line 2086 of file LFGMgr.cpp.

References GetQueueId(), and QueuesStore.

◆ GetRandomAndSeasonalDungeons()

LfgDungeonSet lfg::LFGMgr::GetRandomAndSeasonalDungeons ( uint8  level,
uint8  expansion,
std::span< uint32 const >  contentTuningReplacementConditionMask 
)

◆ GetRandomDungeonReward()

LfgReward const * lfg::LFGMgr::GetRandomDungeonReward ( uint32  dungeon,
uint8  level 
)

Gets the random dungeon reward corresponding to given dungeon and player level.

Get the reward of a given random dungeon at a certain level

Parameters
[in]dungeondungeon id
[in]levelPlayer level
Returns
Reward

Definition at line 1605 of file LFGMgr.cpp.

References RewardMapStore.

Referenced by FinishDungeon().

◆ GetRoles()

uint8 lfg::LFGMgr::GetRoles ( ObjectGuid  guid)

Get current player roles.

Definition at line 1699 of file LFGMgr.cpp.

References PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by UpdateProposal().

◆ GetSelectedDungeons()

◆ GetSelectedRandomDungeon()

uint32 lfg::LFGMgr::GetSelectedRandomDungeon ( ObjectGuid  guid)

Get selected random dungeon.

Definition at line 1712 of file LFGMgr.cpp.

References GetLFGDungeon(), GetSelectedDungeons(), GetState(), lfg::LFG_STATE_NONE, lfg::LFG_TYPE_RANDOM, and lfg::LFGDungeonData::type.

◆ GetState()

◆ GetTeam()

uint8 lfg::LFGMgr::GetTeam ( ObjectGuid  guid)
private

Definition at line 1927 of file LFGMgr.cpp.

References PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by GetQueueId().

◆ GetTicket()

WorldPackets::LFG::RideTicket const * lfg::LFGMgr::GetTicket ( ObjectGuid  guid) const

Gets unique join queue data.

Definition at line 703 of file LFGMgr.cpp.

References PlayersStore.

◆ HasIgnore()

bool lfg::LFGMgr::HasIgnore ( ObjectGuid  guid1,
ObjectGuid  guid2 
)
static

Checks if given players are ignoring each other.

Definition at line 1992 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer(), WorldSession::GetAccountGUID(), Player::GetSession(), Player::GetSocial(), and PlayerSocial::HasIgnore().

◆ InitBoot()

void lfg::LFGMgr::InitBoot ( ObjectGuid  gguid,
ObjectGuid  kicker,
ObjectGuid  victim,
std::string const &  reason 
)

Inits new proposal to boot a player.

Initialize a boot kick vote

Parameters
[in]gguidGroup the vote kicks belongs to
[in]kickerKicker guid
[in]victimVictim guid
[in]reasonKick reason

Definition at line 1260 of file LFGMgr.cpp.

References BootsStore, lfg::LfgPlayerBoot::cancelTime, GameTime::GetGameTime(), GetPlayers(), lfg::LfgPlayerBoot::inProgress, lfg::LFG_ANSWER_AGREE, lfg::LFG_ANSWER_DENY, lfg::LFG_ANSWER_PENDING, lfg::LFG_TIME_BOOT, lfg::LfgPlayerBoot::reason, SendLfgBootProposalUpdate(), SetVoteKick(), lfg::LfgPlayerBoot::victim, and lfg::LfgPlayerBoot::votes.

◆ inLfgDungeonMap()

bool lfg::LFGMgr::inLfgDungeonMap ( ObjectGuid  guid,
uint32  map,
Difficulty  difficulty 
)

Check if given guid applied for given map and difficulty. Used to know.

Definition at line 2181 of file LFGMgr.cpp.

References GetDungeon(), GetGroup(), GetLFGDungeon(), and ObjectGuid::IsParty().

◆ instance()

LFGMgr * lfg::LFGMgr::instance ( )
static

Definition at line 281 of file LFGMgr.cpp.

References instance().

Referenced by instance().

◆ IsLfgGroup()

bool lfg::LFGMgr::IsLfgGroup ( ObjectGuid  guid)

Check if given group guid is lfg.

Definition at line 2043 of file LFGMgr.cpp.

References GroupsStore, ObjectGuid::IsEmpty(), and ObjectGuid::IsParty().

◆ isOptionEnabled()

bool lfg::LFGMgr::isOptionEnabled ( uint32  option)

Checks if given lfg option is enabled.

Definition at line 2102 of file LFGMgr.cpp.

References m_options.

Referenced by Update().

◆ IsSeasonActive()

bool lfg::LFGMgr::IsSeasonActive ( uint32  dungeonId)

Checks if Seasonal dungeon is active.

Definition at line 2123 of file LFGMgr.cpp.

References HOLIDAY_BREWFEST, HOLIDAY_HALLOWS_END, HOLIDAY_LOVE_IS_IN_THE_AIR, HOLIDAY_MIDSUMMER_FIRE_FESTIVAL, and IsHolidayActive().

Referenced by GetLockedDungeons().

◆ IsVoteKickActive()

bool lfg::LFGMgr::IsVoteKickActive ( ObjectGuid  gguid)

Get current vote kick state.

Definition at line 1669 of file LFGMgr.cpp.

References ASSERT, GroupsStore, ObjectGuid::IsParty(), TC_LOG_TRACE, and ObjectGuid::ToString().

◆ JoinLfg()

void lfg::LFGMgr::JoinLfg ( Player *  player,
uint8  roles,
LfgDungeonSet &  dungeons 
)

Join Lfg with selected roles, dungeons and comment.

Adds the player/group to lfg queue. If player is in a group then it is the leader of the group tying to join the group. Join conditions are checked before adding to the new queue.

Parameters
[in]playerPlayer trying to join (or leader of group trying to join)
[in]rolesPlayer selected roles
[in]dungeonsDungeons the player/group is applying for

Definition at line 398 of file LFGMgr.cpp.

References lfg::LFGQueue::AddQueueData(), lfg::LfgRoleCheck::cancelTime, lfg::ConcatenateDungeons(), lfg::LfgRoleCheck::dungeons, FilterClassRoles(), GetCompatibleDungeons(), GetDungeon(), GetDungeonsByRandom(), GetDungeonType(), GameTime::GetGameTime(), Player::GetGroup(), BaseEntity::GetGUID(), Group::GetGUID(), Group::GetMembers(), Group::GetMembersCount(), WorldObject::GetName(), GetQueue(), GetQueueId(), Player::GetSession(), GetState(), Unit::HasAura(), WorldSession::HasPermission(), WorldPackets::LFG::RideTicket::Id, Player::InArena(), Player::InBattleground(), Player::InBattlegroundQueue(), Group::isLFGGroup(), lfg::LfgRoleCheck::leader, WorldPackets::LFG::Lfg, lfg::LFG_JOIN_CANT_USE_DUNGEONS, lfg::LFG_JOIN_DESERTER_PARTY, lfg::LFG_JOIN_DESERTER_PLAYER, lfg::LFG_JOIN_INVALID_SLOT, lfg::LFG_JOIN_MEMBERS_NOT_PRESENT, lfg::LFG_JOIN_MISMATCHED_SLOTS, lfg::LFG_JOIN_NO_LFG_OBJECT, lfg::LFG_JOIN_NO_SLOTS, lfg::LFG_JOIN_OK, lfg::LFG_JOIN_RANDOM_COOLDOWN_PARTY, lfg::LFG_JOIN_RANDOM_COOLDOWN_PLAYER, lfg::LFG_JOIN_TOO_MANY_MEMBERS, lfg::LFG_ROLECHECK_INITIALITING, lfg::LFG_SPELL_DUNGEON_COOLDOWN, lfg::LFG_SPELL_DUNGEON_DESERTER, lfg::LFG_STATE_FINISHED_DUNGEON, lfg::LFG_STATE_QUEUED, lfg::LFG_STATE_ROLECHECK, lfg::LFG_TIME_ROLECHECK, lfg::LFG_TYPE_DUNGEON, lfg::LFG_TYPE_HEROIC, lfg::LFG_TYPE_RAID, lfg::LFG_TYPE_RANDOM, lfg::LFG_UPDATETYPE_ADDED_TO_QUEUE, lfg::LFG_UPDATETYPE_JOIN_QUEUE, lfg::LFG_UPDATETYPE_JOIN_QUEUE_INITIAL, lfg::LfgJoinResultData::lockmap, MAX_GROUP_SIZE, lfg::PLAYER_ROLE_ANY, lfg::PLAYER_ROLE_DAMAGE, lfg::PLAYER_ROLE_HEALER, lfg::PLAYER_ROLE_TANK, lfg::LfgJoinResultData::playersMissingRequirement, rbac::RBAC_PERM_JOIN_DUNGEON_FINDER, lfg::LfgRoleCheck::rDungeonId, lfg::LFGQueue::RemoveFromQueue(), WorldPackets::LFG::RideTicket::RequesterGuid, lfg::LfgJoinResultData::result, RoleChecksStore, lfg::LfgRoleCheck::roles, WorldSession::SendLfgJoinResult(), WorldSession::SendLfgUpdateStatus(), SetRoles(), SetSelectedDungeons(), SetState(), SetTicket(), lfg::LfgRoleCheck::state, TC_LOG_DEBUG, WorldPackets::LFG::RideTicket::Time, ObjectGuid::ToString(), WorldPackets::LFG::RideTicket::Type, and UpdateRoleCheck().

◆ LeaveLfg()

◆ LoadLFGDungeons()

◆ LoadRewards()

void lfg::LFGMgr::LoadRewards ( )

Loads rewards for random dungeons.

Load rewards for completing dungeons.

Definition at line 121 of file LFGMgr.cpp.

References CONFIG_MAX_PLAYER_LEVEL, GetLFGDungeonEntry(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), Field::GetUInt8(), RewardMapStore, sObjectMgr, sWorld, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.

◆ MakeNewGroup()

◆ OnDungeonEncounterDone()

void lfg::LFGMgr::OnDungeonEncounterDone ( ObjectGuid  gguid,
std::span< uint32 const >  dungeonEncounters,
Map const *  currMap 
)

Check dungeon completion on encounter completion.

Check if dungeon can be rewarded, if any.

Parameters
[in]gguidGroup guid
[in]dungeonEncountersDungeonEncounter that was just completed
[in]currMapMap of the instance where encounter was completed

Definition at line 1449 of file LFGMgr.cpp.

References advstd::ranges::contains, lfg::LFGDungeonData::finalDungeonEncounterId, FinishDungeon(), GetDungeon(), GetLFGDungeon(), GetState(), lfg::LFG_STATE_FINISHED_DUNGEON, TC_LOG_DEBUG, and ObjectGuid::ToString().

◆ operator=() [1/2]

LFGMgr & lfg::LFGMgr::operator= ( LFGMgr &&  right)
delete

◆ operator=() [2/2]

LFGMgr & lfg::LFGMgr::operator= ( LFGMgr const &  right)
delete

◆ RemoveGroupData()

◆ RemovePlayerData()

void lfg::LFGMgr::RemovePlayerData ( ObjectGuid  guid)
private

Definition at line 1897 of file LFGMgr.cpp.

References PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

◆ RemovePlayerFromGroup()

uint8 lfg::LFGMgr::RemovePlayerFromGroup ( ObjectGuid  gguid,
ObjectGuid  guid 
)

Removes a player from a group.

Definition at line 1944 of file LFGMgr.cpp.

References GroupsStore.

◆ RemoveProposal()

void lfg::LFGMgr::RemoveProposal ( LfgProposalContainer::iterator  itProposal,
LfgUpdateType  type 
)
private

◆ RestoreState()

◆ selectedRandomLfgDungeon()

bool lfg::LFGMgr::selectedRandomLfgDungeon ( ObjectGuid  guid)

Check if given guid applied for random dungeon.

Definition at line 2165 of file LFGMgr.cpp.

References GetLFGDungeon(), GetSelectedDungeons(), GetState(), lfg::LFG_STATE_NONE, lfg::LFG_TYPE_RANDOM, lfg::LFGDungeonData::seasonal, and lfg::LFGDungeonData::type.

◆ SendLfgBootProposalUpdate()

void lfg::LFGMgr::SendLfgBootProposalUpdate ( ObjectGuid  guid,
LfgPlayerBoot const &  boot 
)
private

Definition at line 2025 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

Referenced by InitBoot(), Update(), and UpdateBoot().

◆ SendLfgJoinResult()

void lfg::LFGMgr::SendLfgJoinResult ( ObjectGuid  guid,
LfgJoinResultData const &  data 
)
private

Definition at line 2019 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

Referenced by Update(), and UpdateRoleCheck().

◆ SendLfgQueueStatus()

void lfg::LFGMgr::SendLfgQueueStatus ( ObjectGuid  guid,
LfgQueueStatusData const &  data 
)
static

Sends queue status to player.

Definition at line 2037 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

Referenced by lfg::LFGQueue::UpdateQueueTimers().

◆ SendLfgRoleCheckUpdate()

void lfg::LFGMgr::SendLfgRoleCheckUpdate ( ObjectGuid  guid,
LfgRoleCheck const &  roleCheck 
)
private

Definition at line 2007 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

Referenced by Update(), and UpdateRoleCheck().

◆ SendLfgRoleChosen()

void lfg::LFGMgr::SendLfgRoleChosen ( ObjectGuid  guid,
ObjectGuid  pguid,
uint8  roles 
)
private

◆ SendLfgUpdateProposal()

void lfg::LFGMgr::SendLfgUpdateProposal ( ObjectGuid  guid,
LfgProposal const &  proposal 
)
private

Definition at line 2031 of file LFGMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

Referenced by RemoveProposal(), Update(), and UpdateProposal().

◆ SendLfgUpdateStatus()

void lfg::LFGMgr::SendLfgUpdateStatus ( ObjectGuid  guid,
LfgUpdateData const &  data,
bool  party 
)
private

◆ SetDungeon()

void lfg::LFGMgr::SetDungeon ( ObjectGuid  guid,
uint32  dungeon 
)
private

Definition at line 1868 of file LFGMgr.cpp.

References GroupsStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by _LoadFromDB(), and MakeNewGroup().

◆ SetGroup()

void lfg::LFGMgr::SetGroup ( ObjectGuid  guid,
ObjectGuid  group 
)

Sets player group.

Definition at line 1972 of file LFGMgr.cpp.

References PlayersStore.

Referenced by RemoveGroupData(), and SetupGroupMember().

◆ SetLeader()

void lfg::LFGMgr::SetLeader ( ObjectGuid  gguid,
ObjectGuid  leader 
)

Sets the leader of the group.

Definition at line 1954 of file LFGMgr.cpp.

References GroupsStore.

Referenced by _LoadFromDB().

◆ SetOptions()

void lfg::LFGMgr::SetOptions ( uint32  options)

Sets new lfg options.

Definition at line 2112 of file LFGMgr.cpp.

References m_options.

◆ SetRoles()

void lfg::LFGMgr::SetRoles ( ObjectGuid  guid,
uint8  roles 
)

Sets player lfg roles.

Definition at line 1874 of file LFGMgr.cpp.

References PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by JoinLfg(), and UpdateRoleCheck().

◆ SetSelectedDungeons()

void lfg::LFGMgr::SetSelectedDungeons ( ObjectGuid  guid,
LfgDungeonSet const &  dungeons 
)
private

Definition at line 1880 of file LFGMgr.cpp.

References lfg::ConcatenateDungeons(), PlayersStore, TC_LOG_TRACE, and ObjectGuid::ToString().

Referenced by JoinLfg(), and SetupGroupMember().

◆ SetState()

◆ SetTeam()

void lfg::LFGMgr::SetTeam ( ObjectGuid  guid,
uint8  team 
)

Sets player team.

Definition at line 1959 of file LFGMgr.cpp.

References CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP, PlayersStore, and sWorld.

◆ SetTicket()

void lfg::LFGMgr::SetTicket ( ObjectGuid  guid,
WorldPackets::LFG::RideTicket const &  ticket 
)
private

Definition at line 1892 of file LFGMgr.cpp.

References PlayersStore.

Referenced by JoinLfg().

◆ SetupGroupMember()

void lfg::LFGMgr::SetupGroupMember ( ObjectGuid  guid,
ObjectGuid  gguid 
)

Initializes player data after loading group data from DB.

Definition at line 2155 of file LFGMgr.cpp.

References AddPlayerToGroup(), GetDungeon(), GetState(), SetGroup(), SetSelectedDungeons(), and SetState().

◆ SetVoteKick()

void lfg::LFGMgr::SetVoteKick ( ObjectGuid  gguid,
bool  active 
)
private

◆ TeleportPlayer()

void lfg::LFGMgr::TeleportPlayer ( Player *  player,
bool  out,
bool  fromOpcode = false 
)

◆ Update()

◆ UpdateBoot()

void lfg::LFGMgr::UpdateBoot ( ObjectGuid  guid,
bool  accept 
)

◆ UpdateProposal()

◆ UpdateRoleCheck()

Member Data Documentation

◆ BootsStore

LfgPlayerBootContainer lfg::LFGMgr::BootsStore
private

Current Proposals.

Definition at line 503 of file LFGMgr.h.

Referenced by InitBoot(), Update(), and UpdateBoot().

◆ CachedDungeonMapStore

LfgCachedDungeonContainer lfg::LFGMgr::CachedDungeonMapStore
private

Queues.

Definition at line 496 of file LFGMgr.h.

Referenced by GetDungeonsByRandom(), and LoadLFGDungeons().

◆ GroupsStore

◆ LfgDungeonStore

LFGDungeonContainer lfg::LFGMgr::LfgDungeonStore
private

Stores rewards for random dungeons.

Definition at line 499 of file LFGMgr.h.

Referenced by GetLFGDungeon(), GetRandomAndSeasonalDungeons(), and LoadLFGDungeons().

◆ m_lfgProposalId

uint32 lfg::LFGMgr::m_lfgProposalId
private

used to check interval of update

Definition at line 492 of file LFGMgr.h.

Referenced by AddProposal(), and Update().

◆ m_options

uint32 lfg::LFGMgr::m_options
private

used as internal counter for proposals

Definition at line 493 of file LFGMgr.h.

Referenced by GetOptions(), isOptionEnabled(), and SetOptions().

◆ m_QueueTimer

uint32 lfg::LFGMgr::m_QueueTimer
private

Definition at line 491 of file LFGMgr.h.

Referenced by Update().

◆ PlayersStore

◆ ProposalsStore

LfgProposalContainer lfg::LFGMgr::ProposalsStore
private

Current Role checks.

Definition at line 502 of file LFGMgr.h.

Referenced by AddProposal(), LeaveLfg(), RemoveProposal(), Update(), and UpdateProposal().

◆ QueuesStore

LfgQueueContainer lfg::LFGMgr::QueuesStore
private

Stores config options.

Definition at line 495 of file LFGMgr.h.

Referenced by Clean(), DumpQueueInfo(), GetQueue(), GetQueueJoinTime(), and Update().

◆ RewardMapStore

LfgRewardContainer lfg::LFGMgr::RewardMapStore
private

Stores all dungeons by groupType.

Definition at line 498 of file LFGMgr.h.

Referenced by GetRandomDungeonReward(), LoadRewards(), and ~LFGMgr().

◆ RoleChecksStore

LfgRoleCheckContainer lfg::LFGMgr::RoleChecksStore
private

Definition at line 501 of file LFGMgr.h.

Referenced by JoinLfg(), Update(), and UpdateRoleCheck().


The documentation for this class was generated from the following files: