Exemplo n.º 1
0
LFGType LFGPlayerState::GetType()
{
    if (m_DungeonsList.empty())
        return LFG_TYPE_NONE;
    else
        return LFGType((*m_DungeonsList.begin())->type);
};
Exemplo n.º 2
0
LFGType LFGPlayerState::GetDungeonType()
{
    if (!GetDungeons() || GetDungeons()->empty())
        return LFG_TYPE_NONE;

    return LFGType((*GetDungeons()->begin())->type);
};
Exemplo n.º 3
0
void LFGStateStructure::RemoveDungeon(LFGDungeonEntry const* dungeon)
{
    LFGMgr::WriteGuard Guard(sLFGMgr.GetLock());
    m_DungeonsList.erase(dungeon);
    if (m_DungeonsList.empty())
        m_type = LFG_TYPE_NONE;
    else
    {
        if (LFGDungeonEntry const* entry = *m_DungeonsList.begin())
            m_type = LFGType(entry->type);
        else
            m_type = LFG_TYPE_NONE;
    }
};
Exemplo n.º 4
0
LFGQueueSet LFGMgr::GetDungeonGroupQueue(LFGDungeonEntry const* dungeon, Team team)
{
    LFGQueueSet tmpSet;
    tmpSet.clear();
    LFGType type = LFG_TYPE_NONE;
    uint32 dungeonID = 0;
    uint8 searchEnd = LFG_TYPE_MAX;
    if (dungeon)
    {
        type = LFGType(dungeon->type);
        dungeonID = dungeon->ID;
        searchEnd = type+1;
    }

    for (uint8 i = type; i < searchEnd; ++i)
    {
        for (LFGQueueInfoMap::iterator itr = m_groupQueueInfoMap[i].begin(); itr != m_groupQueueInfoMap[i].end(); ++itr)
        {
            ObjectGuid guid = itr->first;
            if (!guid.IsGroup())
                continue;

            Group* group = sObjectMgr.GetGroup(guid);
            if (!group)
                continue;

            Player* player = sObjectMgr.GetPlayer(group->GetLeaderGuid());
            if (!player)
                continue;

            if (team && player->GetTeam() != team)
                continue;

            if (player->GetLFGState()->GetState() < LFG_STATE_LFR ||
                player->GetLFGState()->GetState() > LFG_STATE_PROPOSAL)
                continue;

            if (player->GetLFGState()->GetDungeons()->find(dungeon) == player->GetLFGState()->GetDungeons()->end())
                continue;

            tmpSet.insert(group->GetObjectGuid());
        }
    }
    return tmpSet;
}
Exemplo n.º 5
0
LFGType LFGProposal::GetType()
{
    return (m_dungeon ? LFGType(m_dungeon->type) : LFG_TYPE_NONE);
};