TrinityCore
|
#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::array< uint32, 4 > const &dungeonEncounterId, Map const *currMap) |
Check dungeon completion on encounter completion. More... | |
void | FinishDungeon (ObjectGuid gguid, uint32 dungeonId, Map const *currMap) |
Finish the dungeon for the given group. All check are performed using internal lfg data. More... | |
void | LoadRewards () |
Loads rewards for random dungeons. More... | |
void | LoadLFGDungeons (bool reload=false) |
Loads dungeons from dbc and adds teleport coords. More... | |
bool | selectedRandomLfgDungeon (ObjectGuid guid) |
Check if given guid applied for random dungeon. More... | |
bool | inLfgDungeonMap (ObjectGuid guid, uint32 map, Difficulty difficulty) |
Check if given guid applied for given map and difficulty. Used to know. More... | |
LfgDungeonSet const & | GetSelectedDungeons (ObjectGuid guid) |
Get selected dungeons. More... | |
uint32 | GetSelectedRandomDungeon (ObjectGuid guid) |
Get selected random dungeon. More... | |
LfgState | GetState (ObjectGuid guid) |
Get current lfg state. More... | |
bool | IsVoteKickActive (ObjectGuid gguid) |
Get current vote kick state. More... | |
uint32 | GetDungeon (ObjectGuid guid, bool asId=true) |
Get current dungeon. More... | |
uint32 | GetDungeonMapId (ObjectGuid guid) |
Get the map id of the current dungeon. More... | |
uint8 | GetKicksLeft (ObjectGuid gguid) |
Get kicks left in current group. More... | |
void | _LoadFromDB (Field *fields, ObjectGuid guid) |
Load Lfg group info from DB. More... | |
void | SetupGroupMember (ObjectGuid guid, ObjectGuid gguid) |
Initializes player data after loading group data from DB. More... | |
uint32 | GetLFGDungeonEntry (uint32 id) |
Return Lfg dungeon entry for given dungeon id. More... | |
uint8 | GetRoles (ObjectGuid guid) |
Get current player roles. More... | |
uint32 | GetOptions () |
Gets current lfg options. More... | |
void | SetOptions (uint32 options) |
Sets new lfg options. More... | |
bool | isOptionEnabled (uint32 option) |
Checks if given lfg option is enabled. More... | |
void | Clean () |
Clears queue - Only for internal testing. More... | |
std::string | DumpQueueInfo (bool full=false) |
Dumps the state of the queue - Only for internal testing. More... | |
ObjectGuid | GetLeader (ObjectGuid guid) |
Get leader of the group (using internal data) More... | |
void | SetTeam (ObjectGuid guid, uint8 team) |
Sets player team. More... | |
void | SetGroup (ObjectGuid guid, ObjectGuid group) |
Sets player group. More... | |
ObjectGuid | GetGroup (ObjectGuid guid) |
Gets player group. More... | |
void | SetLeader (ObjectGuid gguid, ObjectGuid leader) |
Sets the leader of the group. More... | |
void | RemoveGroupData (ObjectGuid guid) |
Removes saved group data. More... | |
uint8 | RemovePlayerFromGroup (ObjectGuid gguid, ObjectGuid guid) |
Removes a player from a group. More... | |
void | AddPlayerToGroup (ObjectGuid gguid, ObjectGuid guid) |
Adds player to group. More... | |
LfgLockMap | GetLockedDungeons (ObjectGuid guid) |
Get locked dungeons. More... | |
LfgUpdateData | GetLfgStatus (ObjectGuid guid) |
Returns current lfg status. More... | |
bool | IsSeasonActive (uint32 dungeonId) |
Checks if Seasonal dungeon is active. More... | |
LfgReward const * | GetRandomDungeonReward (uint32 dungeon, uint8 level) |
Gets the random dungeon reward corresponding to given dungeon and player level. More... | |
LfgDungeonSet | GetRandomAndSeasonalDungeons (uint8 level, uint8 expansion, uint32 contentTuningReplacementConditionMask) |
Returns all random and seasonal dungeons for given level and expansion. More... | |
void | TeleportPlayer (Player *player, bool out, bool fromOpcode=false) |
Teleport a player to/from selected dungeon. More... | |
void | InitBoot (ObjectGuid gguid, ObjectGuid kguid, ObjectGuid vguid, std::string const &reason) |
Inits new proposal to boot a player. More... | |
void | UpdateBoot (ObjectGuid guid, bool accept) |
Updates player boot proposal with new player answer. More... | |
void | UpdateProposal (uint32 proposalId, ObjectGuid guid, bool accept) |
Updates proposal to join dungeon with player answer. More... | |
void | UpdateRoleCheck (ObjectGuid gguid, ObjectGuid guid=ObjectGuid::Empty, uint8 roles=PLAYER_ROLE_NONE) |
Updates the role check with player answer. More... | |
void | SetRoles (ObjectGuid guid, uint8 roles) |
Sets player lfg roles. More... | |
void | JoinLfg (Player *player, uint8 roles, LfgDungeonSet &dungeons) |
Join Lfg with selected roles, dungeons and comment. More... | |
void | LeaveLfg (ObjectGuid guid, bool disconnected=false) |
Leaves lfg. More... | |
WorldPackets::LFG::RideTicket const * | GetTicket (ObjectGuid guid) const |
Gets unique join queue data. More... | |
LfgState | GetOldState (ObjectGuid guid) |
Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON) More... | |
bool | IsLfgGroup (ObjectGuid guid) |
Check if given group guid is lfg. More... | |
uint8 | GetPlayerCount (ObjectGuid guid) |
Gets the player count of given group. More... | |
uint32 | AddProposal (LfgProposal &proposal) |
Add a new Proposal. More... | |
uint8 | GetQueueId (ObjectGuid guid) |
Returns queue id. More... | |
bool | AllQueued (GuidList const &check) |
Checks if all players are queued. More... | |
time_t | GetQueueJoinTime (ObjectGuid guid) |
Gets queue join time. More... | |
Static Public Member Functions | |
static LFGMgr * | instance () |
static bool | CheckGroupRoles (LfgRolesMap &groles) |
Checks if given roles match, modifies given roles map with new roles. More... | |
static bool | HasIgnore (ObjectGuid guid1, ObjectGuid guid2) |
Checks if given players are ignoring each other. More... | |
static void | SendLfgQueueStatus (ObjectGuid guid, LfgQueueStatusData const &data) |
Sends queue status to player. More... | |
Private Attributes | |
uint32 | m_QueueTimer |
uint32 | m_lfgProposalId |
used to check interval of update More... | |
uint32 | m_options |
used as internal counter for proposals More... | |
LfgQueueContainer | QueuesStore |
Stores config options. More... | |
LfgCachedDungeonContainer | CachedDungeonMapStore |
Queues. More... | |
LfgRewardContainer | RewardMapStore |
Stores all dungeons by groupType. More... | |
LFGDungeonContainer | LfgDungeonStore |
Stores rewards for random dungeons. More... | |
LfgRoleCheckContainer | RoleChecksStore |
LfgProposalContainer | ProposalsStore |
Current Role checks. More... | |
LfgPlayerBootContainer | BootsStore |
Current Proposals. More... | |
LfgPlayerDataContainer | PlayersStore |
Current player kicks. More... | |
LfgGroupDataContainer | GroupsStore |
Player data. More... | |
|
private |
Definition at line 60 of file LFGMgr.cpp.
|
private |
Definition at line 65 of file LFGMgr.cpp.
|
delete |
|
delete |
void lfg::LFGMgr::_LoadFromDB | ( | Field * | fields, |
ObjectGuid | guid | ||
) |
Load Lfg group info from DB.
Definition at line 71 of file LFGMgr.cpp.
|
private |
Definition at line 100 of file LFGMgr.cpp.
void lfg::LFGMgr::AddPlayerToGroup | ( | ObjectGuid | gguid, |
ObjectGuid | guid | ||
) |
Adds player to group.
Definition at line 1949 of file LFGMgr.cpp.
uint32 lfg::LFGMgr::AddProposal | ( | LfgProposal & | proposal | ) |
Add a new Proposal.
Definition at line 1040 of file LFGMgr.cpp.
bool lfg::LFGMgr::AllQueued | ( | GuidList const & | check | ) |
Checks if all players are queued.
Definition at line 2067 of file LFGMgr.cpp.
|
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
[in] | groles | Map of roles to check |
Definition at line 880 of file LFGMgr.cpp.
void lfg::LFGMgr::Clean | ( | ) |
Clears queue - Only for internal testing.
Definition at line 2097 of file LFGMgr.cpp.
|
private |
|
private |
Definition at line 1886 of file LFGMgr.cpp.
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.
Definition at line 1934 of file LFGMgr.cpp.
void lfg::LFGMgr::FinishDungeon | ( | ObjectGuid | gguid, |
uint32 | dungeonId, | ||
Map const * | currMap | ||
) |
Finish the dungeon for the given group. All check are performed using internal lfg data.
Finish a dungeon and give reward, if any.
[in] | gguid | Group guid |
[in] | dungeonId | Dungeonid |
Definition at line 1474 of file LFGMgr.cpp.
|
private |
Given a list of dungeons remove the dungeons players have restrictions.
[in,out] | dungeons | Dungeons to check restrictions |
[in] | players | Set of players to check their dungeon restrictions |
[out] | lockMap | Map of players Lock status info of given dungeons (Empty if dungeons is not empty) |
Definition at line 820 of file LFGMgr.cpp.
uint32 lfg::LFGMgr::GetDungeon | ( | ObjectGuid | guid, |
bool | asId = true |
||
) |
Get current dungeon.
Definition at line 1679 of file LFGMgr.cpp.
uint32 lfg::LFGMgr::GetDungeonMapId | ( | ObjectGuid | guid | ) |
Get the map id of the current dungeon.
Definition at line 1686 of file LFGMgr.cpp.
|
private |
Get the dungeon list that can be done given a random dungeon entry.
[in] | randomdungeon | Random dungeon id (if value = 0 will return all dungeons) |
Definition at line 1591 of file LFGMgr.cpp.
Given a Dungeon id returns the dungeon Type
[in] | dungeon | dungeon id |
Definition at line 1626 of file LFGMgr.cpp.
ObjectGuid lfg::LFGMgr::GetGroup | ( | ObjectGuid | guid | ) |
Gets player group.
Definition at line 1967 of file LFGMgr.cpp.
uint8 lfg::LFGMgr::GetKicksLeft | ( | ObjectGuid | gguid | ) |
Get kicks left in current group.
Definition at line 1806 of file LFGMgr.cpp.
ObjectGuid lfg::LFGMgr::GetLeader | ( | ObjectGuid | guid | ) |
Get leader of the group (using internal data)
Definition at line 1987 of file LFGMgr.cpp.
|
private |
Return Lfg dungeon entry for given dungeon id.
Definition at line 2194 of file LFGMgr.cpp.
LfgUpdateData lfg::LFGMgr::GetLfgStatus | ( | ObjectGuid | guid | ) |
Returns current lfg status.
Definition at line 2117 of file LFGMgr.cpp.
LfgLockMap lfg::LFGMgr::GetLockedDungeons | ( | ObjectGuid | guid | ) |
Get locked dungeons.
Definition at line 1728 of file LFGMgr.cpp.
LfgState lfg::LFGMgr::GetOldState | ( | ObjectGuid | guid | ) |
Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
Definition at line 1652 of file LFGMgr.cpp.
uint32 lfg::LFGMgr::GetOptions | ( | ) |
Gets current lfg options.
Definition at line 2107 of file LFGMgr.cpp.
uint8 lfg::LFGMgr::GetPlayerCount | ( | ObjectGuid | guid | ) |
Gets the player count of given group.
Definition at line 1982 of file LFGMgr.cpp.
|
private |
|
private |
Definition at line 2061 of file LFGMgr.cpp.
uint8 lfg::LFGMgr::GetQueueId | ( | ObjectGuid | guid | ) |
Returns queue id.
Definition at line 2048 of file LFGMgr.cpp.
time_t lfg::LFGMgr::GetQueueJoinTime | ( | ObjectGuid | guid | ) |
Gets queue join time.
Definition at line 2086 of file LFGMgr.cpp.
LfgDungeonSet lfg::LFGMgr::GetRandomAndSeasonalDungeons | ( | uint8 | level, |
uint8 | expansion, | ||
uint32 | contentTuningReplacementConditionMask | ||
) |
Returns all random and seasonal dungeons for given level and expansion.
Definition at line 2203 of file LFGMgr.cpp.
Gets the random dungeon reward corresponding to given dungeon and player level.
Get the reward of a given random dungeon at a certain level
[in] | dungeon | dungeon id |
[in] | level | Player level |
Definition at line 1605 of file LFGMgr.cpp.
uint8 lfg::LFGMgr::GetRoles | ( | ObjectGuid | guid | ) |
Get current player roles.
Definition at line 1699 of file LFGMgr.cpp.
LfgDungeonSet const & lfg::LFGMgr::GetSelectedDungeons | ( | ObjectGuid | guid | ) |
Get selected dungeons.
Definition at line 1706 of file LFGMgr.cpp.
uint32 lfg::LFGMgr::GetSelectedRandomDungeon | ( | ObjectGuid | guid | ) |
Get selected random dungeon.
Definition at line 1712 of file LFGMgr.cpp.
LfgState lfg::LFGMgr::GetState | ( | ObjectGuid | guid | ) |
Get current lfg state.
Definition at line 1635 of file LFGMgr.cpp.
|
private |
Definition at line 1927 of file LFGMgr.cpp.
WorldPackets::LFG::RideTicket const * lfg::LFGMgr::GetTicket | ( | ObjectGuid | guid | ) | const |
Gets unique join queue data.
Definition at line 705 of file LFGMgr.cpp.
|
static |
Checks if given players are ignoring each other.
Definition at line 1992 of file LFGMgr.cpp.
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
[in] | gguid | Group the vote kicks belongs to |
[in] | kicker | Kicker guid |
[in] | victim | Victim guid |
[in] | reason | Kick reason |
Definition at line 1262 of file LFGMgr.cpp.
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.
|
static |
Definition at line 282 of file LFGMgr.cpp.
bool lfg::LFGMgr::IsLfgGroup | ( | ObjectGuid | guid | ) |
Check if given group guid is lfg.
Definition at line 2043 of file LFGMgr.cpp.
bool lfg::LFGMgr::isOptionEnabled | ( | uint32 | option | ) |
Checks if given lfg option is enabled.
Definition at line 2102 of file LFGMgr.cpp.
bool lfg::LFGMgr::IsSeasonActive | ( | uint32 | dungeonId | ) |
Checks if Seasonal dungeon is active.
Definition at line 2123 of file LFGMgr.cpp.
bool lfg::LFGMgr::IsVoteKickActive | ( | ObjectGuid | gguid | ) |
Get current vote kick state.
Definition at line 1669 of file LFGMgr.cpp.
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.
[in] | player | Player trying to join (or leader of group trying to join) |
[in] | roles | Player selected roles |
[in] | dungeons | Dungeons the player/group is applying for |
Definition at line 399 of file LFGMgr.cpp.
void lfg::LFGMgr::LeaveLfg | ( | ObjectGuid | guid, |
bool | disconnected = false |
||
) |
Leaves lfg.
Leaves Dungeon System. Player/Group is removed from queue, rolechecks, proposals or votekicks. Player or group needs to be not NULL and using Dungeon System
[in] | guid | Player or group guid |
Definition at line 629 of file LFGMgr.cpp.
void lfg::LFGMgr::LoadLFGDungeons | ( | bool | reload = false | ) |
Loads dungeons from dbc and adds teleport coords.
Definition at line 190 of file LFGMgr.cpp.
void lfg::LFGMgr::LoadRewards | ( | ) |
Loads rewards for random dungeons.
Load rewards for completing dungeons.
Definition at line 121 of file LFGMgr.cpp.
|
private |
Makes a new group given a proposal
[in] | proposal | Proposal to get info from |
Definition at line 947 of file LFGMgr.cpp.
void lfg::LFGMgr::OnDungeonEncounterDone | ( | ObjectGuid | gguid, |
std::array< uint32, 4 > const & | dungeonEncounterIds, | ||
Map const * | currMap | ||
) |
Check dungeon completion on encounter completion.
Check if dungeon can be rewarded, if any.
[in] | gguid | Group guid |
[in] | dungeonEncounterIds | DungeonEncounter that was just completed |
[in] | currMap | Map of the instance where encounter was completed |
Definition at line 1451 of file LFGMgr.cpp.
void lfg::LFGMgr::RemoveGroupData | ( | ObjectGuid | guid | ) |
Removes saved group data.
Definition at line 1905 of file LFGMgr.cpp.
|
private |
uint8 lfg::LFGMgr::RemovePlayerFromGroup | ( | ObjectGuid | gguid, |
ObjectGuid | guid | ||
) |
Removes a player from a group.
Definition at line 1944 of file LFGMgr.cpp.
|
private |
Remove a proposal from the pool, remove the group that didn't accept (if needed) and readd the other members to the queue
[in] | itProposal | Iterator to the proposal to remove |
[in] | type | Type of removal (LFG_UPDATETYPE_PROPOSAL_FAILED, LFG_UPDATETYPE_PROPOSAL_DECLINED) |
Definition at line 1162 of file LFGMgr.cpp.
|
private |
Definition at line 1813 of file LFGMgr.cpp.
bool lfg::LFGMgr::selectedRandomLfgDungeon | ( | ObjectGuid | guid | ) |
Check if given guid applied for random dungeon.
Definition at line 2165 of file LFGMgr.cpp.
|
private |
Definition at line 2025 of file LFGMgr.cpp.
|
private |
Definition at line 2019 of file LFGMgr.cpp.
|
static |
Sends queue status to player.
Definition at line 2037 of file LFGMgr.cpp.
|
private |
Definition at line 2007 of file LFGMgr.cpp.
|
private |
Definition at line 2001 of file LFGMgr.cpp.
|
private |
Definition at line 2031 of file LFGMgr.cpp.
|
private |
Definition at line 2013 of file LFGMgr.cpp.
|
private |
Definition at line 1868 of file LFGMgr.cpp.
void lfg::LFGMgr::SetGroup | ( | ObjectGuid | guid, |
ObjectGuid | group | ||
) |
Sets player group.
Definition at line 1972 of file LFGMgr.cpp.
void lfg::LFGMgr::SetLeader | ( | ObjectGuid | gguid, |
ObjectGuid | leader | ||
) |
Sets the leader of the group.
Definition at line 1954 of file LFGMgr.cpp.
void lfg::LFGMgr::SetOptions | ( | uint32 | options | ) |
Sets new lfg options.
Definition at line 2112 of file LFGMgr.cpp.
void lfg::LFGMgr::SetRoles | ( | ObjectGuid | guid, |
uint8 | roles | ||
) |
Sets player lfg roles.
Definition at line 1874 of file LFGMgr.cpp.
|
private |
Definition at line 1880 of file LFGMgr.cpp.
|
private |
Definition at line 1835 of file LFGMgr.cpp.
void lfg::LFGMgr::SetTeam | ( | ObjectGuid | guid, |
uint8 | team | ||
) |
Sets player team.
Definition at line 1959 of file LFGMgr.cpp.
|
private |
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.
|
private |
Definition at line 1857 of file LFGMgr.cpp.
void lfg::LFGMgr::TeleportPlayer | ( | Player * | player, |
bool | out, | ||
bool | fromOpcode = false |
||
) |
Teleport a player to/from selected dungeon.
Teleports the player in or out the dungeon
[in] | player | Player to teleport |
[in] | out | Teleport out (true) or in (false) |
[in] | fromOpcode | Function called from opcode handlers? (Default false) |
Definition at line 1359 of file LFGMgr.cpp.
void lfg::LFGMgr::Update | ( | uint32 | diff | ) |
void lfg::LFGMgr::UpdateBoot | ( | ObjectGuid | guid, |
bool | accept | ||
) |
Updates player boot proposal with new player answer.
Update Boot info with player answer
[in] | guid | Player who has answered |
[in] | player | answer |
Definition at line 1295 of file LFGMgr.cpp.
void lfg::LFGMgr::UpdateProposal | ( | uint32 | proposalId, |
ObjectGuid | guid, | ||
bool | accept | ||
) |
Updates proposal to join dungeon with player answer.
Update Proposal info with player answer
[in] | proposalId | Proposal id to be updated |
[in] | guid | Player guid to update answer |
[in] | accept | Player answer |
Definition at line 1054 of file LFGMgr.cpp.
void lfg::LFGMgr::UpdateRoleCheck | ( | ObjectGuid | gguid, |
ObjectGuid | guid = ObjectGuid::Empty , |
||
uint8 | roles = PLAYER_ROLE_NONE |
||
) |
Updates the role check with player answer.
Update the Role check info with the player selected role.
[in] | grp | Group guid to update rolecheck |
[in] | guid | Player guid (0 = rolecheck failed) |
[in] | roles | Player selected roles |
Definition at line 721 of file LFGMgr.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |