AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
PoolMgr Class Reference

#include "PoolMgr.h"

Public Member Functions

void LoadFromDB ()
 
void LoadQuestPools ()
 
void SaveQuestsToDB (bool daily, bool weekly, bool other)
 
void Initialize ()
 
template<typename T >
uint32 IsPartOfAPool (uint32 db_guid_or_pool_id) const
 
template<typename T >
bool IsSpawnedObject (uint32 quest_id) const
 
bool IsEmpty (uint32 pool_id) const
 
bool CheckPool (uint32 pool_id) const
 
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id)
 
void DespawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id)
 
template<typename T >
void UpdatePool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid_or_pool_id)
 
void SpawnEventPool (uint32 pool_id)
 
void DespawnEventPool (uint32 pool_id)
 
std::unique_ptr< SpawnedPoolDataInitPoolsForMap (Map *map)
 
void ChangeDailyQuests ()
 
void ChangeWeeklyQuests ()
 
void ReSpawnPoolQuests ()
 
PoolTemplateData const * GetPoolTemplate (uint32 poolId) const
 
PoolGroup< Creature > const * GetPoolCreatureGroup (uint32 poolId) const
 
PoolGroup< GameObject > const * GetPoolGameObjectGroup (uint32 poolId) const
 
PoolGroup< Pool > const * GetPoolPoolGroup (uint32 poolId) const
 
SpawnedPoolData const & GetQuestSpawnedData () const
 
uint32 GetCreaturePoolId (uint32 guid) const
 
uint32 GetGameObjectPoolId (uint32 guid) const
 
template<>
uint32 IsPartOfAPool (uint32 db_guid) const
 
template<>
uint32 IsPartOfAPool (uint32 db_guid) const
 
template<>
uint32 IsPartOfAPool (uint32 questId) const
 
template<>
uint32 IsPartOfAPool (uint32 pool_id) const
 

Static Public Member Functions

static PoolMgrinstance ()
 

Public Attributes

PooledQuestRelation mQuestCreatureRelation
 
PooledQuestRelation mQuestGORelation
 

Private Types

typedef std::unordered_map< uint32, PoolTemplateDataPoolTemplateDataMap
 
typedef std::unordered_map< uint32, PoolGroup< Creature > > PoolGroupCreatureMap
 
typedef std::unordered_map< uint32, PoolGroup< GameObject > > PoolGroupGameObjectMap
 
typedef std::unordered_map< uint32, PoolGroup< Pool > > PoolGroupPoolMap
 
typedef std::unordered_map< uint32, PoolGroup< Quest > > PoolGroupQuestMap
 
typedef std::pair< uint32, uint32SearchPair
 
typedef std::map< uint32, uint32SearchMap
 

Private Member Functions

 PoolMgr ()
 
 ~PoolMgr ()
 
template<typename T >
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid_or_pool_id)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 sub_pool_id)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 quest_id)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 sub_pool_id)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 db_guid)
 
template<>
void SpawnPool (SpawnedPoolData &spawnedPoolData, uint32 pool_id, uint32 quest_id)
 

Private Attributes

PoolTemplateDataMap mPoolTemplate
 
PoolGroupCreatureMap mPoolCreatureGroups
 
PoolGroupGameObjectMap mPoolGameobjectGroups
 
PoolGroupPoolMap mPoolPoolGroups
 
PoolGroupQuestMap mPoolQuestGroups
 
SearchMap mCreatureSearchMap
 
SearchMap mGameobjectSearchMap
 
SearchMap mPoolSearchMap
 
SearchMap mQuestSearchMap
 
std::unordered_map< uint32, std::vector< uint32 > > mAutoSpawnPoolsPerMap
 
std::unordered_set< uint32mActiveEventPools
 
SpawnedPoolData mQuestSpawnedData
 

Friends

class PoolQuestReloadFixTest
 

Detailed Description

Member Typedef Documentation

◆ PoolGroupCreatureMap

typedef std::unordered_map<uint32, PoolGroup<Creature> > PoolMgr::PoolGroupCreatureMap
private

◆ PoolGroupGameObjectMap

typedef std::unordered_map<uint32, PoolGroup<GameObject> > PoolMgr::PoolGroupGameObjectMap
private

◆ PoolGroupPoolMap

typedef std::unordered_map<uint32, PoolGroup<Pool> > PoolMgr::PoolGroupPoolMap
private

◆ PoolGroupQuestMap

typedef std::unordered_map<uint32, PoolGroup<Quest> > PoolMgr::PoolGroupQuestMap
private

◆ PoolTemplateDataMap

typedef std::unordered_map<uint32, PoolTemplateData> PoolMgr::PoolTemplateDataMap
private

◆ SearchMap

typedef std::map<uint32, uint32> PoolMgr::SearchMap
private

◆ SearchPair

typedef std::pair<uint32, uint32> PoolMgr::SearchPair
private

Constructor & Destructor Documentation

◆ PoolMgr()

PoolMgr::PoolMgr ( )
private
569 : mQuestSpawnedData(nullptr)
570{
571}
SpawnedPoolData mQuestSpawnedData
Definition PoolMgr.h:213

◆ ~PoolMgr()

PoolMgr::~PoolMgr ( )
inlineprivate
128{};

Member Function Documentation

◆ ChangeDailyQuests()

void PoolMgr::ChangeDailyQuests ( )
1083{
1084 for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
1085 {
1086 if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId()))
1087 {
1088 if (quest->IsWeekly())
1089 continue;
1090
1091 UpdatePool<Quest>(mQuestSpawnedData, itr->second.GetPoolId(), 1); // anything non-zero means don't load from db
1092 }
1093 }
1094
1095 SaveQuestsToDB(true, false, false);
1096}
#define sObjectMgr
Definition ObjectMgr.h:1730
void SaveQuestsToDB(bool daily, bool weekly, bool other)
Definition PoolMgr.cpp:1044
PoolGroupQuestMap mPoolQuestGroups
Definition PoolMgr.h:201
Definition QuestDef.h:210

References mPoolQuestGroups, mQuestSpawnedData, SaveQuestsToDB(), and sObjectMgr.

◆ ChangeWeeklyQuests()

void PoolMgr::ChangeWeeklyQuests ( )
1099{
1100 for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
1101 {
1102 if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId()))
1103 {
1104 if (quest->IsDaily())
1105 continue;
1106
1107 UpdatePool<Quest>(mQuestSpawnedData, itr->second.GetPoolId(), 1);
1108 }
1109 }
1110
1111 SaveQuestsToDB(false, true, false);
1112}

References mPoolQuestGroups, mQuestSpawnedData, SaveQuestsToDB(), and sObjectMgr.

◆ CheckPool()

bool PoolMgr::CheckPool ( uint32  pool_id) const
1221{
1222 {
1223 auto it = mPoolGameobjectGroups.find(pool_id);
1224 if (it != mPoolGameobjectGroups.end() && !it->second.CheckPool())
1225 return false;
1226 }
1227 {
1228 auto it = mPoolCreatureGroups.find(pool_id);
1229 if (it != mPoolCreatureGroups.end() && !it->second.CheckPool())
1230 return false;
1231 }
1232 {
1233 auto it = mPoolPoolGroups.find(pool_id);
1234 if (it != mPoolPoolGroups.end() && !it->second.CheckPool())
1235 return false;
1236 }
1237 {
1238 auto it = mPoolQuestGroups.find(pool_id);
1239 if (it != mPoolQuestGroups.end() && !it->second.CheckPool())
1240 return false;
1241 }
1242 return true;
1243}
PoolGroupCreatureMap mPoolCreatureGroups
Definition PoolMgr.h:198
PoolGroupPoolMap mPoolPoolGroups
Definition PoolMgr.h:200
PoolGroupGameObjectMap mPoolGameobjectGroups
Definition PoolMgr.h:199

References mPoolCreatureGroups, mPoolGameobjectGroups, mPoolPoolGroups, and mPoolQuestGroups.

Referenced by LoadFromDB().

◆ DespawnEventPool()

void PoolMgr::DespawnEventPool ( uint32  pool_id)
1278{
1279 mActiveEventPools.erase(pool_id);
1280
1281 PoolTemplateData const* poolTemplate = GetPoolTemplate(pool_id);
1282 if (!poolTemplate || poolTemplate->MapId == -1)
1283 return;
1284
1285 sMapMgr->DoForAllMapsWithMapId(uint32(poolTemplate->MapId), [pool_id](Map* map)
1286 {
1287 sPoolMgr->DespawnPool(map->GetPoolData(), pool_id);
1288 });
1289}
std::uint32_t uint32
Definition Define.h:107
#define sMapMgr
Definition MapMgr.h:220
Definition Map.h:168
std::unordered_set< uint32 > mActiveEventPools
Definition PoolMgr.h:210
PoolTemplateData const * GetPoolTemplate(uint32 poolId) const
Definition PoolMgr.cpp:1315
Definition PoolMgr.h:31
int32 MapId
Definition PoolMgr.h:33

References GetPoolTemplate(), mActiveEventPools, PoolTemplateData::MapId, and sMapMgr.

◆ DespawnPool()

void PoolMgr::DespawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id 
)
1176{
1177 {
1178 auto it = mPoolCreatureGroups.find(pool_id);
1179 if (it != mPoolCreatureGroups.end() && !it->second.IsEmpty())
1180 it->second.DespawnObject(spawnedPoolData);
1181 }
1182 {
1183 auto it = mPoolGameobjectGroups.find(pool_id);
1184 if (it != mPoolGameobjectGroups.end() && !it->second.IsEmpty())
1185 it->second.DespawnObject(spawnedPoolData);
1186 }
1187 {
1188 auto it = mPoolPoolGroups.find(pool_id);
1189 if (it != mPoolPoolGroups.end() && !it->second.IsEmpty())
1190 it->second.DespawnObject(spawnedPoolData);
1191 }
1192}

References mPoolCreatureGroups, mPoolGameobjectGroups, and mPoolPoolGroups.

◆ GetCreaturePoolId()

uint32 PoolMgr::GetCreaturePoolId ( uint32  guid) const
1340{
1341 SearchMap::const_iterator itr = mCreatureSearchMap.find(guid);
1342 return itr != mCreatureSearchMap.end() ? itr->second : 0;
1343}
SearchMap mCreatureSearchMap
Definition PoolMgr.h:202

References mCreatureSearchMap.

◆ GetGameObjectPoolId()

uint32 PoolMgr::GetGameObjectPoolId ( uint32  guid) const
1346{
1347 SearchMap::const_iterator itr = mGameobjectSearchMap.find(guid);
1348 return itr != mGameobjectSearchMap.end() ? itr->second : 0;
1349}
SearchMap mGameobjectSearchMap
Definition PoolMgr.h:203

References mGameobjectSearchMap.

◆ GetPoolCreatureGroup()

PoolGroup< Creature > const * PoolMgr::GetPoolCreatureGroup ( uint32  poolId) const
1322{
1323 auto itr = mPoolCreatureGroups.find(poolId);
1324 return itr != mPoolCreatureGroups.end() ? &itr->second : nullptr;
1325}

References mPoolCreatureGroups.

◆ GetPoolGameObjectGroup()

PoolGroup< GameObject > const * PoolMgr::GetPoolGameObjectGroup ( uint32  poolId) const
1328{
1329 auto itr = mPoolGameobjectGroups.find(poolId);
1330 return itr != mPoolGameobjectGroups.end() ? &itr->second : nullptr;
1331}

References mPoolGameobjectGroups.

◆ GetPoolPoolGroup()

