aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-01-17 12:27:44 -0300
committerManuel <manue.l@live.com.ar>2011-01-17 12:27:44 -0300
commite05ab4b25aad3119c7f0b0a0ac569779a9fe22a6 (patch)
tree994d2c372bc12f82f9ede3640a0171df087b6354 /src
parentb28881f6485f4bc7052b552d46acdfa3bf3d713a (diff)
Core/Dungeon Finder: Fix exploit that allowed players to get random reward after finish a dungeon they did not queue for. Note: lfg_dungeon_encounters MUST contain the correct dungeonId, no the random ones.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 4153c8f0ccd..45bc4b92e4e 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -1794,10 +1794,10 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/)
/**
Give completion reward to player
- @param[in] dungeonId Dungeonid (Obsolete)
+ @param[in] dungeonId Id of the dungeon finished
@param[in] plr Player to reward
*/
-void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player)
+void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
{
Group* group = player->GetGroup();
if (!group || !group->isLFGGroup())
@@ -1808,6 +1808,12 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player)
uint64 guid = player->GetGUID();
uint64 gguid = player->GetGroup()->GetGUID();
+ uint32 gDungeonId = GetDungeon(gguid);
+ if (gDungeonId != dungeonId)
+ {
+ sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", guid, dungeonId, gDungeonId);
+ return;
+ }
if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON)
{