aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpp <none@none>2010-11-22 12:28:06 +0100
committerSpp <none@none>2010-11-22 12:28:06 +0100
commita7d262ce03e7e11c7799250eb6bbb62ea4f348aa (patch)
treeadfa5176f2846b05f563bddcd9c4da2a5becb1b0
parenta2ef7e18a18945588308c1cbfcb91e6aa7513dec (diff)
Core/Dungeon Finder: Do not allow to join if selected dungeons and raids
--HG-- branch : trunk
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp35
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.h3
2 files changed, 28 insertions, 10 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index efebdff7165..efb217ad803 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -570,14 +570,32 @@ void LFGMgr::Join(Player* plr)
if (!dungeons || !dungeons->size())
result = LFG_JOIN_NOT_MEET_REQS;
else // Check if all dungeons are valid
+ {
+ bool isDungeon = false;
+ bool isRaid = false;
+ LfgType type = LFG_TYPE_NONE;
for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it)
{
- if (!GetDungeonGroupType(*it))
+ type = GetDungeonType(*it);
+ switch(type)
{
- result = LFG_JOIN_DUNGEON_INVALID;
- break;
+ case LFG_TYPE_DUNGEON:
+ case LFG_TYPE_HEROIC:
+ if (isRaid)
+ result = LFG_JOIN_MIXED_RAID_DUNGEON;
+ isDungeon = true;
+ break;
+ case LFG_TYPE_RAID:
+ if (isDungeon)
+ result = LFG_JOIN_MIXED_RAID_DUNGEON;
+ isRaid = true;
+ break;
+ default:
+ result = LFG_JOIN_DUNGEON_INVALID;
+ break;
}
}
+ }
}
// Group checks
@@ -614,7 +632,6 @@ void LFGMgr::Join(Player* plr)
if (grp && !grp->isLFGGroup())
plr->SetLfgState(LFG_STATE_NONE);
plr->GetSession()->SendLfgJoinResult(result);
- plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_ROLECHECK_FAILED);
return;
}
@@ -2174,17 +2191,17 @@ LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level)
}
/// <summary>
-/// Given a Dungeon id returns the dungeon Group Type
+/// Given a Dungeon id returns the dungeon Type
/// </summary>
/// <param name="uint32">Dungeon id</param>
-/// <returns>uint8: GroupType</returns>
-uint8 LFGMgr::GetDungeonGroupType(uint32 dungeonId)
+/// <returns>uint8: Type</returns>
+LfgType LFGMgr::GetDungeonType(uint32 dungeonId)
{
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId);
if (!dungeon)
- return 0;
+ return LFG_TYPE_NONE;
- return dungeon->grouptype;
+ return LfgType(dungeon->type);
}
/// <summary>
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 7b23d78fe5a..0be43bc8e8b 100755
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -42,6 +42,7 @@ enum LFGenum
enum LfgType
{
+ LFG_TYPE_NONE = 0, // Internal use only
LFG_TYPE_DUNGEON = 1,
LFG_TYPE_RAID = 2,
LFG_TYPE_QUEST = 3,
@@ -294,7 +295,7 @@ class LFGMgr
LfgLockStatusMap* GetGroupLockStatusDungeons(PlayerSet* pPlayers, LfgDungeonSet* dungeons, bool useEntry = true);
LfgDungeonSet* GetDungeonsByRandom(uint32 randomdungeon);
LfgDungeonSet* GetAllDungeons();
- uint8 GetDungeonGroupType(uint32 dungeon);
+ LfgType GetDungeonType(uint32 dungeon);
LfgRewardMap m_RewardMap; // Stores rewards for random dungeons
std::map<uint32, uint32> m_EncountersByAchievement; // Stores dungeon ids associated with achievements (for rewards)