Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
lfg::LFGQueue Class Reference

#include <LFGQueue.h>

Public Member Functions

void AddQueueData (uint64 guid, time_t joinTime, LfgDungeonSet const &dungeons, LfgRolesMap const &rolesMap)
void AddToQueue (uint64 guid, bool reQueue=false)
std::string DumpCompatibleInfo (bool full=false) const
std::string DumpQueueInfo (bool full=false) const
uint8 FindGroups ()
time_t GetJoinTime (uint64 guid) const
bool HasQueueData (uint64 guid) const
void RemoveFromQueue (uint64 guid)
void RemoveQueueData (uint64 guid)
void UpdateQueueTimers (uint8 queueId, time_t currTime)
void UpdateWaitTimeAvg (int32 waitTime, uint32 dungeonId)
void UpdateWaitTimeDps (int32 waitTime, uint32 dungeonId)
void UpdateWaitTimeHealer (int32 waitTime, uint32 dungeonId)
void UpdateWaitTimeTank (int32 waitTime, uint32 dungeonId)

Private Member Functions

void AddToCurrentQueue (uint64 guid)
void AddToNewQueue (uint64 guid)
LfgCompatibility CheckCompatibility (LfgGuidList check)
void FindBestCompatibleInQueue (LfgQueueDataContainer::iterator itrQueue)
LfgCompatibility FindNewGroups (LfgGuidList &check, LfgGuidList &all)
LfgCompatibilityDataGetCompatibilityData (std::string const &key)
LfgCompatibility GetCompatibles (std::string const &key)
void RemoveFromCompatibles (uint64 guid)
void RemoveFromCurrentQueue (uint64 guid)
void RemoveFromNewQueue (uint64 guid)
LfgRolesMap const & RemoveFromQueueUpdateData (uint64 guid)
void SetCompatibilityData (std::string const &key, LfgCompatibilityData const &compatibles)
void SetCompatibles (std::string const &key, LfgCompatibility compatibles)
void SetQueueUpdateData (std::string const &strGuids, LfgRolesMap const &proposalRoles)
void UpdateBestCompatibleInQueue (LfgQueueDataContainer::iterator itrQueue, std::string const &key, LfgRolesMap const &roles)

Private Attributes

LfgCompatibleContainer CompatibleMapStore
 Compatible dungeons.
LfgGuidList currentQueueStore
 Ordered list. Used to find groups.
LfgGuidList newToQueueStore
 New groups to add to queue.
LfgQueueDataContainer QueueDataStore
 Queued groups.
LfgWaitTimesContainer waitTimesAvgStore
 Average wait time to find a group queuing as multiple roles.
LfgWaitTimesContainer waitTimesDpsStore
 Average wait time to find a group queuing as dps.
LfgWaitTimesContainer waitTimesHealerStore
 Average wait time to find a group queuing as healer.
LfgWaitTimesContainer waitTimesTankStore
 Average wait time to find a group queuing as tank.

Detailed Description

Stores all data related to queue

Definition at line 74 of file LFGQueue.h.

Member Function Documentation

◆ AddQueueData()

void lfg::LFGQueue::AddQueueData ( uint64 guid,
time_t joinTime,
LfgDungeonSet const & dungeons,
LfgRolesMap const & rolesMap )

Definition at line 353 of file LFGQueue.cpp.

References AddToQueue(), and QueueDataStore.

Referenced by lfg::LFGMgr::JoinLfg(), and lfg::LFGMgr::UpdateRoleCheck().

◆ AddToCurrentQueue()

void lfg::LFGQueue::AddToCurrentQueue ( uint64 guid)
private

Definition at line 342 of file LFGQueue.cpp.

References currentQueueStore.

Referenced by AddToQueue(), and FindGroups().

◆ AddToNewQueue()

void lfg::LFGQueue::AddToNewQueue ( uint64 guid)
private

Definition at line 331 of file LFGQueue.cpp.

References newToQueueStore.

Referenced by AddToQueue().

◆ AddToQueue()

void lfg::LFGQueue::AddToQueue ( uint64 guid,
bool reQueue = false )

◆ CheckCompatibility()

LfgCompatibility lfg::LFGQueue::CheckCompatibility ( LfgGuidList check)
private

Check compatibilities between groups. If group is Matched proposal will be created

Parameters
[in]checkList of guids to check compatibilities
Returns
LfgCompatibility type of compatibility

Definition at line 524 of file LFGQueue.cpp.

References lfg::LfgProposalPlayer::accept, lfg::LfgProposal::cancelTime, CheckCompatibility(), lfg::ConcatenateDungeons(), lfg::ConcatenateGuids(), lfg::LfgProposal::dungeonId, lfg::LfgQueueData::dungeons, lfg::GetRolesString(), lfg::LfgProposal::group, lfg::LfgProposalPlayer::group, GUID_LOPART(), IS_GROUP_GUID(), 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, MAXGROUPSIZE, MAXRAIDSIZE, lfg::PLAYER_ROLE_LEADER, lfg::LfgProposal::players, QueueDataStore, lfg::LfgProposal::queues, RemoveFromCurrentQueue(), RemoveFromNewQueue(), RemoveFromQueue(), lfg::LfgProposalPlayer::role, lfg::LfgCompatibilityData::roles, lfg::LfgQueueData::roles, Skyfire::Containers::SelectRandomContainerElement(), SetCompatibilityData(), SetCompatibles(), SF_LOG_DEBUG, SF_LOG_ERROR, sLFGMgr, lfg::LfgProposal::state, and UpdateBestCompatibleInQueue().

Referenced by CheckCompatibility(), and FindNewGroups().

◆ DumpCompatibleInfo()

std::string lfg::LFGQueue::DumpCompatibleInfo ( bool full = false) const

Definition at line 942 of file LFGQueue.cpp.

References CompatibleMapStore, and lfg::GetCompatibleString().

◆ DumpQueueInfo()

◆ FindBestCompatibleInQueue()

void lfg::LFGQueue::FindBestCompatibleInQueue ( LfgQueueDataContainer::iterator itrQueue)
private

◆ FindGroups()

◆ FindNewGroups()

LfgCompatibility lfg::LFGQueue::FindNewGroups ( LfgGuidList & check,
LfgGuidList & all )
private

Checks que main queue to try to form a Lfg group. Returns first match found (if any)

Parameters
[in]checkList of guids trying to match with other groups
[in]allList of all other guids in main queue to match against
Returns
LfgCompatibility type of compatibility between groups

Definition at line 486 of file LFGQueue.cpp.

References CheckCompatibility(), lfg::ConcatenateGuids(), FindNewGroups(), GetCompatibles(), lfg::GetCompatibleString(), lfg::LFG_COMPATIBILITY_PENDING, lfg::LFG_COMPATIBLES_BAD_STATES, lfg::LFG_COMPATIBLES_MATCH, lfg::LFG_COMPATIBLES_WITH_LESS_PLAYERS, SetCompatibles(), SF_LOG_DEBUG, and sLFGMgr.

Referenced by FindGroups(), and FindNewGroups().

◆ GetCompatibilityData()

LfgCompatibilityData * lfg::LFGQueue::GetCompatibilityData ( std::string const & key)
private

Definition at line 447 of file LFGQueue.cpp.

References CompatibleMapStore.

◆ GetCompatibles()

LfgCompatibility lfg::LFGQueue::GetCompatibles ( std::string const & key)
private

Get the compatibility of a group of guids

Parameters
[in]keyString concatenation of guids (| used as separator)
Returns
LfgCompatibility type of compatibility

Definition at line 438 of file LFGQueue.cpp.

References CompatibleMapStore, and lfg::LFG_COMPATIBILITY_PENDING.

Referenced by FindNewGroups().

◆ GetJoinTime()

time_t lfg::LFGQueue::GetJoinTime ( uint64 guid) const

Definition at line 836 of file LFGQueue.cpp.

References QueueDataStore.

Referenced by lfg::LFGMgr::UpdateProposal().

◆ HasQueueData()

bool lfg::LFGQueue::HasQueueData ( uint64 guid) const

Definition at line 366 of file LFGQueue.cpp.

References QueueDataStore.

Referenced by lfg::LFGMgr::RemoveProposal(), and lfg::LFGMgr::UpdateProposal().

◆ RemoveFromCompatibles()

void lfg::LFGQueue::RemoveFromCompatibles ( uint64 guid)
private

Remove from cached compatible dungeons any entry that contains the given guid

Parameters
[in]guidGuid to remove from compatible cache

Definition at line 404 of file LFGQueue.cpp.

References CompatibleMapStore, GUID_LOPART(), and SF_LOG_DEBUG.

Referenced by RemoveFromQueue().

◆ RemoveFromCurrentQueue()

void lfg::LFGQueue::RemoveFromCurrentQueue ( uint64 guid)
private

Definition at line 348 of file LFGQueue.cpp.

References currentQueueStore.

Referenced by CheckCompatibility(), and RemoveFromQueue().

◆ RemoveFromNewQueue()

void lfg::LFGQueue::RemoveFromNewQueue ( uint64 guid)
private

