mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 00:36:07 +00:00
refactor(Core): Rename ...Manager to ...Mgr (#6910)
* Rename MapManager.h to MapMgr.h * Rename BanManager.h to BanMgr.h * Rename MapManager.cpp to MapMgr.cpp * Rename BanManager.cpp to BanMgr.cpp * Rename MapRefManager.h to MapRefMgr.h * Rename ThreatManager.h to ThreatMgr.h * Rename GridRefManager.h to GridRefMgr.h * Rename ThreatManager.cpp to ThreatMgr.cpp * Rename GroupRefManager.h to GroupRefMgr.h * Rename HostileRefManager.h to HostileRefMgr.h * Rename HostileRefManager.cpp to HostileRefMgr.cpp * Rename MMapManager.h to MMapMgr.h * Rename FollowerRefManager.h to FollowerRefMgr.h * Rename VMapManager2.h to VMapMgr2.h * Rename IVMapManager.h to IVMapMgr.h * Rename MMapManager.cpp to MMapMgr.cpp * Rename VMapManager2.cpp to VMapMgr2.cpp * Rename RefManager.h to RefMgr.h * Rename WaypointManager.h to WaypointMgr.h * Rename WaypointManager.cpp to WaypointMgr.cpp * Rename MPQManager.h to MPQMgr.h * Rename MPQManager.cpp to MPQMgr.cpp * Rename IMMAPManager.h to IMMAPMgr.h * fix build * Update Main.cpp * chore(Core/Misc): Remove toxic language * Revert "chore(Core/Misc): Remove toxic language" * fix build * build
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
@@ -65,8 +65,8 @@ Map::~Map()
|
||||
if (!m_scriptSchedule.empty())
|
||||
sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
//MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId());
|
||||
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(GetId(), i_InstanceId);
|
||||
//MMAP::MMapFactory::createOrGetMMapMgr()->unloadMap(GetId());
|
||||
MMAP::MMapFactory::createOrGetMMapMgr()->unloadMapInstance(GetId(), i_InstanceId);
|
||||
}
|
||||
|
||||
bool Map::ExistMap(uint32 mapid, int gx, int gy)
|
||||
@@ -98,7 +98,7 @@ bool Map::ExistMap(uint32 mapid, int gx, int gy)
|
||||
|
||||
bool Map::ExistVMap(uint32 mapid, int gx, int gy)
|
||||
{
|
||||
if (VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager())
|
||||
if (VMAP::IVMapMgr* vmgr = VMAP::VMapFactory::createOrGetVMapMgr())
|
||||
{
|
||||
if (vmgr->isMapLoadingEnabled())
|
||||
{
|
||||
@@ -120,7 +120,7 @@ void Map::LoadMMap(int gx, int gy)
|
||||
if (!DisableMgr::IsPathfindingEnabled(this)) // pussywizard
|
||||
return;
|
||||
|
||||
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(GetId(), gx, gy);
|
||||
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(GetId(), gx, gy);
|
||||
switch (mmapLoadResult)
|
||||
{
|
||||
case MMAP::MMAP_LOAD_RESULT_OK:
|
||||
@@ -138,7 +138,7 @@ void Map::LoadMMap(int gx, int gy)
|
||||
void Map::LoadVMap(int gx, int gy)
|
||||
{
|
||||
// x and y are swapped !!
|
||||
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld->GetDataPath() + "vmaps").c_str(), GetId(), gx, gy);
|
||||
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap((sWorld->GetDataPath() + "vmaps").c_str(), GetId(), gx, gy);
|
||||
switch (vmapLoadResult)
|
||||
{
|
||||
case VMAP::VMAP_LOAD_RESULT_OK:
|
||||
@@ -717,7 +717,7 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
_dynamicTree.update(t_diff);
|
||||
|
||||
/// update worldsessions for existing players
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* player = m_mapRefIter->GetSource();
|
||||
if (player && player->IsInWorld())
|
||||
@@ -731,7 +731,7 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
|
||||
if (!t_diff)
|
||||
{
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* player = m_mapRefIter->GetSource();
|
||||
|
||||
@@ -780,7 +780,7 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
|
||||
// the player iterator is stored in the map object
|
||||
// to make sure calls to Map::Remove don't invalidate it
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* player = m_mapRefIter->GetSource();
|
||||
|
||||
@@ -811,7 +811,7 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
updateList.clear();
|
||||
float rangeSq = player->GetGridActivationRange() - 1.0f;
|
||||
rangeSq = rangeSq * rangeSq;
|
||||
HostileReference* ref = player->getHostileRefManager().getFirst();
|
||||
HostileReference* ref = player->getHostileRefMgr().getFirst();
|
||||
while (ref)
|
||||
{
|
||||
if (Unit* unit = ref->GetSource()->GetOwner())
|
||||
@@ -866,19 +866,19 @@ void Map::HandleDelayedVisibility()
|
||||
|
||||
struct ResetNotifier
|
||||
{
|
||||
template<class T>inline void resetNotify(GridRefManager<T>& m)
|
||||
template<class T>inline void resetNotify(GridRefMgr<T>& m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefMgr<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->GetSource()->ResetAllNotifies();
|
||||
}
|
||||
template<class T> void Visit(GridRefManager<T>&) {}
|
||||
template<class T> void Visit(GridRefMgr<T>&) {}
|
||||
void Visit(CreatureMapType& m) { resetNotify<Creature>(m);}
|
||||
void Visit(PlayerMapType& m) { resetNotify<Player>(m);}
|
||||
};
|
||||
|
||||
void Map::RemovePlayerFromMap(Player* player, bool remove)
|
||||
{
|
||||
player->getHostileRefManager().deleteReferences(); // pussywizard: multithreading crashfix
|
||||
player->getHostileRefMgr().deleteReferences(); // pussywizard: multithreading crashfix
|
||||
|
||||
bool inWorld = player->IsInWorld();
|
||||
player->RemoveFromWorld();
|
||||
@@ -1213,8 +1213,8 @@ bool Map::UnloadGrid(NGridType& ngrid)
|
||||
delete GridMaps[gx][gy];
|
||||
}
|
||||
// x and y are swapped
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy);
|
||||
MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId(), gx, gy);
|
||||
VMAP::VMapFactory::createOrGetVMapMgr()->unloadMap(GetId(), gx, gy);
|
||||
MMAP::MMapFactory::createOrGetMMapMgr()->unloadMap(GetId(), gx, gy);
|
||||
}
|
||||
|
||||
GridMaps[gx][gy] = nullptr;
|
||||
@@ -1227,7 +1227,7 @@ void Map::RemoveAllPlayers()
|
||||
{
|
||||
if (HavePlayers())
|
||||
{
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (!player->IsBeingTeleportedFar())
|
||||
@@ -1246,11 +1246,11 @@ void Map::UnloadAll()
|
||||
_creaturesToMove.clear();
|
||||
_gameObjectsToMove.clear();
|
||||
|
||||
for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end();)
|
||||
for (GridRefMgr<NGridType>::iterator i = GridRefMgr<NGridType>::begin(); i != GridRefMgr<NGridType>::end();)
|
||||
{
|
||||
NGridType& grid(*i->GetSource());
|
||||
++i;
|
||||
UnloadGrid(grid); // deletes the grid and removes it from the GridRefManager
|
||||
UnloadGrid(grid); // deletes the grid and removes it from the GridRefMgr
|
||||
}
|
||||
|
||||
// pussywizard: crashfix, some npc can be left on transport (not a default passenger)
|
||||
@@ -2018,7 +2018,7 @@ float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float
|
||||
float vmapHeight = VMAP_INVALID_HEIGHT_VALUE;
|
||||
if (checkVMap)
|
||||
{
|
||||
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
VMAP::IVMapMgr* vmgr = VMAP::VMapFactory::createOrGetVMapMgr();
|
||||
vmapHeight = vmgr->getHeight(GetId(), x, y, z, maxSearchDist); // look from a bit higher pos to find the floor
|
||||
}
|
||||
|
||||
@@ -2070,7 +2070,7 @@ bool Map::GetAreaInfo(uint32 phaseMask, float x, float y, float z, uint32& flags
|
||||
float vmap_z = z;
|
||||
float dynamic_z = z;
|
||||
float check_z = z;
|
||||
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
VMAP::IVMapMgr* vmgr = VMAP::VMapFactory::createOrGetVMapMgr();
|
||||
uint32 vflags;
|
||||
int32 vadtId;
|
||||
int32 vrootId;
|
||||
@@ -2172,7 +2172,7 @@ LiquidData const Map::GetLiquidData(uint32 phaseMask, float x, float y, float z,
|
||||
{
|
||||
LiquidData liquidData;
|
||||
|
||||
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
VMAP::IVMapMgr* vmgr = VMAP::VMapFactory::createOrGetVMapMgr();
|
||||
float liquid_level = INVALID_HEIGHT;
|
||||
float ground_level = INVALID_HEIGHT;
|
||||
uint32 liquid_type = 0;
|
||||
@@ -2258,7 +2258,7 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl
|
||||
{
|
||||
GridMap* gmap = GetGrid(x, y);
|
||||
|
||||
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
VMAP::IVMapMgr* vmgr = VMAP::VMapFactory::createOrGetVMapMgr();
|
||||
VMAP::AreaAndLiquidData vmapData;
|
||||
VMAP::AreaAndLiquidData dynData;
|
||||
VMAP::AreaAndLiquidData* wmoData = nullptr;
|
||||
@@ -2405,7 +2405,7 @@ float Map::GetWaterLevel(float x, float y) const
|
||||
|
||||
bool Map::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks) const
|
||||
{
|
||||
if ((checks & LINEOFSIGHT_CHECK_VMAP) && !VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2))
|
||||
if ((checks & LINEOFSIGHT_CHECK_VMAP) && !VMAP::VMapFactory::createOrGetVMapMgr()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2))
|
||||
return false;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_CHECK_GOBJECT_LOS) && (checks & LINEOFSIGHT_CHECK_GOBJECT)
|
||||
@@ -2673,7 +2673,7 @@ void Map::RemoveAllObjectsInRemoveList()
|
||||
uint32 Map::GetPlayersCountExceptGMs() const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
if (!itr->GetSource()->IsGameMaster())
|
||||
++count;
|
||||
return count;
|
||||
@@ -2681,7 +2681,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
|
||||
|
||||
void Map::SendToPlayers(WorldPacket const* data) const
|
||||
{
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
@@ -2957,7 +2957,7 @@ void InstanceMap::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread
|
||||
void InstanceMap::RemovePlayerFromMap(Player* player, bool remove)
|
||||
{
|
||||
// pussywizard: moved m_unloadTimer to InstanceMap::AfterPlayerUnlinkFromMap(), in this function if 2 players run out at the same time the instance won't close
|
||||
//if (!m_unloadTimer && m_mapRefManager.getSize() == 1)
|
||||
//if (!m_unloadTimer && m_mapRefMgr.getSize() == 1)
|
||||
// m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
|
||||
Map::RemovePlayerFromMap(player, remove);
|
||||
player->SetPendingBind(0, 0);
|
||||
@@ -3020,7 +3020,7 @@ bool InstanceMap::Reset(uint8 method, GuidList* globalResetSkipList)
|
||||
if (method == INSTANCE_RESET_GLOBAL)
|
||||
{
|
||||
// pussywizard: teleport out immediately
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
{
|
||||
// teleport players that are no longer bound (can be still bound if extended id)
|
||||
if (!globalResetSkipList || std::find(globalResetSkipList->begin(), globalResetSkipList->end(), itr->GetSource()->GetGUID()) == globalResetSkipList->end())
|
||||
@@ -3037,14 +3037,14 @@ bool InstanceMap::Reset(uint8 method, GuidList* globalResetSkipList)
|
||||
m_resetAfterUnload = true;
|
||||
}
|
||||
|
||||
return m_mapRefManager.isEmpty();
|
||||
return m_mapRefMgr.isEmpty();
|
||||
}
|
||||
|
||||
if (HavePlayers())
|
||||
{
|
||||
if (method == INSTANCE_RESET_ALL || method == INSTANCE_RESET_CHANGE_DIFFICULTY)
|
||||
{
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
itr->GetSource()->SendResetFailedNotify(GetId());
|
||||
}
|
||||
}
|
||||
@@ -3054,7 +3054,7 @@ bool InstanceMap::Reset(uint8 method, GuidList* globalResetSkipList)
|
||||
m_resetAfterUnload = true;
|
||||
}
|
||||
|
||||
return m_mapRefManager.isEmpty();
|
||||
return m_mapRefMgr.isEmpty();
|
||||
}
|
||||
|
||||
std::string const& InstanceMap::GetScriptName() const
|
||||
@@ -3077,7 +3077,7 @@ void InstanceMap::PermBindAllPlayers()
|
||||
Player* player;
|
||||
Group* group;
|
||||
// group members outside the instance group don't get bound
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
{
|
||||
player = itr->GetSource();
|
||||
group = player->GetGroup();
|
||||
@@ -3115,7 +3115,7 @@ void InstanceMap::UnloadAll()
|
||||
|
||||
void InstanceMap::SendResetWarnings(uint32 timeLeft) const
|
||||
{
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
itr->GetSource()->SendInstanceResetWarning(GetId(), itr->GetSource()->GetDifficulty(IsRaid()), timeLeft, false);
|
||||
}
|
||||
|
||||
@@ -3213,7 +3213,7 @@ void BattlegroundMap::SetUnload()
|
||||
void BattlegroundMap::RemoveAllPlayers()
|
||||
{
|
||||
if (HavePlayers())
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (!player->IsBeingTeleportedFar())
|
||||
player->TeleportTo(player->GetEntryPoint());
|
||||
@@ -3851,7 +3851,7 @@ bool Map::CheckCollisionAndGetValidCoords(const WorldObject* source, float start
|
||||
// Unit is not on the ground, check for potential collision via vmaps
|
||||
if (notOnGround)
|
||||
{
|
||||
bool col = VMAP::VMapFactory::createOrGetVMapManager()->GetObjectHitPos(source->GetMapId(),
|
||||
bool col = VMAP::VMapFactory::createOrGetVMapMgr()->GetObjectHitPos(source->GetMapId(),
|
||||
startX, startY, startZ + halfHeight,
|
||||
destX, destY, destZ + halfHeight,
|
||||
destX, destY, destZ, -CONTACT_DISTANCE);
|
||||
|
||||
Reference in New Issue
Block a user