diff options
| author | Spp <spp@jorge.gr> | 2012-10-23 11:44:02 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2012-10-23 11:44:02 +0200 |
| commit | 1be638e7310bdd362566a6dc463bf94950d50616 (patch) | |
| tree | 1c5b75c36ce4f0c0f86fd97f4aa2150896a42aa0 /src/server/game/DungeonFinding/LFGMgr.cpp | |
| parent | c1fada456bab098e78d705cc339e062264f00070 (diff) | |
Core/Dungeon Finder: Add debugging commands
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
| -rwxr-xr-x | src/server/game/DungeonFinding/LFGMgr.cpp | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e523c7f1c38..0a2a4b861b8 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -31,14 +31,11 @@ #include "GroupMgr.h" #include "GameEventMgr.h" -LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1) +LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1), + m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK)) { - m_options = sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE); - if (m_options) - { - new LFGPlayerScript(); - new LFGGroupScript(); - } + new LFGPlayerScript(); + new LFGGroupScript(); } LFGMgr::~LFGMgr() @@ -353,7 +350,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) void LFGMgr::Update(uint32 diff) { - if (!m_options) + if (!isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER)) return; time_t currTime = time(NULL); @@ -1892,6 +1889,27 @@ bool LFGMgr::AllQueued(const LfgGuidList& check) return true; } +// Only for debugging purposes +void LFGMgr::Clean() +{ + m_Queues.clear(); +} + +bool LFGMgr::isOptionEnabled(uint32 option) +{ + return m_options & option; +} + +uint32 LFGMgr::GetOptions() +{ + return m_options; +} + +void LFGMgr::SetOptions(uint32 options) +{ + m_options = options; +} + bool LFGMgr::IsSeasonActive(uint32 dungeonId) { switch (dungeonId) @@ -1907,3 +1925,25 @@ bool LFGMgr::IsSeasonActive(uint32 dungeonId) } return false; } + +std::string LFGMgr::DumpQueueInfo(bool /*full*/) +{ + uint32 size = uint32(m_Queues.size()); + std::ostringstream o; + + o << "Number of Queues: " << size << "\n"; + for (LfgQueueMap::const_iterator itr = m_Queues.begin(); itr != m_Queues.end(); ++itr) + { + std::string const& queued = itr->second.DumpQueueInfo(); + std::string const& compatibles = itr->second.DumpCompatibleInfo(); + o << queued << compatibles; + /* + if (full) + { + LfgCompatibleMap const& compatibles = itr->second.GetCompatibleMap(); + } + */ + } + + return o.str(); +} |
