Core/Dungeon Finder: Correct rolechecks (4e8fa52)

- Fix bad sql (36806bf)
- Add better teleport debug messages
This commit is contained in:
Spp
2012-10-23 09:48:08 +02:00
parent 316fc7c631
commit c1fada456b
3 changed files with 64 additions and 60 deletions
@@ -1,17 +0,0 @@
DELETE FROM `trinity_string` WHERE `entry` IN (9986, 9987, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999);
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`)
VALUES
(9986, 'Error', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9987, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9988, 'Leader', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9989, 'Dps', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9990, 'Healer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9991, 'Tank', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9992, 'Raid browser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9993, 'Finished dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9994, 'In dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9995, 'Vote kick', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9996, 'Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9997, 'Queued', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9998, 'Role check', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9999, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -0,0 +1,17 @@
DELETE FROM `trinity_string` WHERE `entry` IN (9986, 9987, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999);
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`)
VALUES
(9999, 'Error', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9998, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9997, 'Leader', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9996, 'Dps', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9995, 'Healer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9994, 'Tank', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9993, 'Raid browser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9992, 'Finished dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9991, 'In dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9990, 'Vote kick', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9989, 'Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9988, 'Queued', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9987, 'Role check', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9986, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+14 -10
View File
@@ -889,11 +889,13 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
SetState(gguid, LFG_STATE_QUEUED); SetState(gguid, LFG_STATE_QUEUED);
LfgQueue& queue = GetQueue(gguid); LfgQueue& queue = GetQueue(gguid);
queue.AddQueueData(gguid, time_t(time(NULL)), roleCheck.dungeons, roleCheck.roles); queue.AddQueueData(gguid, time_t(time(NULL)), roleCheck.dungeons, roleCheck.roles);
m_RoleChecks.erase(itRoleCheck);
} }
else if (roleCheck.state != LFG_ROLECHECK_INITIALITING) else if (roleCheck.state != LFG_ROLECHECK_INITIALITING)
{
RestoreState(gguid, "Rolecheck Failed"); RestoreState(gguid, "Rolecheck Failed");
m_RoleChecks.erase(itRoleCheck); m_RoleChecks.erase(itRoleCheck);
}
} }
/** /**
@@ -1386,18 +1388,22 @@ void LFGMgr::UpdateBoot(uint64 guid, bool accept)
*/ */
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/) void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
{ {
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in");
Group* grp = player->GetGroup(); Group* grp = player->GetGroup();
uint64 gguid = grp->GetGUID(); uint64 gguid = grp->GetGUID();
LFGDungeonData const* dungeon = GetLFGDungeon(GetDungeon(gguid)); LFGDungeonData const* dungeon = GetLFGDungeon(GetDungeon(gguid));
if (!dungeon || (out && player->GetMapId() != uint32(dungeon->map))) if (!dungeon)
return; return;
if (out) if (out)
{
sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported out. Current Map %u - Expected Map %u",
player->GetName(), player->GetMapId(), uint32(dungeon->map));
if (player->GetMapId() == uint32(dungeon->map))
{ {
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
player->TeleportToBGEntryPoint(); player->TeleportToBGEntryPoint();
}
return; return;
} }
@@ -1415,10 +1421,6 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
error = LFG_TELEPORTERROR_IN_VEHICLE; error = LFG_TELEPORTERROR_IN_VEHICLE;
else if (player->GetCharmGUID()) else if (player->GetCharmGUID())
error = LFG_TELEPORTERROR_CHARMING; error = LFG_TELEPORTERROR_CHARMING;
else
{
if (!dungeon)
error = LFG_TELEPORTERROR_INVALID_LOCATION;
else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
{ {
uint32 mapid = dungeon->map; uint32 mapid = dungeon->map;
@@ -1458,14 +1460,16 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (!player->TeleportTo(mapid, x, y, z, orientation)) if (!player->TeleportTo(mapid, x, y, z, orientation))
{ {
error = LFG_TELEPORTERROR_INVALID_LOCATION; error = LFG_TELEPORTERROR_INVALID_LOCATION;
sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid); sLog->outError(LOG_FILTER_LFG, "TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u (x: %f, y: %f, z: %f)", player->GetGUID(), mapid, x, y, z);
}
} }
} }
} }
if (error != LFG_TELEPORTERROR_OK) if (error != LFG_TELEPORTERROR_OK)
player->GetSession()->SendLfgTeleportError(uint8(error)); player->GetSession()->SendLfgTeleportError(uint8(error));
sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported in. Result: %u",
player->GetName(), error);
} }
/** /**