![]() |
TrinityCore
|
#include <LFGQueue.h>
Public Member Functions | |
| LFGQueue () | |
| LFGQueue (LFGQueue const &)=delete | |
| LFGQueue (LFGQueue &&other) noexcept | |
| LFGQueue & | operator= (LFGQueue const &)=delete |
| LFGQueue & | operator= (LFGQueue &&right) noexcept |
| ~LFGQueue () | |
| std::string | GetDetailedMatchRoles (GuidList const &check) const |
| void | AddToQueue (ObjectGuid guid, bool reAdd=false) |
| void | RemoveFromQueue (ObjectGuid guid) |
| void | AddQueueData (ObjectGuid guid, time_t joinTime, LfgDungeonSet const &dungeons, LfgRolesMap const &rolesMap) |
| void | RemoveQueueData (ObjectGuid guid) |
| void | UpdateWaitTimeAvg (int32 waitTime, uint32 dungeonId) |
| void | UpdateWaitTimeTank (int32 waitTime, uint32 dungeonId) |
| void | UpdateWaitTimeHealer (int32 waitTime, uint32 dungeonId) |
| void | UpdateWaitTimeDps (int32 waitTime, uint32 dungeonId) |
| void | UpdateQueueTimers (uint8 queueId, time_t currTime) |
| time_t | GetJoinTime (ObjectGuid guid) const |
| uint8 | FindGroups () |
| std::string | DumpQueueInfo () const |
| std::string | DumpCompatibleInfo (bool full=false) const |
Private Member Functions | |
| void | AddToNewQueue (ObjectGuid guid) |
| void | AddToCurrentQueue (ObjectGuid guid) |
| void | AddToFrontCurrentQueue (ObjectGuid guid) |
| void | RemoveFromNewQueue (ObjectGuid guid) |
| void | RemoveFromCurrentQueue (ObjectGuid guid) |
| void | SetCompatibles (std::string const &key, LfgCompatibility compatibles) |
| LfgCompatibility | GetCompatibles (std::string const &key) |
| void | RemoveFromCompatibles (ObjectGuid guid) |
| void | SetCompatibilityData (std::string const &key, LfgCompatibilityData const &compatibles) |
| LfgCompatibilityData * | GetCompatibilityData (std::string const &key) |
| void | FindBestCompatibleInQueue (LfgQueueDataContainer::iterator itrQueue) |
| void | UpdateBestCompatibleInQueue (LfgQueueDataContainer::iterator itrQueue, std::string const &key, LfgRolesMap const &roles) |
| LfgCompatibility | FindNewGroups (GuidList &check, GuidList &all) |
| LfgCompatibility | CheckCompatibility (GuidList check) |
Private Attributes | |
| LfgQueueDataContainer | QueueDataStore |
| Queued groups. | |
| LfgCompatibleContainer | CompatibleMapStore |
| Compatible dungeons. | |
| 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. | |
| GuidList | currentQueueStore |
| Ordered list. Used to find groups. | |
| GuidList | newToQueueStore |
| New groups to add to queue. | |
Stores all data related to queue
Definition at line 85 of file LFGQueue.h.
|
default |
|
delete |
|
defaultnoexcept |
|
default |
| void lfg::LFGQueue::AddQueueData | ( | ObjectGuid | guid, |
| time_t | joinTime, | ||
| LfgDungeonSet const & | dungeons, | ||
| LfgRolesMap const & | rolesMap | ||
| ) |
Definition at line 193 of file LFGQueue.cpp.
References AddToQueue(), and QueueDataStore.
Referenced by lfg::LFGMgr::JoinLfg(), and lfg::LFGMgr::UpdateRoleCheck().
|
private |
Definition at line 178 of file LFGQueue.cpp.
References currentQueueStore.
Referenced by FindGroups().
|
private |
Definition at line 183 of file LFGQueue.cpp.
References currentQueueStore.
Referenced by AddToQueue().
|
private |
Definition at line 168 of file LFGQueue.cpp.
References newToQueueStore.
Referenced by AddToQueue().
| void lfg::LFGQueue::AddToQueue | ( | ObjectGuid | guid, |
| bool | reAdd = false |
||
| ) |
Definition at line 128 of file LFGQueue.cpp.
References AddToFrontCurrentQueue(), AddToNewQueue(), QueueDataStore, TC_LOG_ERROR, and ObjectGuid::ToString().
Referenced by AddQueueData(), and lfg::LFGMgr::RemoveProposal().
|
private |
Check compatibilities between groups. If group is Matched proposal will be created
| [in] | check | List of guids to check compatibilities |
Definition at line 363 of file LFGQueue.cpp.
References lfg::LfgProposalPlayer::accept, lfg::LfgProposal::cancelTime, CheckCompatibility(), lfg::LFGMgr::CheckGroupRoles(), ObjectGuid::Clear(), lfg::ConcatenateDungeons(), lfg::ConcatenateGuids(), lfg::LfgProposal::dungeonId, lfg::LfgQueueData::dungeons, ObjectGuid::Empty, GetDetailedMatchRoles(), GameTime::GetGameTime(), lfg::GetRolesString(), lfg::LfgProposalPlayer::group, lfg::LfgProposal::group, ObjectGuid::IsEmpty(), lfg::LfgProposal::isNew, lfg::LfgProposal::leader, lfg::LFG_ANSWER_AGREE, lfg::LFG_COMPATIBILITY_PENDING, lfg::LFG_COMPATIBLES_BAD_STATES, lfg::LFG_COMPATIBLES_MATCH, lfg::LFG_COMPATIBLES_WITH_LESS_PLAYERS, lfg::LFG_INCOMPATIBLES_HAS_IGNORES, lfg::LFG_INCOMPATIBLES_MULTIPLE_LFG_GROUPS, lfg::LFG_INCOMPATIBLES_NO_DUNGEONS, lfg::LFG_INCOMPATIBLES_NO_ROLES, lfg::LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS, lfg::LFG_INCOMPATIBLES_WRONG_GROUP_SIZE, lfg::LFG_PROPOSAL_INITIATING, lfg::LFG_STATE_DUNGEON, lfg::LFG_TIME_PROPOSAL, MAX_GROUP_SIZE, lfg::PLAYER_ROLE_LEADER, lfg::LfgProposal::players, QueueDataStore, lfg::LfgProposal::queues, RemoveFromCurrentQueue(), RemoveFromNewQueue(), RemoveFromQueue(), lfg::LfgProposalPlayer::role, lfg::LfgCompatibilityData::roles, lfg::LfgQueueData::roles, Trinity::Containers::SelectRandomContainerElement(), SetCompatibilityData(), SetCompatibles(), sLFGMgr, lfg::LfgProposal::state, TC_LOG_DEBUG, TC_LOG_ERROR, ObjectGuid::ToString(), UpdateBestCompatibleInQueue(), and urand().
Referenced by CheckCompatibility(), and FindNewGroups().
| std::string lfg::LFGQueue::DumpCompatibleInfo | ( | bool | full = false | ) | const |
Definition at line 673 of file LFGQueue.cpp.
References CompatibleMapStore, lfg::GetCompatibleString(), lfg::GetRolesString(), and lfg::PLAYER_ROLE_LEADER.
| std::string lfg::LFGQueue::DumpQueueInfo | ( | ) | const |
Definition at line 647 of file LFGQueue.cpp.
References currentQueueStore, ObjectGuid::IsParty(), newToQueueStore, and sLFGMgr.
|
private |
Definition at line 700 of file LFGQueue.cpp.
References CompatibleMapStore, lfg::LFG_COMPATIBLES_WITH_LESS_PLAYERS, TC_LOG_DEBUG, and UpdateBestCompatibleInQueue().
Referenced by RemoveFromQueue(), and UpdateQueueTimers().
| uint8 lfg::LFGQueue::FindGroups | ( | ) |
Definition at line 293 of file LFGQueue.cpp.
References AddToCurrentQueue(), currentQueueStore, FindNewGroups(), lfg::LFG_COMPATIBLES_MATCH, newToQueueStore, RemoveFromNewQueue(), TC_LOG_DEBUG, and ObjectGuid::ToString().
|
private |
Checks que main queue to try to form a Lfg group. Returns first match found (if any)
| [in] | check | List of guids trying to match with other groups |
| [in] | all | List of all other guids in main queue to match against |
Definition at line 325 of file LFGQueue.cpp.
References CheckCompatibility(), lfg::ConcatenateGuids(), FindNewGroups(), GetCompatibles(), lfg::GetCompatibleString(), GetDetailedMatchRoles(), lfg::LFG_COMPATIBILITY_PENDING, lfg::LFG_COMPATIBLES_BAD_STATES, lfg::LFG_COMPATIBLES_MATCH, lfg::LFG_COMPATIBLES_WITH_LESS_PLAYERS, SetCompatibles(), sLFGMgr, and TC_LOG_DEBUG.
Referenced by FindGroups(), and FindNewGroups().
|
private |
Definition at line 284 of file LFGQueue.cpp.
References CompatibleMapStore.
|
private |
Get the compatibility of a group of guids
| [in] | key | String concatenation of guids (| used as separator) |
Definition at line 275 of file LFGQueue.cpp.
References lfg::LfgCompatibilityData::compatibility, CompatibleMapStore, and lfg::LFG_COMPATIBILITY_PENDING.
Referenced by FindNewGroups().
| std::string lfg::LFGQueue::GetDetailedMatchRoles | ( | GuidList const & | check | ) | const |
Definition at line 91 of file LFGQueue.cpp.
References lfg::GetRolesString(), lfg::PLAYER_ROLE_LEADER, and QueueDataStore.
Referenced by CheckCompatibility(), and FindNewGroups().
| time_t lfg::LFGQueue::GetJoinTime | ( | ObjectGuid | guid | ) | const |
Definition at line 638 of file LFGQueue.cpp.
References QueueDataStore.
Referenced by lfg::LFGMgr::UpdateProposal().
|
private |
Remove from cached compatible dungeons any entry that contains the given guid
| [in] | guid | Guid to remove from compatible cache |
Definition at line 239 of file LFGQueue.cpp.
References CompatibleMapStore, TC_LOG_DEBUG, ObjectGuid::ToHexString(), and ObjectGuid::ToString().
Referenced by RemoveFromQueue().
|
private |
Definition at line 188 of file LFGQueue.cpp.
References currentQueueStore.
Referenced by CheckCompatibility(), and RemoveFromQueue().
|
private |
Definition at line 173 of file LFGQueue.cpp.
References newToQueueStore.
Referenced by CheckCompatibility(), FindGroups(), and RemoveFromQueue().
| void lfg::LFGQueue::RemoveFromQueue | ( | ObjectGuid | guid | ) |
Definition at line 143 of file LFGQueue.cpp.
References FindBestCompatibleInQueue(), QueueDataStore, RemoveFromCompatibles(), RemoveFromCurrentQueue(), RemoveFromNewQueue(), and ObjectGuid::ToHexString().
Referenced by CheckCompatibility(), lfg::LFGMgr::JoinLfg(), lfg::LFGMgr::LeaveLfg(), lfg::LFGMgr::RemoveProposal(), and lfg::LFGMgr::UpdateProposal().
| void lfg::LFGQueue::RemoveQueueData | ( | ObjectGuid | guid | ) |
Definition at line 199 of file LFGQueue.cpp.
References QueueDataStore.
|
private |
Definition at line 264 of file LFGQueue.cpp.
References CompatibleMapStore.
Referenced by CheckCompatibility().
|
private |
Stores the compatibility of a list of guids
| [in] | key | String concatenation of guids (| used as separator) |
| [in] | compatibles | type of compatibility |
Definition at line 258 of file LFGQueue.cpp.
References lfg::LfgCompatibilityData::compatibility, and CompatibleMapStore.
Referenced by CheckCompatibility(), and FindNewGroups().
|
private |
Definition at line 713 of file LFGQueue.cpp.
References lfg::LfgQueueData::bestCompatible, lfg::LfgQueueData::dps, lfg::LfgQueueData::healers, lfg::LFG_DPS_NEEDED, lfg::LFG_HEALERS_NEEDED, lfg::LFG_TANKS_NEEDED, lfg::PLAYER_ROLE_HEALER, lfg::PLAYER_ROLE_TANK, lfg::LfgQueueData::tanks, and TC_LOG_DEBUG.
Referenced by CheckCompatibility(), and FindBestCompatibleInQueue().
| void lfg::LFGQueue::UpdateQueueTimers | ( | uint8 | queueId, |
| time_t | currTime | ||
| ) |
Definition at line 588 of file LFGQueue.cpp.
References lfg::LfgQueueData::bestCompatible, lfg::LfgQueueData::dps, lfg::LfgQueueData::dungeons, FindBestCompatibleInQueue(), lfg::LfgQueueData::healers, lfg::LfgQueueData::joinTime, lfg::PLAYER_ROLE_DAMAGE, lfg::PLAYER_ROLE_HEALER, lfg::PLAYER_ROLE_NONE, lfg::PLAYER_ROLE_TANK, QueueDataStore, lfg::LfgQueueData::roles, lfg::LFGMgr::SendLfgQueueStatus(), lfg::LfgQueueData::tanks, TC_LOG_TRACE, waitTimesAvgStore, waitTimesDpsStore, waitTimesHealerStore, and waitTimesTankStore.
Definition at line 206 of file LFGQueue.cpp.
References lfg::LfgWaitTime::number, lfg::LfgWaitTime::time, and waitTimesAvgStore.
Referenced by lfg::LFGMgr::UpdateProposal().
Definition at line 227 of file LFGQueue.cpp.
References lfg::LfgWaitTime::number, lfg::LfgWaitTime::time, and waitTimesDpsStore.
Referenced by lfg::LFGMgr::UpdateProposal().
Definition at line 220 of file LFGQueue.cpp.
References lfg::LfgWaitTime::number, lfg::LfgWaitTime::time, and waitTimesHealerStore.
Referenced by lfg::LFGMgr::UpdateProposal().
Definition at line 213 of file LFGQueue.cpp.
References lfg::LfgWaitTime::number, lfg::LfgWaitTime::time, and waitTimesTankStore.
Referenced by lfg::LFGMgr::UpdateProposal().
|
private |
Compatible dungeons.
Definition at line 140 of file LFGQueue.h.
Referenced by DumpCompatibleInfo(), FindBestCompatibleInQueue(), GetCompatibilityData(), GetCompatibles(), RemoveFromCompatibles(), SetCompatibilityData(), and SetCompatibles().
|
private |
Ordered list. Used to find groups.
Definition at line 146 of file LFGQueue.h.
Referenced by AddToCurrentQueue(), AddToFrontCurrentQueue(), DumpQueueInfo(), FindGroups(), and RemoveFromCurrentQueue().
|
private |
New groups to add to queue.
Definition at line 147 of file LFGQueue.h.
Referenced by AddToNewQueue(), DumpQueueInfo(), FindGroups(), and RemoveFromNewQueue().
|
private |
Queued groups.
Definition at line 139 of file LFGQueue.h.
Referenced by AddQueueData(), AddToQueue(), CheckCompatibility(), GetDetailedMatchRoles(), GetJoinTime(), RemoveFromQueue(), RemoveQueueData(), and UpdateQueueTimers().
|
private |
Average wait time to find a group queuing as multiple roles.
Definition at line 142 of file LFGQueue.h.
Referenced by UpdateQueueTimers(), and UpdateWaitTimeAvg().
|
private |
Average wait time to find a group queuing as dps.
Definition at line 145 of file LFGQueue.h.
Referenced by UpdateQueueTimers(), and UpdateWaitTimeDps().
|
private |
Average wait time to find a group queuing as healer.
Definition at line 144 of file LFGQueue.h.
Referenced by UpdateQueueTimers(), and UpdateWaitTimeHealer().
|
private |
Average wait time to find a group queuing as tank.
Definition at line 143 of file LFGQueue.h.
Referenced by UpdateQueueTimers(), and UpdateWaitTimeTank().