Core/Dungeon Finder: Fix incorrect Lfg state after multiple actions.
- Clear state after get out DF system - Fix player not getting reward after finish a random dungeon - Remove OnDisband Hook, it's already handled by OnRemoveMember --HG-- branch : trunk
This commit is contained in:
@@ -278,8 +278,12 @@ void LFGMgr::Update(uint32 diff)
|
|||||||
lowGuid = itPlayers->first;
|
lowGuid = itPlayers->first;
|
||||||
if (Player* plr = sObjectMgr.GetPlayerByLowGUID(itPlayers->first))
|
if (Player* plr = sObjectMgr.GetPlayerByLowGUID(itPlayers->first))
|
||||||
{
|
{
|
||||||
|
plr->SetLfgState(LFG_STATE_PROPOSAL);
|
||||||
if (plr->GetGroup())
|
if (plr->GetGroup())
|
||||||
|
{
|
||||||
|
plr->GetGroup()->SetLfgState(LFG_STATE_PROPOSAL);
|
||||||
plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_PROPOSAL_BEGIN, plr->GetLfgDungeons(), plr->GetLfgComment());
|
plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_PROPOSAL_BEGIN, plr->GetLfgDungeons(), plr->GetLfgComment());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
plr->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_PROPOSAL_BEGIN, plr->GetLfgDungeons(), plr->GetLfgComment());
|
plr->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_PROPOSAL_BEGIN, plr->GetLfgDungeons(), plr->GetLfgComment());
|
||||||
plr->GetSession()->SendLfgUpdateProposal(m_lfgProposalId, pProposal);
|
plr->GetSession()->SendLfgUpdateProposal(m_lfgProposalId, pProposal);
|
||||||
@@ -585,6 +589,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, LfgDungeonSet& dungeons, std::string
|
|||||||
dungeons.insert(rDungeonId);
|
dungeons.insert(rDungeonId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grp->SetLfgState(LFG_STATE_ROLECHECK);
|
||||||
// Send update to player
|
// Send update to player
|
||||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
{
|
{
|
||||||
@@ -1055,7 +1060,7 @@ void LFGMgr::UpdateRoleCheck(Group* grp, Player* plr /* = NULL*/, bool newRoleCh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pRoleCheck->result == LFG_ROLECHECK_FINISHED && pRoleCheck->dungeons.size())
|
if (pRoleCheck->result == LFG_ROLECHECK_FINISHED)
|
||||||
{
|
{
|
||||||
grp->SetLfgState(LFG_STATE_QUEUED);
|
grp->SetLfgState(LFG_STATE_QUEUED);
|
||||||
LfgQueueInfo* pqInfo = new LfgQueueInfo();
|
LfgQueueInfo* pqInfo = new LfgQueueInfo();
|
||||||
@@ -1375,6 +1380,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint32 lowGuid, bool accept)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
grp->SetLfgRoles(plr->GetGUID(), pProposal->players[plr->GetGUIDLow()]->role);
|
grp->SetLfgRoles(plr->GetGUID(), pProposal->players[plr->GetGUIDLow()]->role);
|
||||||
|
plr->SetLfgState(LFG_STATE_DUNGEON);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the dungeon difficulty
|
// Set the dungeon difficulty
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method,
|
|||||||
// Update internal kick cooldown of kicked
|
// Update internal kick cooldown of kicked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
plr->ClearLfgState();
|
||||||
plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
|
plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
|
||||||
if (plr->GetMap()->IsDungeon()) // Teleport player out the dungeon
|
if (plr->GetMap()->IsDungeon()) // Teleport player out the dungeon
|
||||||
sLFGMgr.TeleportPlayer(plr, true);
|
sLFGMgr.TeleportPlayer(plr, true);
|
||||||
@@ -100,24 +101,6 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method,
|
|||||||
|
|
||||||
void LFGScripts::OnDisband(Group* group)
|
void LFGScripts::OnDisband(Group* group)
|
||||||
{
|
{
|
||||||
uint64 gguid = group->GetGUID();
|
|
||||||
if (!gguid)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sLog.outDebug("LFGScripts::OnDisband [" UI64FMTD "]", gguid);
|
|
||||||
if (group->GetLfgState() == LFG_STATE_QUEUED)
|
|
||||||
sLFGMgr.Leave(NULL, group);
|
|
||||||
|
|
||||||
for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
|
||||||
{
|
|
||||||
if (Player *plrg = itr->getSource())
|
|
||||||
{
|
|
||||||
plrg->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_GROUP_DISBAND);
|
|
||||||
plrg->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
|
|
||||||
if (plrg->GetMap()->IsDungeon()) // Teleport player out the dungeon
|
|
||||||
sLFGMgr.TeleportPlayer(plrg, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid)
|
void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid)
|
||||||
|
|||||||
Reference in New Issue
Block a user