48 maxlevel(), difficulty(
REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
53 type(dbc->
TypeID), expansion(
uint8(dbc->ExpansionLevel)), group(
uint8(dbc->GroupID)),
55 maxlevel({
uint8(dbc->MaxLevel),
uint8(dbc->MaxLevel),
uint8(dbc->MaxLevel) }),
79 SetLeader(guid, ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt32()));
84 if (!dungeon || !state)
130 QueryResult result =
WorldDatabase.Query(
"SELECT dungeonId, maxLevel, firstQuestId, otherQuestId FROM lfg_dungeon_rewards ORDER BY dungeonId, maxLevel ASC");
134 TC_LOG_INFO(
"server.loading",
">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
140 Field* fields =
nullptr;
143 fields = result->Fetch();
151 TC_LOG_ERROR(
"sql.sql",
"Dungeon {} specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
157 TC_LOG_ERROR(
"sql.sql",
"Level {} specified for dungeon {} in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
161 if (!firstQuestId || !
sObjectMgr->GetQuestTemplate(firstQuestId))
163 TC_LOG_ERROR(
"sql.sql",
"First quest {} specified for dungeon {} in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
167 if (otherQuestId && !
sObjectMgr->GetQuestTemplate(otherQuestId))
169 TC_LOG_ERROR(
"sql.sql",
"Other quest {} specified for dungeon {} in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
173 RewardMapStore.insert(LfgRewardContainer::value_type(dungeonId,
new LfgReward(maxLevel, firstQuestId, otherQuestId)));
176 while (result->NextRow());
185 return &(itr->second);
218 dungeon->minlevel[dungeonExpansion->ExpansionLevel] = dungeonExpansion->HardLevelMin;
219 dungeon->maxlevel[dungeonExpansion->ExpansionLevel] = dungeonExpansion->HardLevelMax;
225 QueryResult result =
WorldDatabase.Query(
"SELECT dungeonId, position_x, position_y, position_z, orientation FROM lfg_dungeon_template");
228 TC_LOG_INFO(
"server.loading",
">> Loaded 0 lfg dungeon templates. DB table `lfg_dungeon_template` is empty!");
236 Field* fields = result->Fetch();
238 LFGDungeonContainer::iterator dungeonItr =
LfgDungeonStore.find(dungeonId);
241 TC_LOG_ERROR(
"sql.sql",
"table `lfg_dungeon_template` contains coordinates for wrong dungeon {}", dungeonId);
253 while (result->NextRow());
270 TC_LOG_ERROR(
"sql.sql",
"Failed to load dungeon {} (Id: {}), cant find areatrigger for map {}", dungeon.
name, dungeon.
id, dungeon.
map);
303 LfgRoleCheckContainer::iterator itRoleCheck = it++;
309 for (LfgRolesMap::const_iterator itRoles = roleCheck.
roles.begin(); itRoles != roleCheck.
roles.end(); ++itRoles)
314 if (guid == roleCheck.
leader)
318 RestoreState(itRoleCheck->first,
"Remove Obsolete RoleCheck");
325 LfgProposalContainer::iterator itRemove = it++;
326 if (itRemove->second.cancelTime < currTime)
333 LfgPlayerBootContainer::iterator itBoot = it++;
338 for (LfgAnswerContainer::const_iterator itVotes = boot.
votes.begin(); itVotes != boot.
votes.end(); ++itVotes)
352 if (
uint8 newProposals = it->second.FindGroups())
353 TC_LOG_DEBUG(
"lfg.update",
"Found {} new groups in queue {}", newProposals, it->first);
360 uint32 proposalId = itProposal->first;
364 for (LfgProposalPlayerContainer::const_iterator itPlayers = proposal.
players.begin(); itPlayers != proposal.
players.end(); ++itPlayers)
366 guid = itPlayers->first;
389 it->second.UpdateQueueTimers(currTime);
407 if (!player || !player->
GetSession() || dungeons.empty())
450 else if (dungeons.empty())
452 else if (player->
HasAura(9454))
460 uint8 memberCount = 0;
463 if (
Player* plrg = itr->GetSource())
471 else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
473 else if (plrg->HasAura(9454))
476 players.insert(plrg->GetGUID());
485 players.insert(player->
GetGUID());
491 bool isDungeon =
false;
492 for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end() && joinData.
result ==
LFG_JOIN_OK; ++it)
498 if (dungeons.size() > 1)
501 rDungeonId = (*dungeons.begin());
529 if (dungeons.empty())
537 TC_LOG_DEBUG(
"lfg.join",
"{} joining with {} members. Result: {}, Dungeons: {}",
540 if (!dungeons.empty())
554 std::string debugNames =
"";
568 dungeons.insert(rDungeonId);
576 if (
Player* plrg = itr->GetSource())
579 plrg->GetSession()->SendLfgUpdateParty(updateData);
583 roleCheck.
roles[pguid] = 0;
584 if (!debugNames.empty())
585 debugNames.append(
", ");
586 debugNames.append(plrg->GetName());
595 rolesMap[guid] = roles;
604 dungeons.insert(rDungeonId);
613 debugNames.append(player->
GetName());
651 for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
676 LfgProposalPlayerContainer::iterator itPlayer = it->second.players.find(pguid);
677 if (itPlayer != it->second.players.end())
696 if (guid != gguid && !disconnected)
715 LfgRoleCheckContainer::iterator itRoleCheck =
RoleChecksStore.find(gguid);
739 roleCheck.
roles[guid] = roles;
742 LfgRolesMap::const_iterator itRoles = roleCheck.
roles.begin();
746 if (itRoles == roleCheck.
roles.end())
749 check_roles = roleCheck.
roles;
761 for (LfgRolesMap::const_iterator it = roleCheck.
roles.begin(); it != roleCheck.
roles.end(); ++it)
769 switch (roleCheck.
state)
779 if (roleCheck.
leader == pguid)
812 std::map<uint32, uint32> lockedDungeons;
814 for (GuidSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it)
819 for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && !dungeons.empty(); ++it2)
821 uint32 dungeonId = (it2->first & 0x00FFFFFF);
822 LfgDungeonSet::iterator itDungeon = dungeons.find(dungeonId);
823 if (itDungeon != dungeons.end())
825 bool eraseDungeon =
true;
837 uint32 dungeonInstanceId = playerSave->GetInstanceId();
838 auto itLockedDungeon = lockedDungeons.find(dungeonId);
839 if (itLockedDungeon == lockedDungeons.end() || itLockedDungeon->second == dungeonInstanceId)
840 eraseDungeon =
false;
842 lockedDungeons[dungeonId] = dungeonInstanceId;
848 dungeons.erase(itDungeon);
850 lockMap[guid][dungeonId] = it2->second;
854 if (!dungeons.empty())
873 for (LfgRolesMap::iterator it = groles.begin(); it != groles.end(); ++it)
875 uint8 role = it->second & ~PLAYER_ROLE_LEADER;
924 return (tank + healer + damage) ==
uint8(groles.size());
933 GuidList players, tankPlayers, healPlayers, dpsPlayers;
936 for (LfgProposalPlayerContainer::const_iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
939 if (guid == proposal.
leader)
940 players.push_back(guid);
945 tankPlayers.push_back(guid);
948 healPlayers.push_back(guid);
951 dpsPlayers.push_back(guid);
954 ABORT_MSG(
"Invalid LFG role %u", it->second.role);
959 playersToTeleport.push_back(guid);
962 players.splice(players.end(), tankPlayers);
963 players.splice(players.end(), healPlayers);
964 players.splice(players.end(), dpsPlayers);
971 for (GuidList::const_iterator it = players.begin(); it != players.end(); ++it)
979 if (group && group != grp)
991 else if (group != grp)
998 if (!dungeons.empty())
1000 uint32 rDungeonId = (*dungeons.begin());
1016 for (GuidList::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it)
1041 LfgProposalContainer::iterator itProposal =
ProposalsStore.find(proposalId);
1048 LfgProposalPlayerContainer::iterator itProposalPlayer = proposal.
players.find(guid);
1049 if (itProposalPlayer == proposal.
players.end())
1055 TC_LOG_DEBUG(
"lfg.proposal.update",
"{}, Proposal {}, Selection: {}", guid.
ToString(), proposalId, accept);
1063 bool allAnswered =
true;
1064 for (LfgProposalPlayerContainer::const_iterator itPlayers = proposal.
players.begin(); itPlayers != proposal.
players.end(); ++itPlayers)
1066 allAnswered =
false;
1070 for (LfgProposalPlayerContainer::const_iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
1082 for (LfgProposalPlayerContainer::const_iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
1087 int32 waitTime = -1;
1107 role &= ~PLAYER_ROLE_LEADER;
1126 if (
Group* group = player->GetGroup())
1127 PlayersStore[pguid].SetNumberOfPartyMembersAtJoin(group->GetMembersCount());
1133 for (GuidList::const_iterator it = proposal.
queues.begin(); it != proposal.
queues.end(); ++it)
1151 TC_LOG_DEBUG(
"lfg.proposal.remove",
"Proposal {}, state FAILED, UpdateType {}", itProposal->first, type);
1154 for (LfgProposalPlayerContainer::iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
1160 for (LfgProposalPlayerContainer::iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
1170 toRemove.insert(guid);
1175 for (LfgProposalPlayerContainer::const_iterator it = proposal.
players.begin(); it != proposal.
players.end(); ++it)
1182 if (toRemove.find(gguid) != toRemove.end())
1188 TC_LOG_DEBUG(
"lfg.proposal.remove",
"{} didn't accept. Removing from queue and compatible cache", guid.
ToString());
1193 TC_LOG_DEBUG(
"lfg.proposal.remove",
"{} in same group that someone that didn't accept. Removing from queue and compatible cache", guid.
ToString());
1196 RestoreState(guid,
"Proposal Fail (didn't accepted or in group with someone that didn't accept");
1199 RestoreState(it->second.group,
"Proposal Fail (someone in group didn't accepted)");
1221 for (GuidSet::const_iterator it = toRemove.begin(); it != toRemove.end(); ++it)
1225 proposal.
queues.remove(guid);
1229 for (GuidList::const_iterator it = proposal.
queues.begin(); it != proposal.
queues.end(); ++it)
1259 for (GuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr)
1269 for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
1285 LfgPlayerBootContainer::iterator itBoot =
BootsStore.find(gguid);
1298 for (LfgAnswerContainer::const_iterator itVotes = boot.
votes.begin(); itVotes != boot.
votes.end(); ++itVotes)
1300 switch (itVotes->second)
1319 for (LfgAnswerContainer::const_iterator itVotes = boot.
votes.begin(); itVotes != boot.
votes.end(); ++itVotes)
1322 if (pguid != boot.
victim)
1353 TC_LOG_DEBUG(
"lfg.teleport",
"Player {} not in group/lfggroup or dungeon not found!",
1361 TC_LOG_DEBUG(
"lfg.teleport",
"Player {} is being teleported out. Current Map {} - Expected Map {}",
1381 else if (player->
HasAura(9454))
1386 float x = dungeon->
x;
1387 float y = dungeon->
y;
1388 float z = dungeon->
z;
1389 float orientation = dungeon->
o;
1396 Player* plrg = itr->GetSource();
1414 if (!player->
TeleportTo(mapid, x, y, z, orientation))
1423 TC_LOG_DEBUG(
"lfg.teleport",
"Player {} is being teleported in to map {} "
1424 "(x: {}, y: {}, z: {}) Result: {}", player->
GetName(), dungeon->
map,
1425 dungeon->
x, dungeon->
y, dungeon->
z, error);
1437 if (gDungeonId != dungeonId)
1439 TC_LOG_DEBUG(
"lfg.dungeon.finish",
"Group {} finished dungeon {} but queued for {}", gguid.
ToString(), dungeonId, gDungeonId);
1452 for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
1463 if (!dungeons.empty())
1464 rDungeonId = (*dungeons.begin());
1473 TC_LOG_DEBUG(
"lfg.dungeon.finish",
"Group: {}, Player: {} dungeon {} is not random or seasonal", gguid.
ToString(), guid.
ToString(), rDungeonId);
1484 if (player->
FindMap() != currMap)
1504 uint8 lfdRandomPlayers = 0;
1506 lfdRandomPlayers = 5 - numParty;
1508 lfdRandomPlayers = 4;
1569 for (LfgRewardContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
1573 if (itr->second->maxLevel >= level)
1618 TC_LOG_TRACE(
"lfg.data.group.oldstate.get",
"Group: {}, Old state: {}", guid.
ToString(), state);
1623 TC_LOG_TRACE(
"lfg.data.player.oldstate.get",
"Player: {}, Old state: {}", guid.
ToString(), state);
1633 bool active =
GroupsStore[gguid].IsVoteKickActive();
1634 TC_LOG_TRACE(
"lfg.data.group.votekick.get",
"Group: {}, Active: {}", gguid.
ToString(), active);
1642 TC_LOG_TRACE(
"lfg.data.group.dungeon.get",
"Group: {}, asId: {}, Dungeon: {}", guid.
ToString(), asId, dungeon);
1652 mapId = dungeon->map;
1654 TC_LOG_TRACE(
"lfg.data.group.dungeon.map",
"Group: {}, MapId: {} (DungeonId: {})", guid.
ToString(), mapId, dungeonId);
1680 TC_LOG_TRACE(
"lfg.data.player.dungeons.locked.get",
"Player: {}, LockedDungeons.", guid.
ToString());
1685 TC_LOG_WARN(
"lfg.data.player.dungeons.locked.get",
"Player: {} not ingame while retrieving his LockedDungeons.", guid.
ToString());
1694 for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it)
1703 else if (dungeon->
expansion > expansion)
1711 else if (dungeon->
minlevel[expansion] > level)
1713 else if (dungeon->
maxlevel[expansion] < level)
1721 else if (ar->achievement && !player->
HasAchieved(ar->achievement))
1733 else if (ar->item2 && !player->
HasItemCount(ar->item2))
1744 lock[dungeon->
Entry()] = lockStatus;
1753 TC_LOG_TRACE(
"lfg.data.group.kickleft.get",
"Group: {}, Kicks left: {}", guid.
ToString(), kicks);
1762 TC_LOG_TRACE(
"lfg.data.group.state.restore",
"Group: {} ({}), State: {}, Old state: {}",
1771 TC_LOG_TRACE(
"lfg.data.player.state.restore",
"Player: {} ({}), State: {}, Old state: {}",
1784 TC_LOG_TRACE(
"lfg.data.group.state.set",
"Group: {}, New state: {}, Previous: {}, Old state: {}",
1793 TC_LOG_TRACE(
"lfg.data.player.state.set",
"Player: {}, New state: {}, Previous: {}, OldState: {}",
1806 TC_LOG_TRACE(
"lfg.data.group.votekick.set",
"Group: {}, New state: {}, Previous: {}",
1814 TC_LOG_TRACE(
"lfg.data.group.dungeon.set",
"Group: {}, Dungeon: {}", guid.
ToString(), dungeon);
1826 TC_LOG_TRACE(
"lfg.data.player.comment.set",
"Player: {}, Comment: {}", guid.
ToString(), comment);
1845 LfgPlayerDataContainer::iterator it =
PlayersStore.find(guid);
1853 LfgGroupDataContainer::iterator it =
GroupsStore.find(guid);
1859 GuidSet const& players = it->second.GetPlayers();
1883 roles &= ~PLAYER_ROLE_TANK;
1885 roles &= ~PLAYER_ROLE_HEALER;
1953 player->GetSession()->SendLfgRoleCheckUpdate(roleCheck);
1959 player->GetSession()->SendLfgUpdatePlayer(data);
1965 player->GetSession()->SendLfgUpdateParty(data);
1971 player->GetSession()->SendLfgJoinResult(data);
1977 player->GetSession()->SendLfgBootProposalUpdate(boot);
1983 player->GetSession()->SendLfgUpdateProposal(proposal);
1989 player->GetSession()->SendLfgQueueStatus(data);
2021 for (GuidList::const_iterator it = check.begin(); it != check.end(); ++it)
2027 TC_LOG_DEBUG(
"lfg.allqueued",
"Unexpected state found while trying to form new group. Guid: {}, State: {}", (*it).ToString(),
GetStateString(state));
2038 LfgQueueContainer::const_iterator itr =
QueuesStore.find(queueId);
2040 return itr->second.GetJoinTime(guid);
2091 std::ostringstream o;
2093 o <<
"Number of Queues: " << size <<
"\n";
2096 std::string
const& queued = itr->second.DumpQueueInfo();
2097 std::string
const& compatibles = itr->second.DumpCompatibleInfo(full);
2098 o << queued << compatibles;
2119 if (!dungeons.empty())
2137 if (
uint32(dungeon->map) == map && dungeon->difficulty == difficulty)
2147 return dungeon->Entry();
2160 randomDungeons.insert(dungeon.
Entry());
2162 return randomDungeons;
@ DUNGEON_DIFFICULTY_NORMAL
@ DUNGEON_DIFFICULTY_HEROIC
@ ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS
DBCStorage< LFGDungeonEntry > sLFGDungeonStore(LFGDungeonEntryfmt)
DBCStorage< LFGDungeonExpansionEntry > sLFGDungeonExpansionStore(LFGDungeonExpansionfmt)
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
std::shared_ptr< ResultSet > QueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
bool IsHolidayActive(HolidayIds id)
#define TC_LOG_WARN(filterType__,...)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_TRACE(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
std::list< ObjectGuid > GuidList
std::set< ObjectGuid > GuidSet
Role Based Access Control related classes definition.
@ HOLIDAY_LOVE_IS_IN_THE_AIR
@ GROUP_REMOVEMETHOD_KICK_LFG
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Class used to access individual fields of database query result.
void SetDungeonDifficulty(Difficulty difficulty)
bool AddMember(Player *player)
ObjectGuid GetGUID() const
uint32 GetMembersCount() const
void SetLfgRoles(ObjectGuid guid, uint8 roles)
GroupReference * GetFirstMember()
bool RemoveMember(ObjectGuid guid, RemoveMethod const &method=GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker=ObjectGuid::Empty, char const *reason=nullptr)
bool Create(Player *leader)
uint32 GetDbStoreId() const
static ObjectGuid const Empty
std::string ToString() const
static ObjectGuid GetGUID(Object const *o)
bool HasIgnore(ObjectGuid const &ignoreGuid)
void RewardQuest(Quest const *quest, uint32 reward, Object *questGiver, bool announce=true)
bool GetQuestRewardStatus(uint32 quest_id) const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
void SetBattlegroundEntryPoint()
bool InBattleground() const
bool CanRewardQuest(Quest const *quest, bool msg)
bool HasAchieved(uint32 achievementId) const
bool InBattlegroundQueue(bool ignoreArena=false) const
WorldSession * GetSession() const
bool TeleportToBGEntryPoint()
bool IsMirrorTimerActive(MirrorTimerType type) const
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
float GetAverageItemLevel() const
static void RemoveFromGroup(Group *group, ObjectGuid guid, RemoveMethod method=GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker=ObjectGuid::Empty, char const *reason=nullptr)
PlayerSocial * GetSocial()
InstancePlayerBind * GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired=false)
void setUInt32(uint8 index, uint32 value)
Vehicle * GetVehicle() const
uint32 GetClassMask() const
ObjectGuid GetCharmedGUID() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool HasUnitState(const uint32 f) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string const & GetName() const
void SendLfgJoinResult(lfg::LfgJoinResultData const &joinData)
void SendLfgTeleportError(uint8 err)
void SendLfgUpdatePlayer(lfg::LfgUpdateData const &updateData)
void SendLfgPlayerReward(lfg::LfgPlayerRewardData const &lfgPlayerRewardData)
bool HasPermission(uint32 permissionId)
void SendLfgRoleChosen(ObjectGuid guid, uint8 roles)
uint8 GetKicksLeft(ObjectGuid gguid)
Get kicks left in current group.
void _LoadFromDB(Field *fields, ObjectGuid guid)
Load Lfg group info from DB.
void InitBoot(ObjectGuid gguid, ObjectGuid kguid, ObjectGuid vguid, std::string const &reason)
Inits new proposal to boot a player.
uint32 GetLFGDungeonEntry(uint32 id)
Return Lfg dungeon entry for given dungeon id.
time_t GetQueueJoinTime(ObjectGuid guid)
Gets queue join time.
LfgProposalContainer ProposalsStore
Current Role checks.
uint8 GetPlayerCount(ObjectGuid guid)
Gets the player count of given group.
void SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const &dungeons)
ObjectGuid GetLeader(ObjectGuid guid)
Get leader of the group (using internal data)
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 TeleportPlayer(Player *player, bool out, bool fromOpcode=false)
Teleport a player to/from selected dungeon.
LfgState GetOldState(ObjectGuid guid)
Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
void SetComment(ObjectGuid guid, std::string const &comment)
Sets player lfr comment.
void AddPlayerToGroup(ObjectGuid gguid, ObjectGuid guid)
Adds player to group.
void SetGroup(ObjectGuid guid, ObjectGuid group)
Sets player group.
LFGDungeonContainer LfgDungeonStore
Stores rewards for random dungeons.
void SendLfgBootProposalUpdate(ObjectGuid guid, LfgPlayerBoot const &boot)
void SetDungeon(ObjectGuid guid, uint32 dungeon)
LfgPlayerBootContainer BootsStore
Current Proposals.
uint8 GetTeam(ObjectGuid guid)
void SetupGroupMember(ObjectGuid guid, ObjectGuid gguid)
Initializes player data after loading group data from DB.
static LFGMgr * instance()
void RestoreState(ObjectGuid guid, char const *debugMsg)
std::string DumpQueueInfo(bool full=false)
Dumps the state of the queue - Only for internal testing.
void SendLfgRoleCheckUpdate(ObjectGuid guid, LfgRoleCheck const &roleCheck)
GuidSet const & GetPlayers(ObjectGuid guid)
uint32 GetOptions()
Gets current lfg options.
LfgDungeonSet const & GetDungeonsByRandom(uint32 randomdungeon)
void LeaveLfg(ObjectGuid guid, bool disconnected=false)
Leaves lfg.
std::string const & GetComment(ObjectGuid gguid)
Get current player comment (used for LFR)
void UpdateBoot(ObjectGuid guid, bool accept)
Updates player boot proposal with new player answer.
void LoadRewards()
Loads rewards for random dungeons.
void SendLfgJoinResult(ObjectGuid guid, LfgJoinResultData const &data)
LfgCachedDungeonContainer CachedDungeonMapStore
Queues.
bool isOptionEnabled(uint32 option)
Checks if given lfg option is enabled.
void UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid=ObjectGuid::Empty, uint8 roles=PLAYER_ROLE_NONE)
Updates the role check with player answer.
void Clean()
Clears queue - Only for internal testing.
bool IsVoteKickActive(ObjectGuid gguid)
Get current vote kick state.
LfgRoleCheckContainer RoleChecksStore
void SetOptions(uint32 options)
Sets new lfg options.
uint32 m_lfgProposalId
used to check interval of update
uint8 RemovePlayerFromGroup(ObjectGuid gguid, ObjectGuid guid)
Removes a player from a group.
LFGDungeonData const * GetLFGDungeon(uint32 id)
uint32 GetDungeonMapId(ObjectGuid guid)
Get the map id of the current dungeon.
void RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdateType type)
void GetCompatibleDungeons(LfgDungeonSet &dungeons, GuidSet const &players, LfgLockPartyMap &lockMap, bool isContinue)
void RemovePlayerData(ObjectGuid guid)
void JoinLfg(Player *player, uint8 roles, LfgDungeonSet &dungeons, std::string const &comment)
Join Lfg with selected roles, dungeons and comment.
LfgRewardContainer RewardMapStore
Stores all dungeons by groupType.
void SetState(ObjectGuid guid, LfgState state)
void SendLfgRoleChosen(ObjectGuid guid, ObjectGuid pguid, uint8 roles)
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.
void SetLeader(ObjectGuid gguid, ObjectGuid leader)
Sets the leader of the group.
LfgGroupDataContainer GroupsStore
Player data.
void UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept)
Updates proposal to join dungeon with player answer.
LfgState GetState(ObjectGuid guid)
Get current lfg state.
LFGQueue & GetQueue(ObjectGuid guid)
bool IsLfgGroup(ObjectGuid guid)
Check if given group guid is lfg.
void SetRoles(ObjectGuid guid, uint8 roles)
Sets player lfg roles.
uint8 GetQueueId(ObjectGuid guid)
Returns queue id.
uint32 m_options
used as internal counter for proposals
void RemoveGroupData(ObjectGuid guid)
Removes saved group data.
void _SaveToDB(ObjectGuid guid, uint32 db_guid)
static bool CheckGroupRoles(LfgRolesMap &groles)
Checks if given roles match, modifies given roles map with new roles.
uint32 GetDungeon(ObjectGuid guid, bool asId=true)
Get current dungeon.
uint8 FilterClassRoles(Player *player, uint8 roles)
LfgPlayerDataContainer PlayersStore
Current player kicks.
LfgQueueContainer QueuesStore
Stores config options.
uint32 AddProposal(LfgProposal &proposal)
Add a new Proposal.
uint8 GetRoles(ObjectGuid guid)
Get current player roles.
void SetVoteKick(ObjectGuid gguid, bool active)
bool IsSeasonActive(uint32 dungeonId)
Checks if Seasonal dungeon is active.
bool AllQueued(GuidList const &check)
Checks if all players are queued.
LfgType GetDungeonType(uint32 dungeon)
void DecreaseKicksLeft(ObjectGuid guid)
void LoadLFGDungeons()
Loads dungeons from dbc and adds teleport coords.
LfgDungeonSet const & GetSelectedDungeons(ObjectGuid guid)
Get selected dungeons.
static bool HasIgnore(ObjectGuid guid1, ObjectGuid guid2)
Checks if given players are ignoring each other.
LfgLockMap const GetLockedDungeons(ObjectGuid guid)
Get locked dungeons.
static void SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const &data)
Sends queue status to player.
ObjectGuid GetGroup(ObjectGuid guid)
Gets player group.
void SetTeam(ObjectGuid guid, uint8 team)
Sets player team.
LfgReward const * GetRandomDungeonReward(uint32 dungeon, uint8 level)
Gets the random dungeon reward corresponding to given dungeon and player level.
void MakeNewGroup(LfgProposal const &proposal)
void SendLfgUpdateProposal(ObjectGuid guid, LfgProposal const &proposal)
LfgUpdateData GetLfgStatus(ObjectGuid guid)
Returns current lfg status.
LfgDungeonSet GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion)
Returns all random and seasonal dungeons for given level and expansion.
void SendLfgUpdateParty(ObjectGuid guid, LfgUpdateData const &data)
void SendLfgUpdatePlayer(ObjectGuid guid, LfgUpdateData const &data)
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const &dungeons, LfgRolesMap const &rolesMap)
time_t GetJoinTime(ObjectGuid guid) const
void AddToQueue(ObjectGuid guid, bool reAdd=false)
void UpdateWaitTimeAvg(int32 waitTime, uint32 dungeonId)
void RemoveFromQueue(ObjectGuid guid)
void UpdateWaitTimeHealer(int32 waitTime, uint32 dungeonId)
void UpdateWaitTimeTank(int32 waitTime, uint32 dungeonId)
void UpdateWaitTimeDps(int32 waitTime, uint32 dungeonId)
bool IsVoteKickActive() const
void SetVoteKick(bool active)
LfgState GetState() const
void SetState(LfgState state)
LfgState GetOldState() const
LfgState GetOldState() const
void SetState(LfgState state)
LfgState GetState() const
LfgDungeonSet const & GetSelectedDungeons() const
@ CONFIG_MAX_PLAYER_LEVEL
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const *ref, uint8 flags)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
@ LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION
@ LFG_LOCKSTATUS_TOO_LOW_LEVEL
@ LFG_LOCKSTATUS_RAID_LOCKED
@ LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE
@ LFG_LOCKSTATUS_MISSING_ITEM
@ LFG_LOCKSTATUS_TOO_HIGH_LEVEL
@ LFG_LOCKSTATUS_MISSING_ACHIEVEMENT
@ LFG_LOCKSTATUS_NOT_IN_SEASON
@ LFG_LOCKSTATUS_QUEST_NOT_COMPLETED
@ LFG_OPTION_ENABLE_DUNGEON_FINDER
@ LFG_OPTION_ENABLE_RAID_BROWSER
std::map< ObjectGuid, uint8 > LfgRolesMap
LfgTeleportError
Teleport errors.
@ LFG_TELEPORTERROR_INVALID_LOCATION
@ LFG_TELEPORTERROR_FATIGUE
@ LFG_TELEPORTERROR_PLAYER_DEAD
@ LFG_TELEPORTERROR_CHARMING
@ LFG_TELEPORTERROR_FALLING
@ LFG_TELEPORTERROR_IN_VEHICLE
@ LFG_STATE_FINISHED_DUNGEON
@ LFG_UPDATETYPE_ROLECHECK_FAILED
@ LFG_UPDATETYPE_GROUP_FOUND
@ LFG_UPDATETYPE_ADDED_TO_QUEUE
@ LFG_UPDATETYPE_UPDATE_STATUS
@ LFG_UPDATETYPE_PROPOSAL_FAILED
@ LFG_UPDATETYPE_PROPOSAL_DECLINED
@ LFG_UPDATETYPE_REMOVED_FROM_QUEUE
@ LFG_UPDATETYPE_PROPOSAL_BEGIN
@ LFG_UPDATETYPE_JOIN_QUEUE
@ LFG_SPELL_DUNGEON_COOLDOWN
@ LFG_GROUP_KICK_VOTES_NEEDED
@ LFG_QUEUEUPDATE_INTERVAL
@ LFG_SPELL_DUNGEON_DESERTER
LfgType
Determines the type of instance.
LfgAnswer
Answer state (Also used to check compatibilites)
std::string GetStateString(LfgState state)
std::map< uint32, uint32 > LfgLockMap
std::set< uint32 > LfgDungeonSet
@ LFG_ROLECHECK_WRONG_ROLES
@ LFG_ROLECHECK_MISSING_ROLE
@ LFG_ROLECHECK_INITIALITING
std::string ConcatenateDungeons(LfgDungeonSet const &dungeons)
std::pair< LfgRewardContainer::const_iterator, LfgRewardContainer::const_iterator > LfgRewardContainerBounds
std::map< ObjectGuid, LfgLockMap > LfgLockPartyMap
@ LFG_JOIN_TOO_MUCH_MEMBERS
@ LFG_JOIN_DUNGEON_INVALID
@ LFG_JOIN_USING_BG_SYSTEM
@ LFG_JOIN_MIXED_RAID_DUNGEON
@ LFG_JOIN_PARTY_NOT_MEET_REQS
@ LFG_JOIN_RANDOM_COOLDOWN
@ LFG_JOIN_PARTY_RANDOM_COOLDOWN
@ LFG_JOIN_PARTY_DESERTER
@ RBAC_PERM_JOIN_DUNGEON_FINDER
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
std::array< uint8, MAX_EXPANSIONS > maxlevel
std::array< uint8, MAX_EXPANSIONS > minlevel
Stores information of a current vote to kick someone from a group.
std::string reason
Player guid to be kicked (can't vote)
LfgAnswerContainer votes
Vote in progress.
bool inProgress
Time left to vote.
ObjectGuid victim
Player votes (-1 not answer | 0 Not agree | 1 agree)
Stores player data related to proposal to join.
LfgAnswer accept
Proposed role.
Stores group data related to proposal to join.
ObjectGuid leader
Proposal group (0 if new)
uint32 dungeonId
Proposal Id.
GuidList queues
Determines if it's new group or not.
LfgProposalPlayerContainer players
Show order in update window.
bool isNew
Dungeon Encounters.
LfgProposalState state
Dungeon to join.
ObjectGuid group
State of the proposal.
Stores all rolecheck info of a group that wants to join.
LfgDungeonSet dungeons
State of the rolecheck.
LfgRolesMap roles
Time when the rolecheck will fail.
LfgRoleCheckState state
Player selected roles.
ObjectGuid leader
Random Dungeon Id.
uint32 rDungeonId
Dungeons group is applying for (expanded random dungeons)