PoolGroup< Pool > const * PoolMgr::GetPoolPoolGroup ( uint32  poolId) const
1334{
1335 auto itr = mPoolPoolGroups.find(poolId);
1336 return itr != mPoolPoolGroups.end() ? &itr->second : nullptr;
1337}

References mPoolPoolGroups.

◆ GetPoolTemplate()

PoolTemplateData const * PoolMgr::GetPoolTemplate ( uint32  poolId) const
1316{
1317 auto itr = mPoolTemplate.find(poolId);
1318 return itr != mPoolTemplate.end() ? &itr->second : nullptr;
1319}
PoolTemplateDataMap mPoolTemplate
Definition PoolMgr.h:197

References mPoolTemplate.

Referenced by DespawnEventPool(), InitPoolsForMap(), and SpawnEventPool().

◆ GetQuestSpawnedData()

SpawnedPoolData const & PoolMgr::GetQuestSpawnedData ( ) const
inline
180{ return mQuestSpawnedData; }

References mQuestSpawnedData.

◆ Initialize()

void PoolMgr::Initialize ( )
580{
581 mQuestSearchMap.clear();
582 mGameobjectSearchMap.clear();
583 mCreatureSearchMap.clear();
584 mAutoSpawnPoolsPerMap.clear();
585 mActiveEventPools.clear();
586}
std::unordered_map< uint32, std::vector< uint32 > > mAutoSpawnPoolsPerMap
Definition PoolMgr.h:207
SearchMap mQuestSearchMap
Definition PoolMgr.h:205

References mActiveEventPools, mAutoSpawnPoolsPerMap, mCreatureSearchMap, mGameobjectSearchMap, and mQuestSearchMap.

◆ InitPoolsForMap()

std::unique_ptr< SpawnedPoolData > PoolMgr::InitPoolsForMap ( Map map)
1292{
1293 std::unique_ptr<SpawnedPoolData> spawnedPoolData = std::make_unique<SpawnedPoolData>(map);
1294
1295 // The MapInstanced container never holds spawns itself, only its child instances do
1296 if (map->Instanceable() && !map->GetInstanceId())
1297 return spawnedPoolData;
1298
1299 if (std::vector<uint32> const* poolIds = Acore::Containers::MapGetValuePtr(mAutoSpawnPoolsPerMap, map->GetId()))
1300 {
1301 for (uint32 poolId : *poolIds)
1302 SpawnPool(*spawnedPoolData, poolId);
1303 }
1304
1305 for (uint32 poolId : mActiveEventPools)
1306 {
1307 PoolTemplateData const* poolTemplate = GetPoolTemplate(poolId);
1308 if (poolTemplate && poolTemplate->MapId == int32(map->GetId()))
1309 SpawnPool(*spawnedPoolData, poolId);
1310 }
1311
1312 return spawnedPoolData;
1313}
std::int32_t int32
Definition Define.h:103
const Position SpawnPool[7]
Definition boss_kelthuzad.cpp:121
bool Instanceable() const
Definition Map.h:298
uint32 GetId() const
Definition Map.h:234
uint32 GetInstanceId() const
Definition Map.h:270
auto MapGetValuePtr(M &map, typename M::key_type const &key) -> decltype(AddressOrSelf(map.find(key) ->second))
Definition Containers.h:216

References Map::GetId(), Map::GetInstanceId(), GetPoolTemplate(), Map::Instanceable(), mActiveEventPools, Acore::Containers::MapGetValuePtr(), PoolTemplateData::MapId, mAutoSpawnPoolsPerMap, and SpawnPool.

◆ instance()

PoolMgr * PoolMgr::instance ( )
static
574{
575 static PoolMgr instance;
576 return &instance;
577}
Definition PoolMgr.h:125
static PoolMgr * instance()
Definition PoolMgr.cpp:573

References instance().

Referenced by instance().

◆ IsEmpty()

bool PoolMgr::IsEmpty ( uint32  pool_id) const
1195{
1196 {
1197 auto it = mPoolGameobjectGroups.find(pool_id);
1198 if (it != mPoolGameobjectGroups.end() && !it->second.IsEmptyDeepCheck())
1199 return false;
1200 }
1201 {
1202 auto it = mPoolCreatureGroups.find(pool_id);
1203 if (it != mPoolCreatureGroups.end() && !it->second.IsEmptyDeepCheck())
1204 return false;
1205 }
1206 {
1207 auto it = mPoolPoolGroups.find(pool_id);
1208 if (it != mPoolPoolGroups.end() && !it->second.IsEmptyDeepCheck())
1209 return false;
1210 }
1211 {
1212 auto it = mPoolQuestGroups.find(pool_id);
1213 if (it != mPoolQuestGroups.end() && !it->second.IsEmptyDeepCheck())
1214 return false;
1215 }
1216 return true;
1217}

References mPoolCreatureGroups, mPoolGameobjectGroups, mPoolPoolGroups, and mPoolQuestGroups.

Referenced by LoadFromDB().

◆ IsPartOfAPool() [1/5]

template<>
uint32 PoolMgr::IsPartOfAPool ( uint32  db_guid) const
inline
226{
227 SearchMap::const_iterator itr = mCreatureSearchMap.find(db_guid);
228 if (itr != mCreatureSearchMap.end())
229 return itr->second;
230
231 return 0;
232}

References mCreatureSearchMap.

◆ IsPartOfAPool() [2/5]

template<>
uint32 PoolMgr::IsPartOfAPool ( uint32  db_guid) const
inline
237{
238 SearchMap::const_iterator itr = mGameobjectSearchMap.find(db_guid);
239 if (itr != mGameobjectSearchMap.end())
240 return itr->second;
241
242 return 0;
243}

References mGameobjectSearchMap.

◆ IsPartOfAPool() [3/5]

template<typename T >
uint32 PoolMgr::IsPartOfAPool ( uint32  db_guid_or_pool_id) const

◆ IsPartOfAPool() [4/5]

