diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 37 | ||||
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.h | 2 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Handlers/LFGHandler.cpp | 44 |
3 files changed, 72 insertions, 11 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index d2b7b05398f..ba43c4b70bf 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -271,7 +271,6 @@ void LFGMgr::Join(Player *plr) uint64 guid = grp ? grp->GetGUID() : plr->GetGUID(); - LfgJoinResult result = LFG_JOIN_OK; // Previous checks before joining if (m_QueueInfoMap[guid]) @@ -700,6 +699,7 @@ void LFGMgr::UpdateRoleCheck(Group *grp, Player *plr /* = NULL*/) LfgRoleCheck *pRoleCheck = NULL; LfgRolesMap check_roles; LfgRoleCheckMap::iterator itRoleCheck = m_RoleChecks.find(rolecheckId); + LfgDungeonSet *dungeons = plr->GetLfgDungeons(); bool newRoleCheck = itRoleCheck == m_RoleChecks.end(); if (newRoleCheck) { @@ -715,8 +715,33 @@ void LFGMgr::UpdateRoleCheck(Group *grp, Player *plr /* = NULL*/) if (Player *plrg = itr->getSource()) pRoleCheck->roles[plrg->GetGUIDLow()] = 0; - for (LfgDungeonSet::const_iterator itDungeon = plr->GetLfgDungeons()->begin(); itDungeon != plr->GetLfgDungeons()->end(); ++itDungeon) - pRoleCheck->dungeons.insert(*itDungeon); + // Check if it's offer continue (random + current one) + if (grp->isLFGGroup() && dungeons->size() == 2) + { + LfgDungeonSet::const_iterator itDungeon = dungeons->begin(); + uint32 aDungeon = *itDungeon; + uint32 rDungeon = *(++itDungeon); + + // it's a Offer to continue (Actual dungeon + random dungeon in the list) + // Rolecheck will be using the actual dungeon - Players random + if (aDungeon == grp->GetLfgDungeonEntry() && isRandomDungeon(rDungeon)) + { + for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + { + if (Player *plrg = itr->getSource()) + { + plrg->GetLfgDungeons()->clear(); + plrg->GetLfgDungeons()->insert(rDungeon); + } + } + pRoleCheck->dungeons.insert(aDungeon); + } + + } + + if (pRoleCheck->dungeons.empty()) + for (LfgDungeonSet::const_iterator itDungeon = plr->GetLfgDungeons()->begin(); itDungeon != plr->GetLfgDungeons()->end(); ++itDungeon) + pRoleCheck->dungeons.insert(*itDungeon); } else pRoleCheck = itRoleCheck->second; @@ -1178,9 +1203,9 @@ void LFGMgr::SendUpdateProposal(Player *plr, uint32 proposalId, LfgProposal *pPr sLog.outDebug("SMSG_LFG_PROPOSAL_UPDATE"); WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + pProp->players.size() * (4 + 1 + 1 + 1 + 1 +1)); - if (plr->GetLfgDungeons()->size() == 1 && *plr->GetLfgDungeons()->begin() != pProp->dungeonId) - dungeonId = *plr->GetLfgDungeons()->begin(); // Random dungeon - if (LFGDungeonEntry const *dungeon = sLFGDungeonStore.LookupEntry(*plr->GetLfgDungeons()->begin())) + if (!dLowGuid && plr->GetLfgDungeons()->size() == 1) // New group - select the dungeon the player selected + dungeonId = *plr->GetLfgDungeons()->begin(); + if (LFGDungeonEntry const *dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) dungeonId = dungeon->Entry(); data << uint32(dungeonId); // Dungeon data << uint8(pProp->state); // Result state diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 84229166a79..683fc83414c 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -302,6 +302,7 @@ class LFGMgr void SendLfgPlayerInfo(Player *plr); void SendLfgPartyInfo(Player *plr); + bool isRandomDungeon(uint32 dungeonId); private: void SendUpdateProposal(Player *plr, uint32 proposalId, LfgProposal *pProp); @@ -314,7 +315,6 @@ class LFGMgr void AddToQueue(uint64 guid, LfgRolesMap *roles, LfgDungeonSet *dungeons); bool RemoveFromQueue(uint64 guid); - bool isRandomDungeon(uint32 dungeonId); void FindNewGroups(LfgGuidList &check, LfgGuidList all, LfgProposalList *proposals); bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true); void RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType type); diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 0e79e9a15ce..b2a91b010fc 100644 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -43,11 +43,47 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data) } GetPlayer()->SetLfgRoles(uint8(roles)); - for (int8 i = 0 ; i < numDungeons; ++i) + + // Check if it's offer continue + Group *grp = GetPlayer()->GetGroup(); + if (grp && grp->isLFGGroup()) + { + LfgDungeonSet *dungeons = GetPlayer()->GetLfgDungeons(); + if (grp->GetLfgStatus() == LFG_STATUS_COMPLETE) // Dungeon complete add all dungeons + { + dungeons->clear(); + for (int8 i = 0 ; i < numDungeons; ++i) + { + recv_data >> dungeon; + dungeons->insert((dungeon & 0x00FFFFFF)); + } + } + else if (dungeons->size() > 1 || dungeons->size() ==1 && !sLFGMgr.isRandomDungeon(*dungeons->begin())) + { + dungeons->clear(); + // ignore the list and select the current dungeon + for (int8 i = 0 ; i < numDungeons; ++i) + recv_data.read_skip<uint32>(); + dungeons->insert(grp->GetLfgDungeonEntry()); + } + else // currently added to random Dungeon + { + for (int8 i = 0 ; i < numDungeons; ++i) + { + recv_data >> dungeon; + // remove the type from the dungeon entry + GetPlayer()->GetLfgDungeons()->insert((dungeon & 0x00FFFFFF)); + } + } + } + else { - recv_data >> dungeon; - // remove the type from the dungeon entry - GetPlayer()->GetLfgDungeons()->insert((dungeon & 0x00FFFFFF)); + for (int8 i = 0 ; i < numDungeons; ++i) + { + recv_data >> dungeon; + // remove the type from the dungeon entry + GetPlayer()->GetLfgDungeons()->insert((dungeon & 0x00FFFFFF)); + } } recv_data >> numDungeons; // unk - always 3 |