Definition at line 337 of file LFGQueue.cpp.

References newToQueueStore.

Referenced by CheckCompatibility(), FindGroups(), and RemoveFromQueue().

◆ RemoveFromQueue()

◆ RemoveFromQueueUpdateData()

LfgRolesMap const & lfg::LFGQueue::RemoveFromQueueUpdateData ( uint64 guid)
private

◆ RemoveQueueData()

void lfg::LFGQueue::RemoveQueueData ( uint64 guid)

Definition at line 359 of file LFGQueue.cpp.

References QueueDataStore.

◆ SetCompatibilityData()

void lfg::LFGQueue::SetCompatibilityData ( std::string const & key,
LfgCompatibilityData const & compatibles )
private

Definition at line 427 of file LFGQueue.cpp.

References CompatibleMapStore.

Referenced by CheckCompatibility().

◆ SetCompatibles()

void lfg::LFGQueue::SetCompatibles ( std::string const & key,
LfgCompatibility compatibles )
private

Stores the compatibility of a list of guids

Parameters
[in]keyString concatenation of guids (| used as separator)
[in]compatiblestype of compatibility

Definition at line 421 of file LFGQueue.cpp.

References lfg::LfgCompatibilityData::compatibility, and CompatibleMapStore.

Referenced by CheckCompatibility(), and FindNewGroups().

◆ SetQueueUpdateData()

void lfg::LFGQueue::SetQueueUpdateData ( std::string const & strGuids,
LfgRolesMap const & proposalRoles )
private

◆ UpdateBestCompatibleInQueue()

void lfg::LFGQueue::UpdateBestCompatibleInQueue ( LfgQueueDataContainer::iterator itrQueue,
std::string const & key,
LfgRolesMap const & roles )
private

◆ UpdateQueueTimers()

◆ UpdateWaitTimeAvg()

void lfg::LFGQueue::UpdateWaitTimeAvg ( int32 waitTime,
uint32 dungeonId )

◆ UpdateWaitTimeDps()

void lfg::LFGQueue::UpdateWaitTimeDps ( int32 waitTime,
uint32 dungeonId )

◆ UpdateWaitTimeHealer()

void lfg::LFGQueue::UpdateWaitTimeHealer ( int32 waitTime,
uint32 dungeonId )

◆ UpdateWaitTimeTank()

void lfg::LFGQueue::UpdateWaitTimeTank ( int32 waitTime,
uint32 dungeonId )

Member Data Documentation

◆ CompatibleMapStore

LfgCompatibleContainer lfg::LFGQueue::CompatibleMapStore
private

◆ currentQueueStore

LfgGuidList lfg::LFGQueue::currentQueueStore
private

Ordered list. Used to find groups.

Definition at line 130 of file LFGQueue.h.

Referenced by AddToCurrentQueue(), DumpQueueInfo(), FindGroups(), RemoveFromCurrentQueue(), and UpdateQueueTimers().

◆ newToQueueStore

LfgGuidList lfg::LFGQueue::newToQueueStore
private

New groups to add to queue.

Definition at line 131 of file LFGQueue.h.

Referenced by AddToNewQueue(), DumpQueueInfo(), FindGroups(), RemoveFromNewQueue(), and UpdateQueueTimers().

◆ QueueDataStore

LfgQueueDataContainer lfg::LFGQueue::QueueDataStore
private

◆ waitTimesAvgStore

LfgWaitTimesContainer lfg::LFGQueue::waitTimesAvgStore
private

Average wait time to find a group queuing as multiple roles.

Definition at line 126 of file LFGQueue.h.

Referenced by UpdateQueueTimers(), and UpdateWaitTimeAvg().

◆ waitTimesDpsStore

LfgWaitTimesContainer lfg::LFGQueue::waitTimesDpsStore
private

Average wait time to find a group queuing as dps.

Definition at line 129 of file LFGQueue.h.

Referenced by UpdateQueueTimers(), and UpdateWaitTimeDps().

◆ waitTimesHealerStore

LfgWaitTimesContainer lfg::LFGQueue::waitTimesHealerStore
private

Average wait time to find a group queuing as healer.

Definition at line 128 of file LFGQueue.h.

Referenced by UpdateQueueTimers(), and UpdateWaitTimeHealer().

◆ waitTimesTankStore

LfgWaitTimesContainer lfg::LFGQueue::waitTimesTankStore
private

Average wait time to find a group queuing as tank.

Definition at line 127 of file LFGQueue.h.

Referenced by UpdateQueueTimers(), and UpdateWaitTimeTank().


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