Skip to content

Commit

Permalink
Core/LFG Fixed several bugs/ missing Features:
Browse files Browse the repository at this point in the history
 - Added Dungeon Deserteur and Cooldown Debuff
 - Allow LFG groups with ID to rejoin queue (unfinished dungeon)
 - Every LFG-Party Member is able to rejoin LFG queue (blizzlike)
 - Similar to BG-Groups Lfg-Groups will only disband if there is no player left
 - In-Dungeon Lfg-Groups always join queues with high priority
  • Loading branch information
wahaxlekuke committed Nov 19, 2011
1 parent 00400c1 commit 1db645a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
11 changes: 10 additions & 1 deletion src/server/game/DungeonFinding/LFGMgr.cpp
Expand Up @@ -383,7 +383,10 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player))
locktype = LFG_LOCKSTATUS_RAID_LOCKED;
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
locktype = LFG_LOCKSTATUS_RAID_LOCKED;
{
if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(),true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON)
locktype = LFG_LOCKSTATUS_RAID_LOCKED;
}
else if (dungeon->minlevel > level)
locktype = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
else if (dungeon->maxlevel < level)
Expand Down Expand Up @@ -1080,6 +1083,11 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
}

m_QueueInfoMap[gguid] = pqInfo;
if(GetState(gguid) != LFG_STATE_NONE)
{
LfgGuidList& currentQueue = m_currentQueue[team];
currentQueue.push_front(gguid);

This comment has been minimized.

Copy link
@wahaxlekuke

wahaxlekuke Nov 19, 2011

Author Owner

Dependence: fb957df

}
AddToQueue(gguid, team);
}

Expand Down Expand Up @@ -1825,6 +1833,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)

// Give rewards
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not");
player->CastSpell(player,LFG_SPELL_DUNGEON_COOLDOWN,true);
player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward);
}

Expand Down
8 changes: 4 additions & 4 deletions src/server/game/DungeonFinding/LFGScripts.cpp
Expand Up @@ -84,10 +84,10 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method,
sLFGMgr->ClearState(guid);
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
/*
if (method == GROUP_REMOVEMETHOD_LEAVE)
// Add deserter flag
else if (group->isLfgKickActive())

if (method == GROUP_REMOVEMETHOD_LEAVE && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)
player->CastSpell(player,LFG_SPELL_DUNGEON_DESERTER,true);// Add deserter flag
/*else if (group->isLfgKickActive())
// Update internal kick cooldown of kicked
*/

Expand Down
4 changes: 4 additions & 0 deletions src/server/game/Entities/Player/Player.cpp
Expand Up @@ -2326,6 +2326,10 @@ bool Player::TeleportToBGEntryPoint()
if (m_bgData.joinPos.m_mapId == MAPID_INVALID)
return false;

Group* grp = this->GetGroup();
if (grp && grp->isLFGGroup() && grp->GetMembersCount() == 1)
grp->Disband();

ScheduleDelayedOperation(DELAYED_BG_MOUNT_RESTORE);
ScheduleDelayedOperation(DELAYED_BG_TAXI_RESTORE);
ScheduleDelayedOperation(DELAYED_BG_GROUP_RESTORE);
Expand Down
8 changes: 7 additions & 1 deletion src/server/game/Groups/Group.cpp
Expand Up @@ -397,7 +397,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
return m_memberSlots.size();

// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group)
if (GetMembersCount() > (isBGGroup() ? 1u : 2u))
if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u))
{
Player* player = ObjectAccessor::FindPlayer(guid);
if (player)
Expand Down Expand Up @@ -487,6 +487,12 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV

SendUpdate();

if (isLFGGroup() && GetMembersCount() == 1 && !GetFirstMember()->getSource()->GetMap()->IsDungeon())
{
Disband();
return false;
}

return true;
}
// If group size before player removal <= 2 then disband it
Expand Down
3 changes: 2 additions & 1 deletion src/server/game/Server/Protocol/Handlers/LFGHandler.cpp
Expand Up @@ -48,7 +48,8 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa
void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data)
{
if (!sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) ||
(GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID()))
(GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() &&
(GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup())))
{
recv_data.rfinish();
return;
Expand Down

3 comments on commit 1db645a

@2010phenix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 man

@Vasago
Copy link

@Vasago Vasago commented on 1db645a Nov 22, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wahaxlekuke
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.