template<>
uint32 PoolMgr::IsPartOfAPool ( uint32  pool_id) const
inline
259{
260 SearchMap::const_iterator itr = mPoolSearchMap.find(pool_id);
261 if (itr != mPoolSearchMap.end())
262 return itr->second;
263
264 return 0;
265}
SearchMap mPoolSearchMap
Definition PoolMgr.h:204

References mPoolSearchMap.

◆ IsPartOfAPool() [5/5]

template<>
uint32 PoolMgr::IsPartOfAPool ( uint32  questId) const
inline
248{
249 SearchMap::const_iterator itr = mQuestSearchMap.find(questId);
250 if (itr != mQuestSearchMap.end())
251 return itr->second;
252
253 return 0;
254}

References mQuestSearchMap.

◆ IsSpawnedObject()

template<typename T >
bool PoolMgr::IsSpawnedObject ( uint32  quest_id) const
inline
146 {
147 static_assert(std::is_same_v<T, Quest>, "only quest pool state is global; query the owning Map's SpawnedPoolData instead");
148 return mQuestSpawnedData.IsSpawnedObject<Quest>(quest_id);
149 }
bool IsSpawnedObject(uint32 db_guid_or_pool_id) const

References SpawnedPoolData::IsSpawnedObject(), and mQuestSpawnedData.

◆ LoadFromDB()

