aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Pools/PoolMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Pools/PoolMgr.cpp')
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index d79f7fc591e..35a5fa9230c 100755
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -220,7 +220,7 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
{
sObjectMgr->RemoveCreatureFromGrid(guid, data);
- if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
+ if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
pCreature->AddObjectToRemoveList();
}
}
@@ -233,7 +233,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
{
sObjectMgr->RemoveGameobjectFromGrid(guid, data);
- if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
+ if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
pGameobject->AddObjectToRemoveList();
}
}
@@ -364,7 +364,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
Creature* pCreature = new Creature;
- //sLog.outDebug("Spawning creature %u",guid);
+ //sLog->outDebug("Spawning creature %u",guid);
if (!pCreature->LoadFromDB(obj->guid, map))
{
delete pCreature;
@@ -390,7 +390,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
GameObject* pGameobject = new GameObject;
- //sLog.outDebug("Spawning gameobject %u", guid);
+ //sLog->outDebug("Spawning gameobject %u", guid);
if (!pGameobject->LoadFromDB(obj->guid, map))
{
delete pGameobject;
@@ -421,7 +421,7 @@ void PoolGroup<Quest>::Spawn1Object(PoolObject* obj)
PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid);
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
{
- sLog.outDebug("PoolGroup<Quest>: Adding quest %u to creature %u", itr->first, itr->second);
+ sLog->outDebug("PoolGroup<Quest>: Adding quest %u to creature %u", itr->first, itr->second);
questMap->insert(QuestRelations::value_type(itr->second, itr->first));
}
@@ -430,7 +430,7 @@ void PoolGroup<Quest>::Spawn1Object(PoolObject* obj)
qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid);
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
{
- sLog.outDebug("PoolGroup<Quest>: Adding quest %u to GO %u", itr->first, itr->second);
+ sLog->outDebug("PoolGroup<Quest>: Adding quest %u to GO %u", itr->first, itr->second);
questMap->insert(QuestRelations::value_type(itr->second, itr->first));
}
}
@@ -438,7 +438,7 @@ void PoolGroup<Quest>::Spawn1Object(PoolObject* obj)
template <>
void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom)
{
- sLog.outDebug("PoolGroup<Quest>: Spawning pool %u", poolId);
+ sLog->outDebug("PoolGroup<Quest>: Spawning pool %u", poolId);
// load state from db
if (!triggerFrom)
{
@@ -508,7 +508,7 @@ template <>
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
{
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
- if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
+ if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
pCreature->GetMap()->Add(pCreature);
}
@@ -517,7 +517,7 @@ template <>
void PoolGroup<GameObject>::ReSpawn1Object(PoolObject* obj)
{
if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid))
- if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
+ if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
pGameobject->GetMap()->Add(pGameobject);
}
@@ -547,8 +547,8 @@ void PoolMgr::LoadFromDB()
QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template");
if (!result)
{
- sLog.outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
- sLog.outString();
+ sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
+ sLog->outString();
return;
}
else
@@ -563,8 +563,8 @@ void PoolMgr::LoadFromDB()
if (!result)
{
mPoolTemplate.clear();
- sLog.outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
- sLog.outString();
+ sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
+ sLog->outString();
return;
}
@@ -583,12 +583,12 @@ void PoolMgr::LoadFromDB()
} while (result->NextRow());
- sLog.outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog.outString();
+ sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
// Creatures
- sLog.outString("Loading Creatures Pooling Data...");
+ sLog->outString("Loading Creatures Pooling Data...");
oldMSTime = getMSTime();
mPoolCreatureGroups.resize(max_pool_id + 1);
@@ -599,8 +599,8 @@ void PoolMgr::LoadFromDB()
count = 0;
if (!result)
{
- sLog.outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
- sLog.outString();
+ sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
+ sLog->outString();
}
else
{
@@ -617,17 +617,17 @@ void PoolMgr::LoadFromDB()
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
if (!data)
{
- sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog.outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
+ sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog.outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
@@ -643,13 +643,13 @@ void PoolMgr::LoadFromDB()
} while (result->NextRow());
- sLog.outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog.outString();
+ sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
}
// Gameobjects
- sLog.outString("Loading Gameobject Pooling Data...");
+ sLog->outString("Loading Gameobject Pooling Data...");
mPoolGameobjectGroups.resize(max_pool_id + 1);
mGameobjectSearchMap.clear();
@@ -659,8 +659,8 @@ void PoolMgr::LoadFromDB()
count = 0;
if (!result)
{
- sLog.outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
- sLog.outString();
+ sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
+ sLog->outString();
}
else
{
@@ -677,7 +677,7 @@ void PoolMgr::LoadFromDB()
GameObjectData const* data = sObjectMgr->GetGOData(guid);
if (!data)
{
- sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id);
@@ -685,17 +685,17 @@ void PoolMgr::LoadFromDB()
goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
{
- sLog.outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
+ sLog->outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog.outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
+ sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog.outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
@@ -711,13 +711,13 @@ void PoolMgr::LoadFromDB()
} while (result->NextRow());
- sLog.outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog.outString();
+ sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
}
// Pool of pools
- sLog.outString("Loading Mother Pooling Data...");
+ sLog->outString("Loading Mother Pooling Data...");
oldMSTime = getMSTime();
mPoolPoolGroups.resize(max_pool_id + 1);
@@ -727,8 +727,8 @@ void PoolMgr::LoadFromDB()
count = 0;
if (!result)
{
- sLog.outString(">> Loaded 0 pools in pools");
- sLog.outString();
+ sLog->outString(">> Loaded 0 pools in pools");
+ sLog->outString();
}
else
{
@@ -744,22 +744,22 @@ void PoolMgr::LoadFromDB()
if (mother_pool_id > max_pool_id)
{
- sLog.outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id);
+ sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id);
continue;
}
if (child_pool_id > max_pool_id)
{
- sLog.outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id);
+ sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id);
continue;
}
if (mother_pool_id == child_pool_id)
{
- sLog.outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.",child_pool_id);
+ sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.",child_pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog.outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
+ sLog->outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
continue;
}
PoolTemplateData *pPoolTemplateMother = &mPoolTemplate[mother_pool_id];
@@ -790,7 +790,7 @@ void PoolMgr::LoadFromDB()
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
- sLog.outErrorDb("%s", ss.str().c_str());
+ sLog->outErrorDb("%s", ss.str().c_str());
mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
mPoolSearchMap.erase(poolItr);
--count;
@@ -799,8 +799,8 @@ void PoolMgr::LoadFromDB()
}
}
- sLog.outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog.outString();
+ sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
}
}
@@ -817,8 +817,8 @@ void PoolMgr::LoadQuestPools()
uint32 count = 0;
if (!result)
{
- sLog.outString(">> Loaded 0 quests in pools");
- sLog.outString();
+ sLog->outString(">> Loaded 0 quests in pools");
+ sLog->outString();
return;
}
@@ -845,19 +845,19 @@ void PoolMgr::LoadQuestPools()
Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
if (!pQuest)
{
- sLog.outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
+ sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog.outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
+ sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
continue;
}
if (!pQuest->IsDailyOrWeekly())
{
- sLog.outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
+ sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
continue;
}
@@ -868,7 +868,7 @@ void PoolMgr::LoadQuestPools()
if (poolTypeMap[pool_id] != currType)
{
- sLog.outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.", entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY");
+ sLog->outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.", entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY");
continue;
}
@@ -877,7 +877,7 @@ void PoolMgr::LoadQuestPools()
if (creBounds.first == creBounds.second && goBounds.first == goBounds.second)
{
- sLog.outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
+ sLog->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
continue;
}
@@ -895,8 +895,8 @@ void PoolMgr::LoadQuestPools()
}
while (result->NextRow());
- sLog.outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog.outString();
+ sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
}
// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
@@ -917,9 +917,9 @@ void PoolMgr::Initialize()
if (pool_pool_id)
// The pool is a child pool in pool_pool table. Ideally we should remove it from the pool handler to ensure it never gets spawned,
// however that could recursively invalidate entire chain of mother pools. It can be done in the future but for now we'll do nothing.
- sLog.outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
+ sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
else
- sLog.outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
+ sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
continue;
}
@@ -932,7 +932,7 @@ void PoolMgr::Initialize()
} while (result->NextRow());
}
- sLog.outBasic("Pool handling system initialized, %u pools spawned.", count);
+ sLog->outBasic("Pool handling system initialized, %u pools spawned.", count);
}
void PoolMgr::SaveQuestsToDB()