void PoolMgr::LoadFromDB ( )
589{
590 // Pool templates
591 {
592 uint32 oldMSTime = getMSTime();
593
594 QueryResult result = WorldDatabase.Query("SELECT entry, max_limit, description FROM pool_template");
595 if (!result)
596 {
597 mPoolTemplate.clear();
598 LOG_WARN("server.loading", ">> Loaded 0 object pools. DB table `pool_template` is empty.");
599 LOG_INFO("server.loading", " ");
600 return;
601 }
602
603 uint32 count = 0;
604 do
605 {
606 Field* fields = result->Fetch();
607
608 uint32 pool_id = fields[0].Get<uint32>();
609
610 PoolTemplateData& pPoolTemplate = mPoolTemplate[pool_id];
611 pPoolTemplate.MaxLimit = fields[1].Get<uint32>();
612 pPoolTemplate.MapId = -1;
613 pPoolTemplate.Description = fields[2].Get<std::string>();
614
615 ++count;
616 } while (result->NextRow());
617
618 LOG_INFO("server.loading", ">> Loaded {} Objects Pools In {} ms", count, GetMSTimeDiffToNow(oldMSTime));
619 LOG_INFO("server.loading", " ");
620 }
621
622 // Creatures
623
624 LOG_INFO("server.loading", "Loading Creatures Pooling Data...");
625 {
626 uint32 oldMSTime = getMSTime();
627
628 // 1 2 3
629 QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature");
630
631 if (!result)
632 {
633 LOG_WARN("server.loading", ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
634 LOG_INFO("server.loading", " ");
635 }
636 else
637 {
638 uint32 count = 0;
639 do
640 {
641 Field* fields = result->Fetch();
642
643 ObjectGuid::LowType guid = fields[0].Get<uint32>();
644 uint32 pool_id = fields[1].Get<uint32>();
645 float chance = fields[2].Get<float>();
646
647 CreatureData const* data = sObjectMgr->GetCreatureData(guid);
648 if (!data)
649 {
650 LOG_ERROR("sql.sql", "`pool_creature` has a non existing creature spawn (GUID: {}) defined for pool id ({}), skipped.", guid, pool_id);
651 continue;
652 }
653 auto it = mPoolTemplate.find(pool_id);
654 if (it == mPoolTemplate.end())
655 {
656 LOG_ERROR("sql.sql", "`pool_creature` pool id ({}) is not in `pool_template`, skipped.", pool_id);
657 continue;
658 }
659 if (chance < 0 || chance > 100)
660 {
661 LOG_ERROR("sql.sql", "`pool_creature` has an invalid chance ({}) for creature guid ({}) in pool id ({}), skipped.", chance, guid, pool_id);
662 continue;
663 }
664
665 PoolTemplateData* pPoolTemplate = &mPoolTemplate[pool_id];
666 if (pPoolTemplate->MapId == -1)
667 pPoolTemplate->MapId = int32(data->mapid);
668
669 if (pPoolTemplate->MapId != int32(data->mapid))
670 {
671 LOG_ERROR("sql.sql", "`pool_creature` has creature spawns on multiple different maps for creature guid ({}) in pool id ({}), skipped.", guid, pool_id);
672 continue;
673 }
674
675 PoolObject plObject = PoolObject(guid, chance);
676 PoolGroup<Creature>& cregroup = mPoolCreatureGroups[pool_id];
677 cregroup.SetPoolId(pool_id);
678 cregroup.AddEntry(plObject, pPoolTemplate->MaxLimit);
679 SearchPair p(guid, pool_id);
680 mCreatureSearchMap.insert(p);
681
682 ++count;
683 } while (result->NextRow());
684
685 LOG_INFO("server.loading", ">> Loaded {} Creatures In Pools in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
686 LOG_INFO("server.loading", " ");
687 }
688 }
689
690 // Gameobjects
691
692 LOG_INFO("server.loading", "Loading Gameobjects Pooling Data...");
693 {
694 uint32 oldMSTime = getMSTime();
695
696 // 1 2 3
697 QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_gameobject");
698
699 if (!result)
700 {
701 LOG_WARN("server.loading", ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
702 LOG_INFO("server.loading", " ");
703 }
704 else
705 {
706 uint32 count = 0;
707 do
708 {
709 Field* fields = result->Fetch();
710
711 ObjectGuid::LowType guid = fields[0].Get<uint32>();
712 uint32 pool_id = fields[1].Get<uint32>();
713 float chance = fields[2].Get<float>();
714
715 GameObjectData const* data = sObjectMgr->GetGameObjectData(guid);
716 if (!data)
717 {
718 LOG_ERROR("sql.sql", "`pool_gameobject` has a non existing gameobject spawn (GUID: {}) defined for pool id ({}), skipped.", guid, pool_id);
719 continue;
720 }
721
722 GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(data->id);
723 if (goinfo->type != GAMEOBJECT_TYPE_CHEST &&
724 goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
726 {
727 LOG_ERROR("sql.sql", "`pool_gameobject` has a not lootable gameobject spawn (GUID: {}, type: {}) defined for pool id ({}), skipped.", guid, goinfo->type, pool_id);
728 continue;
729 }
730
731 auto it = mPoolTemplate.find(pool_id);
732 if (it == mPoolTemplate.end())
733 {
734 LOG_ERROR("sql.sql", "`pool_gameobject` pool id ({}) is not in `pool_template`, skipped.", pool_id);
735 continue;
736 }
737
738 if (chance < 0 || chance > 100)
739 {
740 LOG_ERROR("sql.sql", "`pool_gameobject` has an invalid chance ({}) for gameobject guid ({}) in pool id ({}), skipped.", chance, guid, pool_id);
741 continue;
742 }
743
744 PoolTemplateData* pPoolTemplate = &mPoolTemplate[pool_id];
745 if (pPoolTemplate->MapId == -1)
746 pPoolTemplate->MapId = int32(data->mapid);
747
748 if (pPoolTemplate->MapId != int32(data->mapid))
749 {
750 LOG_ERROR("sql.sql", "`pool_gameobject` has gameobject spawns on multiple different maps for gameobject guid ({}) in pool id ({}), skipped.", guid, pool_id);
751 continue;
752 }
753
754 PoolObject plObject = PoolObject(guid, chance);
756 gogroup.SetPoolId(pool_id);
757 gogroup.AddEntry(plObject, pPoolTemplate->MaxLimit);
758 SearchPair p(guid, pool_id);
759 mGameobjectSearchMap.insert(p);
760
761 ++count;
762 } while (result->NextRow());
763
764 LOG_INFO("server.loading", ">> Loaded {} Gameobjects In Pools in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
765 LOG_INFO("server.loading", " ");
766 }
767 }
768
769 // Pool of pools
770
771 LOG_INFO("server.loading", "Loading Mother Pooling Data...");
772 {
773 uint32 oldMSTime = getMSTime();
774
775 // 1 2 3
776 QueryResult result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool");
777
778 if (!result)
779 {
780 LOG_WARN("server.loading", ">> Loaded 0 pools in pools");
781 LOG_INFO("server.loading", " ");
782 }
783 else
784 {
785 uint32 count = 0;
786 do
787 {
788 Field* fields = result->Fetch();
789
790 uint32 child_pool_id = fields[0].Get<uint32>();
791 uint32 mother_pool_id = fields[1].Get<uint32>();
792 float chance = fields[2].Get<float>();
793
794 {
795 auto it = mPoolTemplate.find(mother_pool_id);
796 if (it == mPoolTemplate.end())
797 {
798 LOG_ERROR("sql.sql", "`pool_pool` mother_pool id ({}) is not in `pool_template`, skipped.", mother_pool_id);
799 continue;
800 }
801 }
802 {
803 auto it = mPoolTemplate.find(child_pool_id);
804 if (it == mPoolTemplate.end())
805 {
806 LOG_ERROR("sql.sql", "`pool_pool` included pool_id ({}) is not in `pool_template`, skipped.", child_pool_id);
807 continue;
808 }
809 }
810 if (mother_pool_id == child_pool_id)
811 {
812 LOG_ERROR("sql.sql", "`pool_pool` pool_id ({}) includes itself, dead-lock detected, skipped.", child_pool_id);
813 continue;
814 }
815 if (chance < 0 || chance > 100)
816 {
817 LOG_ERROR("sql.sql", "`pool_pool` has an invalid chance ({}) for pool id ({}) in mother pool id ({}), skipped.", chance, child_pool_id, mother_pool_id);
818 continue;
819 }
820 PoolTemplateData* pPoolTemplateMother = &mPoolTemplate[mother_pool_id];
821 PoolObject plObject = PoolObject(child_pool_id, chance);
822 PoolGroup<Pool>& plgroup = mPoolPoolGroups[mother_pool_id];
823 plgroup.SetPoolId(mother_pool_id);
824 plgroup.AddEntry(plObject, pPoolTemplateMother->MaxLimit);
825 SearchPair p(child_pool_id, mother_pool_id);
826 mPoolSearchMap.insert(p);
827
828 ++count;
829 } while (result->NextRow());
830
831 // Now check for circular reference
832 // All pool_ids are in pool_template
833 for (auto const& it : mPoolTemplate)
834 {
835 std::set<uint32> checkedPools;
836 for (SearchMap::iterator poolItr = mPoolSearchMap.find(it.first); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second))
837 {
838 // A mother pool spawns in one map's pool data, so the whole chain must stay on that map
839 if (mPoolTemplate[poolItr->first].MapId != -1)
840 {
841 if (mPoolTemplate[poolItr->second].MapId == -1)
842 mPoolTemplate[poolItr->second].MapId = mPoolTemplate[poolItr->first].MapId;
843
844 if (mPoolTemplate[poolItr->second].MapId != mPoolTemplate[poolItr->first].MapId)
845 {
846 LOG_ERROR("sql.sql", "`pool_pool` has child pools on multiple maps in pool id ({}), skipped.", poolItr->second);
847 mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
848 mPoolSearchMap.erase(poolItr);
849 --count;
850 break;
851 }
852 }
853
854 checkedPools.insert(poolItr->first);
855 if (checkedPools.find(poolItr->second) != checkedPools.end())
856 {
857 std::ostringstream ss;
858 ss << "The pool(s) ";
859 for (std::set<uint32>::const_iterator itr = checkedPools.begin(); itr != checkedPools.end(); ++itr)
860 ss << *itr << ' ';
861 ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
862 << poolItr->first << " and child pool " << poolItr->second;
863 LOG_ERROR("sql.sql", "{}", ss.str());
864 mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
865 mPoolSearchMap.erase(poolItr);
866 --count;
867 break;
868 }
869 }
870 }
871
872 LOG_INFO("server.loading", ">> Loaded {} Pools In Mother Pools in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
873 LOG_INFO("server.loading", " ");
874 }
875 }
876
877 LOG_INFO("server.loading", "Loading Quest Pooling Data...");
878 {
879 uint32 oldMSTime = getMSTime();
880
882 PreparedQueryResult result = WorldDatabase.Query(stmt);
883
884 if (!result)
885 {
886 LOG_WARN("server.loading", ">> Loaded 0 quests in pools");
887 LOG_INFO("server.loading", " ");
888 }
889 else
890 {
893
894 enum eQuestTypes
895 {
896 QUEST_NONE = 0,
897 QUEST_DAILY = 1,
898 QUEST_WEEKLY = 2
899 };
900
901 std::map<uint32, int32> poolTypeMap;
902 uint32 count = 0;
903 do
904 {
905 Field* fields = result->Fetch();
906
907 uint32 entry = fields[0].Get<uint32>();
908 uint32 pool_id = fields[1].Get<uint32>();
909
910 Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
911 if (!quest)
912 {
913 LOG_ERROR("sql.sql", "`pool_quest` has a non existing quest template (Entry: {}) defined for pool id ({}), skipped.", entry, pool_id);
914 continue;
915 }
916
917 auto it = mPoolTemplate.find(pool_id);
918 if (it == mPoolTemplate.end())
919 {
920 LOG_ERROR("sql.sql", "`pool_quest` pool id ({}) is not in `pool_template`, skipped.", pool_id);
921 continue;
922 }
923
924 // Quest pool state is global while mother pools spawn into one map's
925 // pool data, so a quest pool can never be a mother pool's child
926 if (uint32 motherPoolId = IsPartOfAPool<Pool>(pool_id))
927 {
928 LOG_ERROR("sql.sql", "`pool_quest` pool id ({}) is a child of mother pool ({}), quest pools cannot be part of mother pools, skipped.", pool_id, motherPoolId);
929 continue;
930 }
931
932 if (!quest->IsDailyOrWeekly())
933 {
934 LOG_ERROR("sql.sql", "`pool_quest` has an quest ({}) which is not daily or weekly in pool id ({}), use ExclusiveGroup instead, skipped.", entry, pool_id);
935 continue;
936 }
937
938 if (poolTypeMap[pool_id] == QUEST_NONE)
939 poolTypeMap[pool_id] = quest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
940
941 int32 currType = quest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
942
943 if (poolTypeMap[pool_id] != currType)
944 {
945 LOG_ERROR("sql.sql", "`pool_quest` quest {} is {} but pool ({}) is specified for {}, mixing not allowed, skipped.",
946 entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY");
947 continue;
948 }
949
950 creBounds = mQuestCreatureRelation.equal_range(entry);
951 goBounds = mQuestGORelation.equal_range(entry);
952
953 if (creBounds.first == creBounds.second && goBounds.first == goBounds.second)
954 {
955 LOG_ERROR("sql.sql", "`pool_quest` lists entry ({}) as member of pool ({}) but is not started anywhere, skipped.", entry, pool_id);
956 continue;
957 }
958
959 PoolTemplateData* pPoolTemplate = &mPoolTemplate[pool_id];
960 PoolObject plObject = PoolObject(entry, 0.0f);
961 PoolGroup<Quest>& questgroup = mPoolQuestGroups[pool_id];
962 questgroup.SetPoolId(pool_id);
963 questgroup.AddEntry(plObject, pPoolTemplate->MaxLimit);
964 SearchPair p(entry, pool_id);
965 mQuestSearchMap.insert(p);
966
967 ++count;
968 } while (result->NextRow());
969
970 LOG_INFO("server.loading", ">> Loaded {} Quests In Pools in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
971 LOG_INFO("server.loading", " ");
972 }
973 }
974
975 for (auto const& [poolId, templateData] : mPoolTemplate)
976 {
977 if (IsEmpty(poolId))
978 LOG_ERROR("sql.sql", "Pool Id {} is empty (has no creatures, no gameobjects, no quests and no valid child pools). The pool will not be spawned.", poolId);
979 }
980
981 // 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
982 LOG_INFO("server.loading", "Starting Objects Pooling System...");
983 {
984 uint32 oldMSTime = getMSTime();
985
986 QueryResult result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template"
987 " LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry"
988 " LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
989
990 if (!result)
991 {
992 LOG_INFO("server.loading", ">> Pool handling system initialized, 0 pools spawned.");
993 LOG_INFO("server.loading", " ");
994 }
995 else
996 {
997 uint32 count = 0;
998 do
999 {
1000 Field* fields = result->Fetch();
1001 uint32 pool_entry = fields[0].Get<uint32>();
1002 uint32 pool_pool_id = fields[1].Get<uint32>();
1003
1004 if (IsEmpty(pool_entry))
1005 continue;
1006
1007 if (!CheckPool(pool_entry))
1008 {
1009 if (pool_pool_id)
1010 // 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,
1011 // however that could recursively invalidate entire chain of mother pools. It can be done in the future but for now we'll do nothing.
1012 LOG_ERROR("sql.sql", "Pool Id {} has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id {} and cannot be safely removed.", pool_entry, fields[2].Get<uint32>());
1013 else
1014 LOG_ERROR("sql.sql", "Pool Id {} has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
1015 continue;
1016 }
1017
1018 // Don't spawn child pools, they are spawned recursively by their parent pools
1019 if (!pool_pool_id)
1020 {
1021 // Quest pools are global and not map-bound: spawn them now
1022 // (restores the previously saved state from the characters DB)
1023 if (mPoolQuestGroups.find(pool_entry) != mPoolQuestGroups.end())
1024 SpawnPool<Quest>(mQuestSpawnedData, pool_entry, 0);
1025
1026 PoolTemplateData const& templateData = mPoolTemplate[pool_entry];
1027 if (templateData.MapId != -1)
1028 mAutoSpawnPoolsPerMap[uint32(templateData.MapId)].push_back(pool_entry);
1029
1030 count++;
1031 }
1032 } while (result->NextRow());
1033
1034 LOG_INFO("server.loading", ">> Pool handling system initialized, {} pools will be spawned by default in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1035 LOG_INFO("server.loading", " ");
1036 }
1037 }
1038}
std::shared_ptr< ResultSet > QueryResult
Definition DatabaseEnvFwd.h:27
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition DatabaseEnvFwd.h:45
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition DatabaseEnv.cpp:20
#define LOG_INFO(filterType__,...)
Definition Log.h:153
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
#define LOG_WARN(filterType__,...)
Definition Log.h:149
std::pair< PooledQuestRelation::const_iterator, PooledQuestRelation::const_iterator > PooledQuestRelationBounds
Definition PoolMgr.h:121
@ GAMEOBJECT_TYPE_CHEST
Definition SharedDefines.h:1567
@ GAMEOBJECT_TYPE_FISHINGHOLE
Definition SharedDefines.h:1589
@ GAMEOBJECT_TYPE_GOOBER
Definition SharedDefines.h:1574
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:131
uint32 getMSTime()
Definition Timer.h:103
@ WORLD_SEL_QUEST_POOLS
Definition WorldDatabase.h:31
Class used to access individual fields of database query result.
Definition Field.h:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:112
uint32 LowType
Definition ObjectGuid.h:125
Definition PoolMgr.h:86
void SetPoolId(uint32 pool_id)
Definition PoolMgr.h:90
void AddEntry(PoolObject &poolitem, uint32 maxentries)
Definition PoolMgr.cpp:133
std::pair< uint32, uint32 > SearchPair
Definition PoolMgr.h:194
bool IsEmpty(uint32 pool_id) const
Definition PoolMgr.cpp:1194
bool CheckPool(uint32 pool_id) const
Definition PoolMgr.cpp:1220
PooledQuestRelation mQuestGORelation
Definition PoolMgr.h:173
PooledQuestRelation mQuestCreatureRelation
Definition PoolMgr.h:172
Definition PreparedStatement.h:157
Definition CreatureData.h:370
Definition GameObjectData.h:715
Definition GameObjectData.h:32
uint32 type
Definition GameObjectData.h:34
Definition PoolMgr.h:38
uint32 MaxLimit
Definition PoolMgr.h:32

References PoolGroup< T >::AddEntry(), CheckPool(), GAMEOBJECT_TYPE_CHEST, GAMEOBJECT_TYPE_FISHINGHOLE, GAMEOBJECT_TYPE_GOOBER, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), IsEmpty(), LOG_ERROR, LOG_INFO, LOG_WARN, PoolTemplateData::MapId, mAutoSpawnPoolsPerMap, PoolTemplateData::MaxLimit, mCreatureSearchMap, mGameobjectSearchMap, mPoolCreatureGroups, mPoolGameobjectGroups, mPoolPoolGroups, mPoolQuestGroups, mPoolSearchMap, mPoolTemplate, mQuestCreatureRelation, mQuestGORelation, mQuestSearchMap, mQuestSpawnedData, PoolGroup< T >::SetPoolId(), sObjectMgr, GameObjectTemplate::type, WORLD_SEL_QUEST_POOLS, and WorldDatabase.

◆ LoadQuestPools()

void PoolMgr::LoadQuestPools ( )
1041{
1042}

◆ ReSpawnPoolQuests()

void PoolMgr::ReSpawnPoolQuests ( )
1115{
1116 for (auto& [questId, poolId] : mQuestSearchMap)
1117 {
1118 if (IsSpawnedObject<Quest>(questId))
1119 {
1120 PoolObject tempObj(questId, 0.0f);
1121 auto it = mPoolQuestGroups.find(poolId);
1122 if (it != mPoolQuestGroups.end())
1123 it->second.Spawn1Object(mQuestSpawnedData, &tempObj);
1124 }
1125 }
1126}

References mPoolQuestGroups, mQuestSearchMap, and mQuestSpawnedData.

◆ SaveQuestsToDB()

void PoolMgr::SaveQuestsToDB ( bool  daily,
bool  weekly,
bool  other 
)
1045{
1046 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
1047
1048 // pussywizard: mysql thread races, change only what is meant to be changed
1049 std::set<uint32> deletedPools;
1050 for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
1051 {
1052 if (itr->second.IsEmpty())
1053 continue;
1054 if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId()))
1055 {
1056 if (!daily && quest->IsDaily())
1057 continue;
1058 if (!weekly && quest->IsWeekly())
1059 continue;
1060 if (!other && !quest->IsDaily() && !quest->IsWeekly())
1061 continue;
1062 }
1064 stmt->SetData(0, itr->second.GetPoolId());
1065 trans->Append(stmt);
1066 deletedPools.insert(itr->second.GetPoolId());
1067 }
1068
1069 for (SearchMap::iterator itr = mQuestSearchMap.begin(); itr != mQuestSearchMap.end(); ++itr)
1070 if (deletedPools.find(itr->second) != deletedPools.end())
1071 if (IsSpawnedObject<Quest>(itr->first))
1072 {
1074 stmt->SetData(0, itr->second);
1075 stmt->SetData(1, itr->first);
1076 trans->Append(stmt);
1077 }
1078
1079 CharacterDatabase.CommitTransaction(trans);
1080}
@ CHAR_DEL_QUEST_POOL_SAVE
Definition CharacterDatabase.h:31
@ CHAR_INS_QUEST_POOL_SAVE
Definition CharacterDatabase.h:32
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
Definition DatabaseEnvFwd.h:69
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition DatabaseEnv.cpp:21
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77

References CHAR_DEL_QUEST_POOL_SAVE, CHAR_INS_QUEST_POOL_SAVE, CharacterDatabase, mPoolQuestGroups, mQuestSearchMap, PreparedStatementBase::SetData(), and sObjectMgr.

Referenced by ChangeDailyQuests(), and ChangeWeeklyQuests().

◆ SpawnEventPool()

void PoolMgr::SpawnEventPool ( uint32  pool_id)
1263{
1264 PoolTemplateData const* poolTemplate = GetPoolTemplate(pool_id);
1265 if (!poolTemplate || poolTemplate->MapId == -1)
1266 return;
1267
1268 // Remembered while the event runs so maps created later spawn it on creation
1269 mActiveEventPools.insert(pool_id);
1270
1271 sMapMgr->DoForAllMapsWithMapId(uint32(poolTemplate->MapId), [pool_id](Map* map)
1272 {
1273 sPoolMgr->SpawnPool(map->GetPoolData(), pool_id);
1274 });
1275}

References GetPoolTemplate(), mActiveEventPools, PoolTemplateData::MapId, and sMapMgr.

◆ SpawnPool() [1/10]

void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id 
)
1168{
1169 SpawnPool<Pool>(spawnedPoolData, pool_id, 0);
1170 SpawnPool<GameObject>(spawnedPoolData, pool_id, 0);
1171 SpawnPool<Creature>(spawnedPoolData, pool_id, 0);
1172}

◆ SpawnPool() [2/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid 
)
private
1132{
1133 auto it = mPoolCreatureGroups.find(pool_id);
1134 if (it != mPoolCreatureGroups.end() && !it->second.IsEmpty())
1135 it->second.SpawnObject(spawnedPoolData, mPoolTemplate[pool_id].MaxLimit, db_guid);
1136}

References mPoolCreatureGroups, and mPoolTemplate.

◆ SpawnPool() [3/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid 
)
private
1142{
1143 auto it = mPoolGameobjectGroups.find(pool_id);
1144 if (it != mPoolGameobjectGroups.end() && !it->second.IsEmpty())
1145 it->second.SpawnObject(spawnedPoolData, mPoolTemplate[pool_id].MaxLimit, db_guid);
1146}

References mPoolGameobjectGroups, and mPoolTemplate.

◆ SpawnPool() [4/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid 
)
private

◆ SpawnPool() [5/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid 
)
private

◆ SpawnPool() [6/10]

template<typename T >
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid_or_pool_id 
)
private

◆ SpawnPool() [7/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  quest_id 
)
private
1161{
1162 auto it = mPoolQuestGroups.find(pool_id);
1163 if (it != mPoolQuestGroups.end() && !it->second.IsEmpty())
1164 it->second.SpawnObject(spawnedPoolData, mPoolTemplate[pool_id].MaxLimit, quest_id);
1165}

References mPoolQuestGroups, and mPoolTemplate.

◆ SpawnPool() [8/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  quest_id 
)
private

◆ SpawnPool() [9/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  sub_pool_id 
)
private
1152{
1153 auto it = mPoolPoolGroups.find(pool_id);
1154 if (it != mPoolPoolGroups.end() && !it->second.IsEmpty())
1155 it->second.SpawnObject(spawnedPoolData, mPoolTemplate[pool_id].MaxLimit, sub_pool_id);
1156}

References mPoolPoolGroups, and mPoolTemplate.

◆ SpawnPool() [10/10]

template<>
void PoolMgr::SpawnPool ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  sub_pool_id 
)
private

◆ UpdatePool()

template<typename T >
template void PoolMgr::UpdatePool< Quest > ( SpawnedPoolData spawnedPoolData,
uint32  pool_id,
uint32  db_guid_or_pool_id 
)
1250{
1251 if (uint32 motherpoolid = IsPartOfAPool<Pool>(pool_id))
1252 SpawnPool<Pool>(spawnedPoolData, motherpoolid, pool_id);
1253 else
1254 SpawnPool<T>(spawnedPoolData, pool_id, db_guid_or_pool_id);
1255}

Friends And Related Symbol Documentation

◆ PoolQuestReloadFixTest

friend class PoolQuestReloadFixTest
friend

Member Data Documentation

◆ mActiveEventPools

std::unordered_set<uint32> PoolMgr::mActiveEventPools
private

◆ mAutoSpawnPoolsPerMap

std::unordered_map<uint32, std::vector<uint32> > PoolMgr::mAutoSpawnPoolsPerMap
private

◆ mCreatureSearchMap

SearchMap PoolMgr::mCreatureSearchMap
private

◆ mGameobjectSearchMap

SearchMap PoolMgr::mGameobjectSearchMap
private

◆ mPoolCreatureGroups

PoolGroupCreatureMap PoolMgr::mPoolCreatureGroups
private

◆ mPoolGameobjectGroups

PoolGroupGameObjectMap PoolMgr::mPoolGameobjectGroups
private

◆ mPoolPoolGroups

PoolGroupPoolMap PoolMgr::mPoolPoolGroups
private

◆ mPoolQuestGroups

◆ mPoolSearchMap

SearchMap PoolMgr::mPoolSearchMap
private

Referenced by IsPartOfAPool(), and LoadFromDB().

◆ mPoolTemplate

PoolTemplateDataMap PoolMgr::mPoolTemplate
private

◆ mQuestCreatureRelation

PooledQuestRelation PoolMgr::mQuestCreatureRelation

Referenced by LoadFromDB().

◆ mQuestGORelation

PooledQuestRelation PoolMgr::mQuestGORelation

Referenced by LoadFromDB().

◆ mQuestSearchMap

SearchMap PoolMgr::mQuestSearchMap
private

◆ mQuestSpawnedData


The documentation for this class was generated from the following files: