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:
parent
7e2aa2402f
commit
2f449326e0
187 changed files with 719 additions and 719 deletions
|
|
@ -13,7 +13,7 @@
|
|||
#include "RegularGrid.h"
|
||||
#include "Timer.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
#include "WorldModel.h"
|
||||
|
||||
#include <G3D/AABox.h>
|
||||
|
|
@ -317,7 +317,7 @@ void DynamicMapTree::GetAreaAndLiquidData(float x, float y, float z, uint32 phas
|
|||
data.floorZ = intersectionCallBack.GetLocationInfo().ground_Z;
|
||||
uint32 liquidType = intersectionCallBack.GetLocationInfo().hitModel->GetLiquidType();
|
||||
float liquidLevel;
|
||||
if (!reqLiquidType || (dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager())->GetLiquidFlagsPtr(liquidType) & reqLiquidType))
|
||||
if (!reqLiquidType || (dynamic_cast<VMAP::VMapMgr2*>(VMAP::VMapFactory::createOrGetVMapMgr())->GetLiquidFlagsPtr(liquidType) & reqLiquidType))
|
||||
if (intersectionCallBack.GetHitModel()->GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), liquidLevel))
|
||||
data.liquidInfo.emplace(liquidType, liquidLevel);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ namespace MMAP
|
|||
MMAP_LOAD_RESULT_IGNORED,
|
||||
};
|
||||
|
||||
class IMMapManager
|
||||
class IMMapMgr
|
||||
{
|
||||
private:
|
||||
bool iEnablePathFinding;
|
||||
|
||||
public:
|
||||
IMMapManager() : iEnablePathFinding(true) {}
|
||||
virtual ~IMMapManager(void) {}
|
||||
IMMapMgr() : iEnablePathFinding(true) {}
|
||||
virtual ~IMMapMgr(void) {}
|
||||
|
||||
//Enabled/Disabled Pathfinding
|
||||
void setEnablePathFinding(bool value) { iEnablePathFinding = value; }
|
||||
|
|
@ -55,16 +55,16 @@ namespace VMAP
|
|||
};
|
||||
|
||||
//===========================================================
|
||||
class IVMapManager
|
||||
class IVMapMgr
|
||||
{
|
||||
private:
|
||||
bool iEnableLineOfSightCalc{true};
|
||||
bool iEnableHeightCalc{true};
|
||||
|
||||
public:
|
||||
IVMapManager() { }
|
||||
IVMapMgr() { }
|
||||
|
||||
virtual ~IVMapManager() = default;
|
||||
virtual ~IVMapMgr() = default;
|
||||
|
||||
virtual int loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
|
||||
|
||||
|
|
@ -12,17 +12,17 @@ namespace MMAP
|
|||
{
|
||||
// ######################## MMapFactory ########################
|
||||
// our global singleton copy
|
||||
MMapManager* g_MMapManager = nullptr;
|
||||
MMapMgr* g_MMapMgr = nullptr;
|
||||
bool MMapFactory::forbiddenMaps[1000] = {0};
|
||||
|
||||
MMapManager* MMapFactory::createOrGetMMapManager()
|
||||
MMapMgr* MMapFactory::createOrGetMMapMgr()
|
||||
{
|
||||
if (g_MMapManager == nullptr)
|
||||
if (g_MMapMgr == nullptr)
|
||||
{
|
||||
g_MMapManager = new MMapManager();
|
||||
g_MMapMgr = new MMapMgr();
|
||||
}
|
||||
|
||||
return g_MMapManager;
|
||||
return g_MMapMgr;
|
||||
}
|
||||
|
||||
void MMapFactory::InitializeDisabledMaps()
|
||||
|
|
@ -38,10 +38,10 @@ namespace MMAP
|
|||
|
||||
void MMapFactory::clear()
|
||||
{
|
||||
if (g_MMapManager)
|
||||
if (g_MMapMgr)
|
||||
{
|
||||
delete g_MMapManager;
|
||||
g_MMapManager = nullptr;
|
||||
delete g_MMapMgr;
|
||||
g_MMapMgr = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "DetourAlloc.h"
|
||||
#include "DetourExtended.h"
|
||||
#include "DetourNavMesh.h"
|
||||
#include "MMapManager.h"
|
||||
#include "MMapMgr.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace MMAP
|
||||
|
|
@ -24,11 +24,11 @@ namespace MMAP
|
|||
|
||||
// static class
|
||||
// holds all mmap global data
|
||||
// access point to MMapManager singleton
|
||||
// access point to MMapMgr singleton
|
||||
class MMapFactory
|
||||
{
|
||||
public:
|
||||
static MMapManager* createOrGetMMapManager();
|
||||
static MMapMgr* createOrGetMMapMgr();
|
||||
static void clear();
|
||||
static void InitializeDisabledMaps();
|
||||
static bool forbiddenMaps[1000];
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "MMapManager.h"
|
||||
#include "MMapMgr.h"
|
||||
#include "Config.h"
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
|
|
@ -16,8 +16,8 @@ namespace MMAP
|
|||
static char const* const MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap";
|
||||
static char const* const TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile";
|
||||
|
||||
// ######################## MMapManager ########################
|
||||
MMapManager::~MMapManager()
|
||||
// ######################## MMapMgr ########################
|
||||
MMapMgr::~MMapMgr()
|
||||
{
|
||||
for (MMapDataSet::iterator i = loadedMMaps.begin(); i != loadedMMaps.end(); ++i)
|
||||
{
|
||||
|
|
@ -28,9 +28,9 @@ namespace MMAP
|
|||
// if we had, tiles in MMapData->mmapLoadedTiles, their actual data is lost!
|
||||
}
|
||||
|
||||
void MMapManager::InitializeThreadUnsafe(const std::vector<uint32>& mapIds)
|
||||
void MMapMgr::InitializeThreadUnsafe(const std::vector<uint32>& mapIds)
|
||||
{
|
||||
// the caller must pass the list of all mapIds that will be used in the VMapManager2 lifetime
|
||||
// the caller must pass the list of all mapIds that will be used in the VMapMgr2 lifetime
|
||||
for (const uint32& mapId : mapIds)
|
||||
{
|
||||
loadedMMaps.emplace(mapId, nullptr);
|
||||
|
|
@ -39,7 +39,7 @@ namespace MMAP
|
|||
thread_safe_environment = false;
|
||||
}
|
||||
|
||||
MMapDataSet::const_iterator MMapManager::GetMMapData(uint32 mapId) const
|
||||
MMapDataSet::const_iterator MMapMgr::GetMMapData(uint32 mapId) const
|
||||
{
|
||||
// return the iterator if found or end() if not found/NULL
|
||||
MMapDataSet::const_iterator itr = loadedMMaps.find(mapId);
|
||||
|
|
@ -51,7 +51,7 @@ namespace MMAP
|
|||
return itr;
|
||||
}
|
||||
|
||||
bool MMapManager::loadMapData(uint32 mapId)
|
||||
bool MMapMgr::loadMapData(uint32 mapId)
|
||||
{
|
||||
// we already have this map loaded?
|
||||
MMapDataSet::iterator itr = loadedMMaps.find(mapId);
|
||||
|
|
@ -70,7 +70,7 @@ namespace MMAP
|
|||
}
|
||||
else
|
||||
{
|
||||
ASSERT(false, "Invalid mapId %u passed to MMapManager after startup in thread unsafe environment", mapId);
|
||||
ASSERT(false, "Invalid mapId %u passed to MMapMgr after startup in thread unsafe environment", mapId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -110,12 +110,12 @@ namespace MMAP
|
|||
return true;
|
||||
}
|
||||
|
||||
uint32 MMapManager::packTileID(int32 x, int32 y)
|
||||
uint32 MMapMgr::packTileID(int32 x, int32 y)
|
||||
{
|
||||
return uint32(x << 16 | y);
|
||||
}
|
||||
|
||||
bool MMapManager::loadMap(uint32 mapId, int32 x, int32 y)
|
||||
bool MMapMgr::loadMap(uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
// make sure the mmap is loaded and ready to load tiles
|
||||
if (!loadMapData(mapId))
|
||||
|
|
@ -191,7 +191,7 @@ namespace MMAP
|
|||
return false;
|
||||
}
|
||||
|
||||
bool MMapManager::unloadMap(uint32 mapId, int32 x, int32 y)
|
||||
bool MMapMgr::unloadMap(uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
// check if we have this map loaded
|
||||
MMapDataSet::const_iterator itr = GetMMapData(mapId);
|
||||
|
|
@ -231,7 +231,7 @@ namespace MMAP
|
|||
return true;
|
||||
}
|
||||
|
||||
bool MMapManager::unloadMap(uint32 mapId)
|
||||
bool MMapMgr::unloadMap(uint32 mapId)
|
||||
{
|
||||
MMapDataSet::iterator itr = loadedMMaps.find(mapId);
|
||||
if (itr == loadedMMaps.end() || !itr->second)
|
||||
|
|
@ -266,7 +266,7 @@ namespace MMAP
|
|||
return true;
|
||||
}
|
||||
|
||||
bool MMapManager::unloadMapInstance(uint32 mapId, uint32 instanceId)
|
||||
bool MMapMgr::unloadMapInstance(uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
// check if we have this map loaded
|
||||
MMapDataSet::const_iterator itr = GetMMapData(mapId);
|
||||
|
|
@ -293,7 +293,7 @@ namespace MMAP
|
|||
return true;
|
||||
}
|
||||
|
||||
dtNavMesh const* MMapManager::GetNavMesh(uint32 mapId)
|
||||
dtNavMesh const* MMapMgr::GetNavMesh(uint32 mapId)
|
||||
{
|
||||
MMapDataSet::const_iterator itr = GetMMapData(mapId);
|
||||
if (itr == loadedMMaps.end())
|
||||
|
|
@ -304,7 +304,7 @@ namespace MMAP
|
|||
return itr->second->navMesh;
|
||||
}
|
||||
|
||||
dtNavMeshQuery const* MMapManager::GetNavMeshQuery(uint32 mapId, uint32 instanceId)
|
||||
dtNavMeshQuery const* MMapMgr::GetNavMeshQuery(uint32 mapId, uint32 instanceId)
|
||||
{
|
||||
MMapDataSet::const_iterator itr = GetMMapData(mapId);
|
||||
if (itr == loadedMMaps.end())
|
||||
|
|
@ -60,11 +60,11 @@ namespace MMAP
|
|||
|
||||
// singleton class
|
||||
// holds all all access to mmap loading unloading and meshes
|
||||
class MMapManager
|
||||
class MMapMgr
|
||||
{
|
||||
public:
|
||||
MMapManager() : loadedTiles(0), thread_safe_environment(true) { }
|
||||
~MMapManager();
|
||||
MMapMgr() : loadedTiles(0), thread_safe_environment(true) { }
|
||||
~MMapMgr();
|
||||
|
||||
void InitializeThreadUnsafe(const std::vector<uint32>& mapIds);
|
||||
bool loadMap(uint32 mapId, int32 x, int32 y);
|
||||
|
|
@ -5,29 +5,29 @@
|
|||
*/
|
||||
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
|
||||
namespace VMAP
|
||||
{
|
||||
VMapManager2* gVMapManager = nullptr;
|
||||
VMapMgr2* gVMapMgr = nullptr;
|
||||
|
||||
//===============================================
|
||||
// just return the instance
|
||||
VMapManager2* VMapFactory::createOrGetVMapManager()
|
||||
VMapMgr2* VMapFactory::createOrGetVMapMgr()
|
||||
{
|
||||
if (!gVMapManager)
|
||||
if (!gVMapMgr)
|
||||
{
|
||||
gVMapManager = new VMapManager2();
|
||||
gVMapMgr = new VMapMgr2();
|
||||
}
|
||||
|
||||
return gVMapManager;
|
||||
return gVMapMgr;
|
||||
}
|
||||
|
||||
//===============================================
|
||||
// delete all internal data structures
|
||||
void VMapFactory::clear()
|
||||
{
|
||||
delete gVMapManager;
|
||||
gVMapManager = nullptr;
|
||||
delete gVMapMgr;
|
||||
gVMapMgr = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@
|
|||
#ifndef _VMAPFACTORY_H
|
||||
#define _VMAPFACTORY_H
|
||||
|
||||
#include "IVMapManager.h"
|
||||
#include "IVMapMgr.h"
|
||||
|
||||
// This is the access point to the VMapManager.
|
||||
// This is the access point to the VMapMgr.
|
||||
namespace VMAP
|
||||
{
|
||||
class VMapManager2;
|
||||
class VMapMgr2;
|
||||
|
||||
class VMapFactory
|
||||
{
|
||||
public:
|
||||
static VMapManager2* createOrGetVMapManager();
|
||||
static VMapMgr2* createOrGetVMapMgr();
|
||||
static void clear();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
#include "MapDefines.h"
|
||||
|
|
@ -32,14 +32,14 @@ using G3D::Vector3;
|
|||
|
||||
namespace VMAP
|
||||
{
|
||||
VMapManager2::VMapManager2()
|
||||
VMapMgr2::VMapMgr2()
|
||||
{
|
||||
GetLiquidFlagsPtr = &GetLiquidFlagsDummy;
|
||||
IsVMAPDisabledForPtr = &IsVMAPDisabledForDummy;
|
||||
thread_safe_environment = true;
|
||||
}
|
||||
|
||||
VMapManager2::~VMapManager2()
|
||||
VMapMgr2::~VMapMgr2()
|
||||
{
|
||||
for (InstanceTreeMap::iterator i = iInstanceMapTrees.begin(); i != iInstanceMapTrees.end(); ++i)
|
||||
{
|
||||
|
|
@ -52,9 +52,9 @@ namespace VMAP
|
|||
}
|
||||
}
|
||||
|
||||
void VMapManager2::InitializeThreadUnsafe(const std::vector<uint32>& mapIds)
|
||||
void VMapMgr2::InitializeThreadUnsafe(const std::vector<uint32>& mapIds)
|
||||
{
|
||||
// the caller must pass the list of all mapIds that will be used in the VMapManager2 lifetime
|
||||
// the caller must pass the list of all mapIds that will be used in the VMapMgr2 lifetime
|
||||
for (const uint32& mapId : mapIds)
|
||||
{
|
||||
iInstanceMapTrees.emplace(mapId, nullptr);
|
||||
|
|
@ -63,7 +63,7 @@ namespace VMAP
|
|||
thread_safe_environment = false;
|
||||
}
|
||||
|
||||
Vector3 VMapManager2::convertPositionToInternalRep(float x, float y, float z) const
|
||||
Vector3 VMapMgr2::convertPositionToInternalRep(float x, float y, float z) const
|
||||
{
|
||||
Vector3 pos;
|
||||
const float mid = 0.5f * MAX_NUMBER_OF_GRIDS * SIZE_OF_GRIDS;
|
||||
|
|
@ -74,7 +74,7 @@ namespace VMAP
|
|||
return pos;
|
||||
}
|
||||
|
||||
InstanceTreeMap::const_iterator VMapManager2::GetMapTree(uint32 mapId) const
|
||||
InstanceTreeMap::const_iterator VMapMgr2::GetMapTree(uint32 mapId) const
|
||||
{
|
||||
// return the iterator if found or end() if not found/NULL
|
||||
InstanceTreeMap::const_iterator itr = iInstanceMapTrees.find(mapId);
|
||||
|
|
@ -87,7 +87,7 @@ namespace VMAP
|
|||
}
|
||||
|
||||
// move to MapTree too?
|
||||
std::string VMapManager2::getMapFileName(unsigned int mapId)
|
||||
std::string VMapMgr2::getMapFileName(unsigned int mapId)
|
||||
{
|
||||
std::stringstream fname;
|
||||
fname.width(3);
|
||||
|
|
@ -96,7 +96,7 @@ namespace VMAP
|
|||
return fname.str();
|
||||
}
|
||||
|
||||
int VMapManager2::loadMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
int VMapMgr2::loadMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
{
|
||||
int result = VMAP_LOAD_RESULT_IGNORED;
|
||||
if (isMapLoadingEnabled())
|
||||
|
|
@ -115,7 +115,7 @@ namespace VMAP
|
|||
}
|
||||
|
||||
// load one tile (internal use only)
|
||||
bool VMapManager2::_loadMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY)
|
||||
bool VMapMgr2::_loadMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY)
|
||||
{
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
if (instanceTree == iInstanceMapTrees.end())
|
||||
|
|
@ -125,7 +125,7 @@ namespace VMAP
|
|||
instanceTree = iInstanceMapTrees.insert(InstanceTreeMap::value_type(mapId, nullptr)).first;
|
||||
}
|
||||
else
|
||||
ASSERT(false, "Invalid mapId %u tile [%u, %u] passed to VMapManager2 after startup in thread unsafe environment",
|
||||
ASSERT(false, "Invalid mapId %u tile [%u, %u] passed to VMapMgr2 after startup in thread unsafe environment",
|
||||
mapId, tileX, tileY);
|
||||
}
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ namespace VMAP
|
|||
return instanceTree->second->LoadMapTile(tileX, tileY, this);
|
||||
}
|
||||
|
||||
void VMapManager2::unloadMap(unsigned int mapId)
|
||||
void VMapMgr2::unloadMap(unsigned int mapId)
|
||||
{
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
if (instanceTree != iInstanceMapTrees.end() && instanceTree->second)
|
||||
|
|
@ -158,7 +158,7 @@ namespace VMAP
|
|||
}
|
||||
}
|
||||
|
||||
void VMapManager2::unloadMap(unsigned int mapId, int x, int y)
|
||||
void VMapMgr2::unloadMap(unsigned int mapId, int x, int y)
|
||||
{
|
||||
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId);
|
||||
if (instanceTree != iInstanceMapTrees.end() && instanceTree->second)
|
||||
|
|
@ -172,7 +172,7 @@ namespace VMAP
|
|||
}
|
||||
}
|
||||
|
||||
bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2)
|
||||
bool VMapMgr2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2)
|
||||
{
|
||||
#if defined(ENABLE_VMAP_CHECKS)
|
||||
if (!isLineOfSightCalcEnabled() || IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LOS))
|
||||
|
|
@ -199,7 +199,7 @@ namespace VMAP
|
|||
get the hit position and return true if we hit something
|
||||
otherwise the result pos will be the dest pos
|
||||
*/
|
||||
bool VMapManager2::GetObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float& ry, float& rz, float modifyDist)
|
||||
bool VMapMgr2::GetObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float& ry, float& rz, float modifyDist)
|
||||
{
|
||||
#if defined(ENABLE_VMAP_CHECKS)
|
||||
if (isLineOfSightCalcEnabled() && !IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LOS))
|
||||
|
|
@ -231,7 +231,7 @@ namespace VMAP
|
|||
get height or INVALID_HEIGHT if no height available
|
||||
*/
|
||||
|
||||
float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist)
|
||||
float VMapMgr2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist)
|
||||
{
|
||||
#if defined(ENABLE_VMAP_CHECKS)
|
||||
if (isHeightCalcEnabled() && !IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_HEIGHT))
|
||||
|
|
@ -254,7 +254,7 @@ namespace VMAP
|
|||
return VMAP_INVALID_HEIGHT_VALUE;
|
||||
}
|
||||
|
||||
bool VMapManager2::GetAreaInfo(uint32 mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const
|
||||
bool VMapMgr2::GetAreaInfo(uint32 mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const
|
||||
{
|
||||
#if defined(ENABLE_VMAP_CHECKS)
|
||||
if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_AREAFLAG))
|
||||
|
|
@ -274,7 +274,7 @@ namespace VMAP
|
|||
return false;
|
||||
}
|
||||
|
||||
bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type, uint32& mogpFlags) const
|
||||
bool VMapMgr2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type, uint32& mogpFlags) const
|
||||
{
|
||||
#if defined(ENABLE_VMAP_CHECKS)
|
||||
if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS))
|
||||
|
|
@ -306,7 +306,7 @@ namespace VMAP
|
|||
return false;
|
||||
}
|
||||
|
||||
void VMapManager2::GetAreaAndLiquidData(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const
|
||||
void VMapMgr2::GetAreaAndLiquidData(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const
|
||||
{
|
||||
if (IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS))
|
||||
{
|
||||
|
|
@ -338,7 +338,7 @@ namespace VMAP
|
|||
}
|
||||
}
|
||||
|
||||
WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename)
|
||||
WorldModel* VMapMgr2::acquireModelInstance(const std::string& basepath, const std::string& filename)
|
||||
{
|
||||
//! Critical section, thread safe access to iLoadedModelFiles
|
||||
std::lock_guard<std::mutex> lock(LoadedModelFilesLock);
|
||||
|
|
@ -349,11 +349,11 @@ namespace VMAP
|
|||
WorldModel* worldmodel = new WorldModel();
|
||||
if (!worldmodel->readFile(basepath + filename + ".vmo"))
|
||||
{
|
||||
LOG_ERROR("maps", "VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str());
|
||||
LOG_ERROR("maps", "VMapMgr2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str());
|
||||
delete worldmodel;
|
||||
return nullptr;
|
||||
}
|
||||
LOG_DEBUG("maps", "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str());
|
||||
LOG_DEBUG("maps", "VMapMgr2: loading file '%s%s'", basepath.c_str(), filename.c_str());
|
||||
model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first;
|
||||
model->second.setModel(worldmodel);
|
||||
}
|
||||
|
|
@ -361,7 +361,7 @@ namespace VMAP
|
|||
return model->second.getModel();
|
||||
}
|
||||
|
||||
void VMapManager2::releaseModelInstance(const std::string& filename)
|
||||
void VMapMgr2::releaseModelInstance(const std::string& filename)
|
||||
{
|
||||
//! Critical section, thread safe access to iLoadedModelFiles
|
||||
std::lock_guard<std::mutex> lock(LoadedModelFilesLock);
|
||||
|
|
@ -369,23 +369,23 @@ namespace VMAP
|
|||
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
|
||||
if (model == iLoadedModelFiles.end())
|
||||
{
|
||||
LOG_ERROR("maps", "VMapManager2: trying to unload non-loaded file '%s'", filename.c_str());
|
||||
LOG_ERROR("maps", "VMapMgr2: trying to unload non-loaded file '%s'", filename.c_str());
|
||||
return;
|
||||
}
|
||||
if (model->second.decRefCount() == 0)
|
||||
{
|
||||
LOG_DEBUG("maps", "VMapManager2: unloading file '%s'", filename.c_str());
|
||||
LOG_DEBUG("maps", "VMapMgr2: unloading file '%s'", filename.c_str());
|
||||
delete model->second.getModel();
|
||||
iLoadedModelFiles.erase(model);
|
||||
}
|
||||
}
|
||||
|
||||
bool VMapManager2::existsMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
bool VMapMgr2::existsMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
{
|
||||
return StaticMapTree::CanLoadMap(std::string(basePath), mapId, x, y);
|
||||
}
|
||||
|
||||
void VMapManager2::GetInstanceMapTree(InstanceTreeMap& instanceMapTree)
|
||||
void VMapMgr2::GetInstanceMapTree(InstanceTreeMap& instanceMapTree)
|
||||
{
|
||||
instanceMapTree = iInstanceMapTrees;
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#define _VMAPMANAGER2_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "IVMapManager.h"
|
||||
#include "IVMapMgr.h"
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
|
@ -60,7 +60,7 @@ namespace VMAP
|
|||
VMAP_DISABLE_LIQUIDSTATUS = 0x8
|
||||
};
|
||||
|
||||
class VMapManager2 : public IVMapManager
|
||||
class VMapMgr2 : public IVMapMgr
|
||||
{
|
||||
protected:
|
||||
// Tree to check collision
|
||||
|
|
@ -84,8 +84,8 @@ namespace VMAP
|
|||
[[nodiscard]] G3D::Vector3 convertPositionToInternalRep(float x, float y, float z) const;
|
||||
static std::string getMapFileName(unsigned int mapId);
|
||||
|
||||
VMapManager2();
|
||||
~VMapManager2() override;
|
||||
VMapMgr2();
|
||||
~VMapMgr2() override;
|
||||
|
||||
void InitializeThreadUnsafe(const std::vector<uint32>& mapIds);
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Log.h"
|
||||
#include "ModelInstance.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
|
@ -244,7 +244,7 @@ namespace VMAP
|
|||
{
|
||||
basePath.push_back('/');
|
||||
}
|
||||
std::string fullname = basePath + VMapManager2::getMapFileName(mapID);
|
||||
std::string fullname = basePath + VMapMgr2::getMapFileName(mapID);
|
||||
bool success = true;
|
||||
FILE* rf = fopen(fullname.c_str(), "rb");
|
||||
if (!rf)
|
||||
|
|
@ -282,7 +282,7 @@ namespace VMAP
|
|||
|
||||
//=========================================================
|
||||
|
||||
bool StaticMapTree::InitMap(const std::string& fname, VMapManager2* vm)
|
||||
bool StaticMapTree::InitMap(const std::string& fname, VMapMgr2* vm)
|
||||
{
|
||||
//VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str());
|
||||
bool success = false;
|
||||
|
|
@ -335,7 +335,7 @@ namespace VMAP
|
|||
|
||||
//=========================================================
|
||||
|
||||
void StaticMapTree::UnloadMap(VMapManager2* vm)
|
||||
void StaticMapTree::UnloadMap(VMapMgr2* vm)
|
||||
{
|
||||
for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i)
|
||||
{
|
||||
|
|
@ -351,7 +351,7 @@ namespace VMAP
|
|||
|
||||
//=========================================================
|
||||
|
||||
bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
|
||||
bool StaticMapTree::LoadMapTile(uint32 tileX, uint32 tileY, VMapMgr2* vm)
|
||||
{
|
||||
if (!iIsTiled)
|
||||
{
|
||||
|
|
@ -446,7 +446,7 @@ namespace VMAP
|
|||
|
||||
//=========================================================
|
||||
|
||||
void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm)
|
||||
void StaticMapTree::UnloadMapTile(uint32 tileX, uint32 tileY, VMapMgr2* vm)
|
||||
{
|
||||
uint32 tileID = packTileID(tileX, tileY);
|
||||
loadedTileMap::iterator tile = iLoadedTiles.find(tileID);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace VMAP
|
|||
{
|
||||
class ModelInstance;
|
||||
class GroupModel;
|
||||
class VMapManager2;
|
||||
class VMapMgr2;
|
||||
|
||||
struct LocationInfo
|
||||
{
|
||||
|
|
@ -63,10 +63,10 @@ namespace VMAP
|
|||
bool GetAreaInfo(G3D::Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const;
|
||||
bool GetLocationInfo(const G3D::Vector3& pos, LocationInfo& info) const;
|
||||
|
||||
bool InitMap(const std::string& fname, VMapManager2* vm);
|
||||
void UnloadMap(VMapManager2* vm);
|
||||
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
|
||||
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
|
||||
bool InitMap(const std::string& fname, VMapMgr2* vm);
|
||||
void UnloadMap(VMapMgr2* vm);
|
||||
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapMgr2* vm);
|
||||
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapMgr2* vm);
|
||||
[[nodiscard]] bool isTiled() const { return iIsTiled; }
|
||||
[[nodiscard]] uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
|
||||
void GetModelInstances(ModelInstance*& models, uint32& count);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "Timer.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
#include "WorldModel.h"
|
||||
|
||||
using G3D::Vector3;
|
||||
|
|
@ -92,7 +92,7 @@ GameObjectModel::~GameObjectModel()
|
|||
{
|
||||
if (iModel)
|
||||
{
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->releaseModelInstance(name);
|
||||
VMAP::VMapFactory::createOrGetVMapMgr()->releaseModelInstance(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ bool GameObjectModel::initialize(std::unique_ptr<GameObjectModelOwnerBase> model
|
|||
return false;
|
||||
}
|
||||
|
||||
iModel = VMAP::VMapFactory::createOrGetVMapManager()->acquireModelInstance(dataPath + "vmaps/", it->second.name);
|
||||
iModel = VMAP::VMapFactory::createOrGetVMapMgr()->acquireModelInstance(dataPath + "vmaps/", it->second.name);
|
||||
|
||||
if (!iModel)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@
|
|||
#include "Dynamic/LinkedList.h"
|
||||
#include "Dynamic/LinkedReference/Reference.h"
|
||||
|
||||
template <class TO, class FROM> class RefManager : public LinkedListHead
|
||||
template <class TO, class FROM> class RefMgr : public LinkedListHead
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< Reference<TO, FROM>> iterator;
|
||||
RefManager() = default;
|
||||
virtual ~RefManager() { clearReferences(); }
|
||||
RefMgr() = default;
|
||||
virtual ~RefMgr() { clearReferences(); }
|
||||
|
||||
Reference<TO, FROM>* getFirst() { return ((Reference<TO, FROM>*) LinkedListHead::getFirst()); }
|
||||
[[nodiscard]] Reference<TO, FROM> const* getFirst() const { return ((Reference<TO, FROM> const*) LinkedListHead::getFirst()); }
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "Define.h"
|
||||
#include "Dynamic/TypeList.h"
|
||||
#include "GridRefManager.h"
|
||||
#include "GridRefMgr.h"
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
|
@ -28,7 +28,7 @@ template<class OBJECT>
|
|||
struct ContainerMapList
|
||||
{
|
||||
//std::map<OBJECT_HANDLE, OBJECT *> _element;
|
||||
GridRefManager<OBJECT> _element;
|
||||
GridRefMgr<OBJECT> _element;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
|||
|
|
@ -35,16 +35,16 @@ typedef WINADVAPI BOOL (WINAPI* CSD_T)(SC_HANDLE, DWORD, LPCVOID);
|
|||
|
||||
bool WinServiceInstall()
|
||||
{
|
||||
SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
|
||||
SC_HANDLE serviceControlMgr = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
|
||||
|
||||
if (serviceControlManager)
|
||||
if (serviceControlMgr)
|
||||
{
|
||||
char path[_MAX_PATH + 10];
|
||||
if (GetModuleFileName( 0, path, sizeof(path) / sizeof(path[0]) ) > 0)
|
||||
{
|
||||
SC_HANDLE service;
|
||||
std::strcat(path, " --service");
|
||||
service = CreateService(serviceControlManager,
|
||||
service = CreateService(serviceControlMgr,
|
||||
serviceName, // name of service
|
||||
serviceLongName, // service name to display
|
||||
SERVICE_ALL_ACCESS, // desired access
|
||||
|
|
@ -64,7 +64,7 @@ bool WinServiceInstall()
|
|||
if (!advapi32)
|
||||
{
|
||||
CloseServiceHandle(service);
|
||||
CloseServiceHandle(serviceControlManager);
|
||||
CloseServiceHandle(serviceControlMgr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ bool WinServiceInstall()
|
|||
if (!ChangeService_Config2)
|
||||
{
|
||||
CloseServiceHandle(service);
|
||||
CloseServiceHandle(serviceControlManager);
|
||||
CloseServiceHandle(serviceControlMgr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -99,18 +99,18 @@ bool WinServiceInstall()
|
|||
CloseServiceHandle(service);
|
||||
}
|
||||
}
|
||||
CloseServiceHandle(serviceControlManager);
|
||||
CloseServiceHandle(serviceControlMgr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WinServiceUninstall()
|
||||
{
|
||||
SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CONNECT);
|
||||
SC_HANDLE serviceControlMgr = OpenSCManager(0, 0, SC_MANAGER_CONNECT);
|
||||
|
||||
if (serviceControlManager)
|
||||
if (serviceControlMgr)
|
||||
{
|
||||
SC_HANDLE service = OpenService(serviceControlManager,
|
||||
SC_HANDLE service = OpenService(serviceControlMgr,
|
||||
serviceName, SERVICE_QUERY_STATUS | DELETE);
|
||||
if (service)
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ bool WinServiceUninstall()
|
|||
CloseServiceHandle(service);
|
||||
}
|
||||
|
||||
CloseServiceHandle(serviceControlManager);
|
||||
CloseServiceHandle(serviceControlMgr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void PetAI::_stopAttack()
|
|||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->CombatStop();
|
||||
me->getHostileRefManager().deleteReferences();
|
||||
me->getHostileRefMgr().deleteReferences();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
|
|||
{
|
||||
if (me->IsInCombat())
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
|
|
@ -113,7 +113,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
|
|||
{
|
||||
if (me->IsInCombat())
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ public:
|
|||
// predicate shall extend Acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatMgr().getThreatList();
|
||||
if (position >= threatlist.size())
|
||||
return nullptr;
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ public:
|
|||
// predicate shall extend Acore::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatMgr().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRange
|
|||
if (Unit* summoner = creature->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
Unit* target = summoner->getAttackerForHelper();
|
||||
if (!target && summoner->CanHaveThreatList() && !summoner->getThreatManager().isThreatListEmpty())
|
||||
target = summoner->getThreatManager().getHostilTarget();
|
||||
if (!target && summoner->CanHaveThreatList() && !summoner->getThreatMgr().isThreatListEmpty())
|
||||
target = summoner->getThreatMgr().getHostilTarget();
|
||||
if (target && (creature->IsFriendlyTo(summoner) || creature->IsHostileTo(target)))
|
||||
creature->AI()->AttackStart(target);
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ bool CreatureAI::UpdateVictim()
|
|||
// xinef: if we have any victim, just return true
|
||||
else if (me->GetVictim() && me->GetExactDist(me->GetVictim()) < 30.0f)
|
||||
return true;
|
||||
else if (me->getThreatManager().isThreatListEmpty())
|
||||
else if (me->getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -327,27 +327,27 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
|
|||
|
||||
void ScriptedAI::DoResetThreat()
|
||||
{
|
||||
if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
|
||||
if (!me->CanHaveThreatList() || me->getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
LOG_ERROR("entities.unit.ai", "DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->getThreatMgr().resetAllAggro();
|
||||
}
|
||||
|
||||
float ScriptedAI::DoGetThreat(Unit* unit)
|
||||
{
|
||||
if (!unit)
|
||||
return 0.0f;
|
||||
return me->getThreatManager().getThreat(unit);
|
||||
return me->getThreatMgr().getThreat(unit);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoModifyThreatPercent(Unit* unit, int32 pct)
|
||||
{
|
||||
if (!unit)
|
||||
return;
|
||||
me->getThreatManager().modifyThreatPercent(unit, pct);
|
||||
me->getThreatMgr().modifyThreatPercent(unit, pct);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o)
|
||||
|
|
@ -536,7 +536,7 @@ void BossAI::TeleportCheaters()
|
|||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatList = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !CheckBoundary(target))
|
||||
|
|
|
|||
|
|
@ -619,12 +619,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (!me)
|
||||
break;
|
||||
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatList = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
{
|
||||
me->getThreatManager().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
me->getThreatMgr().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature %s modify threat for unit %s, value %i",
|
||||
me->GetGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
{
|
||||
if (IsUnit(*itr))
|
||||
{
|
||||
me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
me->getThreatMgr().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature %s modify threat for unit %s, value %i",
|
||||
me->GetGUID().ToString().c_str(), (*itr)->GetGUID().ToString().c_str(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC);
|
||||
}
|
||||
|
|
@ -3662,7 +3662,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
{
|
||||
if (me)
|
||||
{
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatList = me->getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
// Xinef: added distance check
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Transport.h"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// TODO: Add proper implement of achievement
|
||||
|
||||
#include "BattlefieldWG.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "GameGraveyard.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
|
|
@ -946,7 +946,7 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||
{
|
||||
//needed cause else in av some creatures will kill the players at the end
|
||||
player->CombatStop();
|
||||
player->getHostileRefManager().deleteReferences();
|
||||
player->getHostileRefMgr().deleteReferences();
|
||||
}
|
||||
|
||||
// per player calculation
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include "GameGraveyard.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "HostileRefManager.h"
|
||||
#include "HostileRefMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "ThreatManager.h"
|
||||
#include "ThreatMgr.h"
|
||||
#include "Unit.h"
|
||||
|
||||
HostileRefManager::~HostileRefManager()
|
||||
HostileRefMgr::~HostileRefMgr()
|
||||
{
|
||||
deleteReferences();
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ HostileRefManager::~HostileRefManager()
|
|||
// The victim is hated than by them as well
|
||||
// use for buffs and healing threat functionality
|
||||
|
||||
void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell)
|
||||
void HostileRefMgr::threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell)
|
||||
{
|
||||
if (getSize() == 0)
|
||||
return;
|
||||
|
|
@ -39,7 +39,7 @@ void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo c
|
|||
|
||||
//=================================================
|
||||
|
||||
void HostileRefManager::addTempThreat(float threat, bool apply)
|
||||
void HostileRefMgr::addTempThreat(float threat, bool apply)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ void HostileRefManager::addTempThreat(float threat, bool apply)
|
|||
|
||||
//=================================================
|
||||
|
||||
void HostileRefManager::addThreatPercent(int32 percent)
|
||||
void HostileRefMgr::addThreatPercent(int32 percent)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -72,7 +72,7 @@ void HostileRefManager::addThreatPercent(int32 percent)
|
|||
//=================================================
|
||||
// The online / offline status is given to the method. The calculation has to be done before
|
||||
|
||||
void HostileRefManager::setOnlineOfflineState(bool isOnline)
|
||||
void HostileRefMgr::setOnlineOfflineState(bool isOnline)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -85,7 +85,7 @@ void HostileRefManager::setOnlineOfflineState(bool isOnline)
|
|||
//=================================================
|
||||
// The online / offline status is calculated and set
|
||||
|
||||
void HostileRefManager::updateThreatTables()
|
||||
void HostileRefMgr::updateThreatTables()
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -99,7 +99,7 @@ void HostileRefManager::updateThreatTables()
|
|||
// The references are not needed anymore
|
||||
// tell the source to remove them from the list and free the mem
|
||||
|
||||
void HostileRefManager::deleteReferences()
|
||||
void HostileRefMgr::deleteReferences()
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -114,7 +114,7 @@ void HostileRefManager::deleteReferences()
|
|||
//=================================================
|
||||
// delete one reference, defined by faction
|
||||
|
||||
void HostileRefManager::deleteReferencesForFaction(uint32 faction)
|
||||
void HostileRefMgr::deleteReferencesForFaction(uint32 faction)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -132,7 +132,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction)
|
|||
//=================================================
|
||||
// delete one reference, defined by Unit
|
||||
|
||||
void HostileRefManager::deleteReference(Unit* creature)
|
||||
void HostileRefMgr::deleteReference(Unit* creature)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -151,7 +151,7 @@ void HostileRefManager::deleteReference(Unit* creature)
|
|||
//=================================================
|
||||
// delete all references out of specified range
|
||||
|
||||
void HostileRefManager::deleteReferencesOutOfRange(float range)
|
||||
void HostileRefMgr::deleteReferencesOutOfRange(float range)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
range = range * range;
|
||||
|
|
@ -171,7 +171,7 @@ void HostileRefManager::deleteReferencesOutOfRange(float range)
|
|||
//=================================================
|
||||
// set state for one reference, defined by Unit
|
||||
|
||||
void HostileRefManager::setOnlineOfflineState(Unit* creature, bool isOnline)
|
||||
void HostileRefMgr::setOnlineOfflineState(Unit* creature, bool isOnline)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -188,7 +188,7 @@ void HostileRefManager::setOnlineOfflineState(Unit* creature, bool isOnline)
|
|||
|
||||
//=================================================
|
||||
|
||||
void HostileRefManager::UpdateVisibility(bool checkThreat)
|
||||
void HostileRefMgr::UpdateVisibility(bool checkThreat)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
@ -8,22 +8,22 @@
|
|||
#define _HOSTILEREFMANAGER
|
||||
|
||||
#include "Common.h"
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
|
||||
class Unit;
|
||||
class ThreatManager;
|
||||
class ThreatMgr;
|
||||
class HostileReference;
|
||||
class SpellInfo;
|
||||
|
||||
//=================================================
|
||||
|
||||
class HostileRefManager : public RefManager<Unit, ThreatManager>
|
||||
class HostileRefMgr : public RefMgr<Unit, ThreatMgr>
|
||||
{
|
||||
private:
|
||||
Unit* iOwner;
|
||||
public:
|
||||
explicit HostileRefManager(Unit* owner) { iOwner = owner; }
|
||||
~HostileRefManager() override;
|
||||
explicit HostileRefMgr(Unit* owner) { iOwner = owner; }
|
||||
~HostileRefMgr() override;
|
||||
|
||||
Unit* GetOwner() { return iOwner; }
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public:
|
|||
// pussywizard: for combat bugs
|
||||
void deleteReferencesOutOfRange(float range);
|
||||
|
||||
HostileReference* getFirst() { return ((HostileReference*) RefManager<Unit, ThreatManager>::getFirst()); }
|
||||
HostileReference* getFirst() { return ((HostileReference*) RefMgr<Unit, ThreatMgr>::getFirst()); }
|
||||
|
||||
void updateThreatTables();
|
||||
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
#include "SpellAuras.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "ThreatManager.h"
|
||||
#include "ThreatMgr.h"
|
||||
#include "Unit.h"
|
||||
#include "UnitEvents.h"
|
||||
|
||||
|
|
@ -80,11 +80,11 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn
|
|||
//================= HostileReference ==========================
|
||||
//============================================================
|
||||
|
||||
HostileReference::HostileReference(Unit* refUnit, ThreatManager* threatManager, float threat)
|
||||
HostileReference::HostileReference(Unit* refUnit, ThreatMgr* threatMgr, float threat)
|
||||
{
|
||||
iThreat = threat;
|
||||
iTempThreatModifier = 0.0f;
|
||||
link(refUnit, threatManager);
|
||||
link(refUnit, threatMgr);
|
||||
iUnitGuid = refUnit->GetGUID();
|
||||
iOnline = true;
|
||||
}
|
||||
|
|
@ -382,16 +382,16 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
}
|
||||
|
||||
//============================================================
|
||||
//=================== ThreatManager ==========================
|
||||
//=================== ThreatMgr ==========================
|
||||
//============================================================
|
||||
|
||||
ThreatManager::ThreatManager(Unit* owner) : iCurrentVictim(nullptr), iOwner(owner), iUpdateTimer(THREAT_UPDATE_INTERVAL)
|
||||
ThreatMgr::ThreatMgr(Unit* owner) : iCurrentVictim(nullptr), iOwner(owner), iUpdateTimer(THREAT_UPDATE_INTERVAL)
|
||||
{
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::clearReferences()
|
||||
void ThreatMgr::clearReferences()
|
||||
{
|
||||
iThreatContainer.clearReferences();
|
||||
iThreatOfflineContainer.clearReferences();
|
||||
|
|
@ -401,7 +401,7 @@ void ThreatManager::clearReferences()
|
|||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
|
||||
void ThreatMgr::addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
|
||||
{
|
||||
if (!ThreatCalcHelper::isValidProcess(victim, GetOwner(), threatSpell))
|
||||
return;
|
||||
|
|
@ -409,7 +409,7 @@ void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask school
|
|||
doAddThreat(victim, ThreatCalcHelper::calcThreat(victim, iOwner, threat, schoolMask, threatSpell));
|
||||
}
|
||||
|
||||
void ThreatManager::doAddThreat(Unit* victim, float threat)
|
||||
void ThreatMgr::doAddThreat(Unit* victim, float threat)
|
||||
{
|
||||
uint32 redirectThreadPct = victim->GetRedirectThreatPercent();
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ void ThreatManager::doAddThreat(Unit* victim, float threat)
|
|||
_addThreat(victim, threat);
|
||||
}
|
||||
|
||||
void ThreatManager::_addThreat(Unit* victim, float threat)
|
||||
void ThreatMgr::_addThreat(Unit* victim, float threat)
|
||||
{
|
||||
HostileReference* ref = iThreatContainer.addThreat(victim, threat);
|
||||
// Ref is not in the online refs, search the offline refs next
|
||||
|
|
@ -448,14 +448,14 @@ void ThreatManager::_addThreat(Unit* victim, float threat)
|
|||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::modifyThreatPercent(Unit* victim, int32 percent)
|
||||
void ThreatMgr::modifyThreatPercent(Unit* victim, int32 percent)
|
||||
{
|
||||
iThreatContainer.modifyThreatPercent(victim, percent);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
||||
Unit* ThreatManager::getHostilTarget()
|
||||
Unit* ThreatMgr::getHostilTarget()
|
||||
{
|
||||
iThreatContainer.update();
|
||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
||||
|
|
@ -465,7 +465,7 @@ Unit* ThreatManager::getHostilTarget()
|
|||
|
||||
//============================================================
|
||||
|
||||
float ThreatManager::getThreat(Unit* victim, bool alsoSearchOfflineList)
|
||||
float ThreatMgr::getThreat(Unit* victim, bool alsoSearchOfflineList)
|
||||
{
|
||||
float threat = 0.0f;
|
||||
HostileReference* ref = iThreatContainer.getReferenceByTarget(victim);
|
||||
|
|
@ -478,7 +478,7 @@ float ThreatManager::getThreat(Unit* victim, bool alsoSearchOfflineList)
|
|||
|
||||
//============================================================
|
||||
|
||||
float ThreatManager::getThreatWithoutTemp(Unit* victim, bool alsoSearchOfflineList)
|
||||
float ThreatMgr::getThreatWithoutTemp(Unit* victim, bool alsoSearchOfflineList)
|
||||
{
|
||||
float threat = 0.0f;
|
||||
HostileReference* ref = iThreatContainer.getReferenceByTarget(victim);
|
||||
|
|
@ -491,7 +491,7 @@ float ThreatManager::getThreatWithoutTemp(Unit* victim, bool alsoSearchOfflineLi
|
|||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::tauntApply(Unit* taunter)
|
||||
void ThreatMgr::tauntApply(Unit* taunter)
|
||||
{
|
||||
HostileReference* ref = iThreatContainer.getReferenceByTarget(taunter);
|
||||
if (getCurrentVictim() && ref && (ref->getThreat() < getCurrentVictim()->getThreat()))
|
||||
|
|
@ -503,7 +503,7 @@ void ThreatManager::tauntApply(Unit* taunter)
|
|||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::tauntFadeOut(Unit* taunter)
|
||||
void ThreatMgr::tauntFadeOut(Unit* taunter)
|
||||
{
|
||||
HostileReference* ref = iThreatContainer.getReferenceByTarget(taunter);
|
||||
if (ref)
|
||||
|
|
@ -512,7 +512,7 @@ void ThreatManager::tauntFadeOut(Unit* taunter)
|
|||
|
||||
//============================================================
|
||||
|
||||
void ThreatManager::setCurrentVictim(HostileReference* pHostileReference)
|
||||
void ThreatMgr::setCurrentVictim(HostileReference* pHostileReference)
|
||||
{
|
||||
if (pHostileReference && pHostileReference != iCurrentVictim)
|
||||
{
|
||||
|
|
@ -525,9 +525,9 @@ void ThreatManager::setCurrentVictim(HostileReference* pHostileReference)
|
|||
// The hated unit is gone, dead or deleted
|
||||
// return true, if the event is consumed
|
||||
|
||||
void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent)
|
||||
void ThreatMgr::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent)
|
||||
{
|
||||
threatRefStatusChangeEvent->setThreatManager(this); // now we can set the threat manager
|
||||
threatRefStatusChangeEvent->setThreatMgr(this); // now we can set the threat manager
|
||||
|
||||
HostileReference* hostilRef = threatRefStatusChangeEvent->getReference();
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat
|
|||
}
|
||||
}
|
||||
|
||||
bool ThreatManager::isNeedUpdateToClient(uint32 time)
|
||||
bool ThreatMgr::isNeedUpdateToClient(uint32 time)
|
||||
{
|
||||
if (isThreatListEmpty())
|
||||
return false;
|
||||
|
|
@ -591,7 +591,7 @@ bool ThreatManager::isNeedUpdateToClient(uint32 time)
|
|||
}
|
||||
|
||||
// Reset all aggro without modifying the threatlist.
|
||||
void ThreatManager::resetAllAggro()
|
||||
void ThreatMgr::resetAllAggro()
|
||||
{
|
||||
ThreatContainer::StorageType& threatList = iThreatContainer.iThreatList;
|
||||
if (threatList.empty())
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
class Unit;
|
||||
class Creature;
|
||||
class ThreatManager;
|
||||
class ThreatMgr;
|
||||
class SpellInfo;
|
||||
|
||||
#define THREAT_UPDATE_INTERVAL 2 * IN_MILLISECONDS // Server should send threat update to client periodically each second
|
||||
|
|
@ -32,10 +32,10 @@ struct ThreatCalcHelper
|
|||
};
|
||||
|
||||
//==============================================================
|
||||
class HostileReference : public Reference<Unit, ThreatManager>
|
||||
class HostileReference : public Reference<Unit, ThreatMgr>
|
||||
{
|
||||
public:
|
||||
HostileReference(Unit* refUnit, ThreatManager* threatManager, float threat);
|
||||
HostileReference(Unit* refUnit, ThreatMgr* threatMgr, float threat);
|
||||
|
||||
//=================================================
|
||||
void addThreat(float modThreat);
|
||||
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
//=================================================
|
||||
|
||||
HostileReference* next() { return ((HostileReference*) Reference<Unit, ThreatManager>::next()); }
|
||||
HostileReference* next() { return ((HostileReference*) Reference<Unit, ThreatMgr>::next()); }
|
||||
|
||||
//=================================================
|
||||
|
||||
|
|
@ -118,11 +118,11 @@ private:
|
|||
};
|
||||
|
||||
//==============================================================
|
||||
class ThreatManager;
|
||||
class ThreatMgr;
|
||||
|
||||
class ThreatContainer
|
||||
{
|
||||
friend class ThreatManager;
|
||||
friend class ThreatMgr;
|
||||
|
||||
public:
|
||||
typedef std::list<HostileReference*> StorageType;
|
||||
|
|
@ -177,14 +177,14 @@ private:
|
|||
|
||||
//=================================================
|
||||
|
||||
class ThreatManager
|
||||
class ThreatMgr
|
||||
{
|
||||
public:
|
||||
friend class HostileReference;
|
||||
|
||||
explicit ThreatManager(Unit* owner);
|
||||
explicit ThreatMgr(Unit* owner);
|
||||
|
||||
~ThreatManager() { clearReferences(); }
|
||||
~ThreatMgr() { clearReferences(); }
|
||||
|
||||
void clearReferences();
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#include "Common.h"
|
||||
|
||||
class ThreatContainer;
|
||||
class ThreatManager;
|
||||
class ThreatMgr;
|
||||
class HostileReference;
|
||||
|
||||
//==============================================================
|
||||
|
|
@ -79,15 +79,15 @@ private:
|
|||
int32 iIValue;
|
||||
bool iBValue;
|
||||
};
|
||||
ThreatManager* iThreatManager;
|
||||
ThreatMgr* iThreatMgr;
|
||||
public:
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = nullptr; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatMgr(nullptr) { iHostileReference = nullptr; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatMgr(nullptr) { iHostileReference = pHostileReference; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; iFValue = pValue; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatMgr(nullptr) { iHostileReference = pHostileReference; iFValue = pValue; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; iBValue = pValue; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatMgr(nullptr) { iHostileReference = pHostileReference; iBValue = pValue; }
|
||||
|
||||
[[nodiscard]] int32 getIValue() const { return iIValue; }
|
||||
|
||||
|
|
@ -99,20 +99,20 @@ public:
|
|||
|
||||
[[nodiscard]] HostileReference* getReference() const { return iHostileReference; }
|
||||
|
||||
void setThreatManager(ThreatManager* pThreatManager) { iThreatManager = pThreatManager; }
|
||||
void setThreatMgr(ThreatMgr* pThreatMgr) { iThreatMgr = pThreatMgr; }
|
||||
|
||||
[[nodiscard]] ThreatManager* getThreatManager() const { return iThreatManager; }
|
||||
[[nodiscard]] ThreatMgr* getThreatMgr() const { return iThreatMgr; }
|
||||
};
|
||||
|
||||
//==============================================================
|
||||
|
||||
class ThreatManagerEvent : public ThreatRefStatusChangeEvent
|
||||
class ThreatMgrEvent : public ThreatRefStatusChangeEvent
|
||||
{
|
||||
private:
|
||||
ThreatContainer* iThreatContainer;
|
||||
public:
|
||||
ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(nullptr) {}
|
||||
ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(nullptr) {}
|
||||
ThreatMgrEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(nullptr) {}
|
||||
ThreatMgrEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(nullptr) {}
|
||||
|
||||
void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "Define.h"
|
||||
#include "Map.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
|
||||
class Unit;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "DynamicVisibility.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MovementPacketBuilder.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
@ -2996,7 +2996,7 @@ struct WorldObjectChangeAccumulator
|
|||
}
|
||||
}
|
||||
|
||||
template<class SKIP> void Visit(GridRefManager<SKIP>&) {}
|
||||
template<class SKIP> void Visit(GridRefMgr<SKIP>&) {}
|
||||
};
|
||||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
|
|
|
|||
|
|
@ -708,7 +708,7 @@ class GridObject
|
|||
{
|
||||
public:
|
||||
[[nodiscard]] bool IsInGrid() const { return _gridRef.isValid(); }
|
||||
void AddToGrid(GridRefManager<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
|
||||
void AddToGrid(GridRefMgr<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
|
||||
void RemoveFromGrid() { ASSERT(IsInGrid()); _gridRef.unlink(); }
|
||||
private:
|
||||
GridReference<T> _gridRef;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
#include "Log.h"
|
||||
#include "LootItemStorage.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -1282,7 +1282,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||
// for except kick by antispeedhack
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(this, true);
|
||||
|
||||
if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
|
||||
if (!MapMgr::IsValidMapCoord(mapid, x, y, z, orientation))
|
||||
{
|
||||
LOG_ERROR("entities.player", "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (%s, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
|
||||
mapid, x, y, z, orientation, GetGUID().ToString().c_str(), GetName().c_str(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
|
|
@ -2097,7 +2097,7 @@ void Player::SetInWater(bool apply)
|
|||
// remove auras that need water/land
|
||||
RemoveAurasWithInterruptFlags(apply ? AURA_INTERRUPT_FLAG_NOT_ABOVEWATER : AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
|
||||
|
||||
getHostileRefManager().updateThreatTables();
|
||||
getHostileRefMgr().updateThreatTables();
|
||||
}
|
||||
|
||||
bool Player::IsInAreaTriggerRadius(const AreaTrigger* trigger) const
|
||||
|
|
@ -2138,13 +2138,13 @@ void Player::SetGameMaster(bool on)
|
|||
{
|
||||
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
|
||||
pet->setFaction(35);
|
||||
pet->getHostileRefManager().setOnlineOfflineState(false);
|
||||
pet->getHostileRefMgr().setOnlineOfflineState(false);
|
||||
}
|
||||
|
||||
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
|
||||
ResetContestedPvP();
|
||||
|
||||
getHostileRefManager().setOnlineOfflineState(false);
|
||||
getHostileRefMgr().setOnlineOfflineState(false);
|
||||
CombatStopWithPets();
|
||||
|
||||
SetPhaseMask(uint32(PHASEMASK_ANYWHERE), false); // see and visible in all phases
|
||||
|
|
@ -2168,7 +2168,7 @@ void Player::SetGameMaster(bool on)
|
|||
if (Pet* pet = GetPet())
|
||||
{
|
||||
pet->setFaction(getFaction());
|
||||
pet->getHostileRefManager().setOnlineOfflineState(true);
|
||||
pet->getHostileRefMgr().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
// restore FFA PvP Server state
|
||||
|
|
@ -2178,7 +2178,7 @@ void Player::SetGameMaster(bool on)
|
|||
// restore FFA PvP area state, remove not allowed for GM mounts
|
||||
UpdateArea(m_areaUpdateId);
|
||||
|
||||
getHostileRefManager().setOnlineOfflineState(true);
|
||||
getHostileRefMgr().setOnlineOfflineState(true);
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, SEC_PLAYER);
|
||||
}
|
||||
|
||||
|
|
@ -9649,7 +9649,7 @@ void Player::CleanupAfterTaxiFlight()
|
|||
m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||
Dismount();
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
getHostileRefManager().setOnlineOfflineState(true);
|
||||
getHostileRefMgr().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
void Player::ContinueTaxiFlight()
|
||||
|
|
@ -13674,7 +13674,7 @@ void Player::ResetMap()
|
|||
// this may be called during Map::Update
|
||||
// after decrement+unlink, ++m_mapRefIter will continue correctly
|
||||
// when the first element of the list is being removed
|
||||
// nocheck_prev will return the padding element of the RefManager
|
||||
// nocheck_prev will return the padding element of the RefMgr
|
||||
// instead of nullptr in the case of prev
|
||||
GetMap()->UpdateIteratorBack(this);
|
||||
Unit::ResetMap();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "DisableMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Group.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "ReputationMgr.h"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "LootItemStorage.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -7032,7 +7032,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
|
|||
MapEntry const* bindMapEntry = sMapStore.LookupEntry(m_homebindMapId);
|
||||
|
||||
// accept saved data only for valid position (and non instanceable), and accessable
|
||||
if (MapManager::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ) &&
|
||||
if (MapMgr::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ) &&
|
||||
!bindMapEntry->Instanceable() && GetSession()->Expansion() >= bindMapEntry->Expansion())
|
||||
ok = true;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ void Player::Update(uint32 p_time)
|
|||
{
|
||||
m_hostileReferenceCheckTimer = 15000;
|
||||
if (!GetMap()->IsDungeon())
|
||||
getHostileRefManager().deleteReferencesOutOfRange(
|
||||
getHostileRefMgr().deleteReferencesOutOfRange(
|
||||
GetVisibilityRange());
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "Common.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MapReference.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
@ -184,11 +184,11 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
|
|||
m_removedAurasCount(0),
|
||||
i_motionMaster(new MotionMaster(this)),
|
||||
m_regenTimer(0),
|
||||
m_ThreatManager(this),
|
||||
m_ThreatMgr(this),
|
||||
m_vehicle(nullptr),
|
||||
m_vehicleKit(nullptr),
|
||||
m_unitTypeMask(UNIT_MASK_NONE),
|
||||
m_HostileRefManager(this),
|
||||
m_HostileRefMgr(this),
|
||||
m_comboTarget(nullptr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
|
@ -400,7 +400,7 @@ void Unit::Update(uint32 p_time)
|
|||
|
||||
_UpdateSpells( p_time );
|
||||
|
||||
if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time))
|
||||
if (CanHaveThreatList() && getThreatMgr().isNeedUpdateToClient(p_time))
|
||||
SendThreatListUpdate();
|
||||
|
||||
// update combat timer only for players and pets (only pets with PetAI)
|
||||
|
|
@ -409,7 +409,7 @@ void Unit::Update(uint32 p_time)
|
|||
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
|
||||
// targets without stopping half way there and running off.
|
||||
// These flags are reset after target dies or another command is given.
|
||||
if (m_HostileRefManager.isEmpty())
|
||||
if (m_HostileRefMgr.isEmpty())
|
||||
{
|
||||
// m_CombatTimer set at aura start and it will be freeze until aura removing
|
||||
if (m_CombatTimer <= p_time)
|
||||
|
|
@ -8671,7 +8671,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||
return false;
|
||||
|
||||
if (victim && victim->IsAlive())
|
||||
victim->getThreatManager().modifyThreatPercent(this, -10);
|
||||
victim->getThreatMgr().modifyThreatPercent(this, -10);
|
||||
|
||||
basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
|
||||
trigger_spell_id = 31616;
|
||||
|
|
@ -10549,7 +10549,7 @@ void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers p
|
|||
if (powerType != POWER_HAPPINESS)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
|
||||
victim->getHostileRefManager().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13577,7 +13577,7 @@ void Unit::setDeathState(DeathState s, bool despawn)
|
|||
{
|
||||
CombatStop();
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
ClearComboPointHolders(); // any combo points pointed to unit lost at it death
|
||||
|
||||
if (IsNonMeleeSpellCast(false))
|
||||
|
|
@ -13674,7 +13674,7 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
|
|||
// Only mobs can manage threat lists
|
||||
if (CanHaveThreatList() && !HasUnitState(UNIT_STATE_EVADE))
|
||||
{
|
||||
m_ThreatManager.addThreat(victim, fThreat, schoolMask, threatSpell);
|
||||
m_ThreatMgr.addThreat(victim, fThreat, schoolMask, threatSpell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13682,9 +13682,9 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
|
|||
|
||||
void Unit::DeleteThreatList()
|
||||
{
|
||||
if (CanHaveThreatList() && !m_ThreatManager.isThreatListEmpty())
|
||||
if (CanHaveThreatList() && !m_ThreatMgr.isThreatListEmpty())
|
||||
SendClearThreatListOpcode();
|
||||
m_ThreatManager.clearReferences();
|
||||
m_ThreatMgr.clearReferences();
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
|
@ -13712,7 +13712,7 @@ void Unit::TauntApply(Unit* taunter)
|
|||
if (creature->IsAIEnabled)
|
||||
creature->AI()->AttackStart(taunter);
|
||||
|
||||
//m_ThreatManager.tauntApply(taunter);
|
||||
//m_ThreatMgr.tauntApply(taunter);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
|
@ -13736,7 +13736,7 @@ void Unit::TauntFadeOut(Unit* taunter)
|
|||
if (!target || target != taunter)
|
||||
return;
|
||||
|
||||
if (m_ThreatManager.isThreatListEmpty())
|
||||
if (m_ThreatMgr.isThreatListEmpty())
|
||||
{
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->EnterEvadeMode();
|
||||
|
|
@ -13776,8 +13776,8 @@ Unit* Creature::SelectVictim()
|
|||
|
||||
if (CanHaveThreatList())
|
||||
{
|
||||
if (!target && !m_ThreatManager.isThreatListEmpty())
|
||||
target = m_ThreatManager.getHostilTarget();
|
||||
if (!target && !m_ThreatMgr.isThreatListEmpty())
|
||||
target = m_ThreatMgr.getHostilTarget();
|
||||
}
|
||||
else if (!HasReactState(REACT_PASSIVE))
|
||||
{
|
||||
|
|
@ -14740,7 +14740,7 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
|||
CombatStop();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
}
|
||||
|
||||
|
|
@ -16882,7 +16882,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||
|
||||
// Stop attacks
|
||||
victim->CombatStop();
|
||||
victim->getHostileRefManager().deleteReferences();
|
||||
victim->getHostileRefMgr().deleteReferences();
|
||||
|
||||
// restore for use at real death
|
||||
victim->SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
|
|
@ -17537,7 +17537,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
|||
_charmThreatInfo.clear();
|
||||
|
||||
// Xinef: move invalid threat / hostile references to offline lists
|
||||
ThreatContainer::StorageType threatList = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatList = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
_charmThreatInfo[target->GetGUID()] = (*itr)->getThreat() - (*itr)->getTempThreatModifier();
|
||||
|
|
@ -17588,7 +17588,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
|||
CastStop();
|
||||
|
||||
CombatStop();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
DeleteThreatList();
|
||||
|
||||
// xinef: update speed after charming
|
||||
|
|
@ -18066,14 +18066,14 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
|||
// modify hostile references for new phasemask, some special cases deal with hostile references themselves
|
||||
if (GetTypeId() == TYPEID_UNIT || (!ToPlayer()->IsGameMaster() && !ToPlayer()->GetSession()->PlayerLogout()))
|
||||
{
|
||||
HostileRefManager& refManager = getHostileRefManager();
|
||||
HostileReference* ref = refManager.getFirst();
|
||||
HostileRefMgr& refMgr = getHostileRefMgr();
|
||||
HostileReference* ref = refMgr.getFirst();
|
||||
|
||||
while (ref)
|
||||
{
|
||||
if (Unit* unit = ref->GetSource()->GetOwner())
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
refManager.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask));
|
||||
refMgr.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask));
|
||||
|
||||
ref = ref->next();
|
||||
}
|
||||
|
|
@ -18081,8 +18081,8 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
|||
// modify threat lists for new phasemask
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
ThreatContainer::StorageType threatList = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType offlineThreatList = getThreatManager().getOfflineThreatList();
|
||||
ThreatContainer::StorageType threatList = getThreatMgr().getThreatList();
|
||||
ThreatContainer::StorageType offlineThreatList = getThreatMgr().getOfflineThreatList();
|
||||
|
||||
// merge expects sorted lists
|
||||
threatList.sort();
|
||||
|
|
@ -18091,7 +18091,7 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
|||
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* unit = (*itr)->getTarget())
|
||||
unit->getHostileRefManager().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask));
|
||||
unit->getHostileRefMgr().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19021,15 +19021,15 @@ void Unit::UpdateHeight(float newZ)
|
|||
|
||||
void Unit::SendThreatListUpdate()
|
||||
{
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
if (!getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
uint32 count = getThreatMgr().getThreatList().size();
|
||||
|
||||
//LOG_DEBUG("entities.unit", "WORLD: Send SMSG_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data << uint32(count);
|
||||
ThreatContainer::StorageType const& tlist = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& tlist = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
|
|
@ -19041,16 +19041,16 @@ void Unit::SendThreatListUpdate()
|
|||
|
||||
void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
{
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
if (!getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
uint32 count = getThreatMgr().getThreatList().size();
|
||||
|
||||
LOG_DEBUG("entities.unit", "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data << pHostileReference->getUnitGuid().WriteAsPacked();
|
||||
data << uint32(count);
|
||||
ThreatContainer::StorageType const& tlist = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& tlist = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
|
|
@ -19136,7 +19136,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
|||
++itr;
|
||||
}
|
||||
|
||||
getHostileRefManager().deleteReferencesForFaction(faction_id);
|
||||
getHostileRefMgr().deleteReferencesForFaction(faction_id);
|
||||
|
||||
for (ControlSet::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
(*itr)->StopAttackFaction(faction_id);
|
||||
|
|
@ -19941,7 +19941,7 @@ bool Unit::IsInCombatWith(Unit const* who) const
|
|||
return false;
|
||||
// Search in threat list
|
||||
ObjectGuid guid = who->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = m_ThreatManager.getThreatList().begin(); i != m_ThreatManager.getThreatList().end(); ++i)
|
||||
for (ThreatContainer::StorageType::const_iterator i = m_ThreatMgr.getThreatList().begin(); i != m_ThreatMgr.getThreatList().end(); ++i)
|
||||
{
|
||||
HostileReference* ref = (*i);
|
||||
// Return true if the unit matches
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@
|
|||
|
||||
#include "EventProcessor.h"
|
||||
#include "FollowerReference.h"
|
||||
#include "FollowerRefManager.h"
|
||||
#include "HostileRefManager.h"
|
||||
#include "FollowerRefMgr.h"
|
||||
#include "HostileRefMgr.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Object.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "ThreatManager.h"
|
||||
#include "ThreatMgr.h"
|
||||
#include <functional>
|
||||
|
||||
#define WORLD_TRIGGER 12999
|
||||
|
|
@ -2203,10 +2203,10 @@ public:
|
|||
void DeleteThreatList();
|
||||
void TauntApply(Unit* victim);
|
||||
void TauntFadeOut(Unit* taunter);
|
||||
ThreatManager& getThreatManager() { return m_ThreatManager; }
|
||||
void addHatedBy(HostileReference* pHostileReference) { m_HostileRefManager.insertFirst(pHostileReference); };
|
||||
ThreatMgr& getThreatMgr() { return m_ThreatMgr; }
|
||||
void addHatedBy(HostileReference* pHostileReference) { m_HostileRefMgr.insertFirst(pHostileReference); };
|
||||
void removeHatedBy(HostileReference* /*pHostileReference*/) { /* nothing to do yet */ }
|
||||
HostileRefManager& getHostileRefManager() { return m_HostileRefManager; }
|
||||
HostileRefMgr& getHostileRefMgr() { return m_HostileRefMgr; }
|
||||
|
||||
VisibleAuraMap const* GetVisibleAuras() { return &m_visibleAuras; }
|
||||
AuraApplication* GetVisibleAura(uint8 slot)
|
||||
|
|
@ -2312,7 +2312,7 @@ public:
|
|||
void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = nullptr);
|
||||
float CalculateLevelPenalty(SpellInfo const* spellProto) const;
|
||||
|
||||
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
|
||||
void addFollower(FollowerReference* pRef) { m_FollowingRefMgr.insertFirst(pRef); }
|
||||
void removeFollower(FollowerReference* /*pRef*/) { /* nothing to do yet */ }
|
||||
|
||||
MotionMaster* GetMotionMaster() { return i_motionMaster; }
|
||||
|
|
@ -2554,7 +2554,7 @@ protected:
|
|||
uint32 m_reactiveTimer[MAX_REACTIVE];
|
||||
int32 m_regenTimer;
|
||||
|
||||
ThreatManager m_ThreatManager;
|
||||
ThreatMgr m_ThreatMgr;
|
||||
typedef std::map<ObjectGuid, float> CharmThreatMap;
|
||||
CharmThreatMap _charmThreatInfo;
|
||||
|
||||
|
|
@ -2600,9 +2600,9 @@ private:
|
|||
|
||||
Diminishing m_Diminishing;
|
||||
// Manage all Units that are threatened by us
|
||||
HostileRefManager m_HostileRefManager;
|
||||
HostileRefMgr m_HostileRefMgr;
|
||||
|
||||
FollowerRefManager m_FollowingRefManager;
|
||||
FollowerRefMgr m_FollowingRefMgr;
|
||||
Unit* m_comboTarget;
|
||||
|
||||
ComboPointHolderSet m_ComboPointHolders;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "GossipDef.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "Language.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "PoolMgr.h"
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include "UpdateMask.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WaypointMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
ScriptMapMap sSpellScripts;
|
||||
|
|
@ -2242,7 +2242,7 @@ void ObjectMgr::LoadGameobjects()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
|
||||
if (!MapMgr::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
|
||||
continue;
|
||||
|
|
@ -3383,7 +3383,7 @@ void ObjectMgr::LoadPlayerInfo()
|
|||
}
|
||||
|
||||
// accept DB data only for valid position (and non instanceable)
|
||||
if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation))
|
||||
if (!MapMgr::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
|
||||
continue;
|
||||
|
|
@ -5440,7 +5440,7 @@ void ObjectMgr::LoadInstanceTemplate()
|
|||
|
||||
uint16 mapID = fields[0].GetUInt16();
|
||||
|
||||
if (!MapManager::IsValidMAP(mapID, true))
|
||||
if (!MapMgr::IsValidMAP(mapID, true))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
|
||||
continue;
|
||||
|
|
@ -8079,7 +8079,7 @@ void ObjectMgr::LoadGameTele()
|
|||
gt.mapId = fields[5].GetUInt16();
|
||||
gt.name = fields[6].GetString();
|
||||
|
||||
if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation))
|
||||
if (!MapMgr::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str());
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ typedef TYPELIST_5(GameObject, Player, Creature/*pets*/, Corpse/*resurrectable*/
|
|||
typedef TYPELIST_4(GameObject, Creature/*except pets*/, DynamicObject, Corpse/*Bones*/) AllGridObjectTypes;
|
||||
typedef TYPELIST_5(Creature, GameObject, DynamicObject, Pet, Corpse) AllMapStoredObjectTypes;
|
||||
|
||||
typedef GridRefManager<Corpse> CorpseMapType;
|
||||
typedef GridRefManager<Creature> CreatureMapType;
|
||||
typedef GridRefManager<DynamicObject> DynamicObjectMapType;
|
||||
typedef GridRefManager<GameObject> GameObjectMapType;
|
||||
typedef GridRefManager<Player> PlayerMapType;
|
||||
typedef GridRefMgr<Corpse> CorpseMapType;
|
||||
typedef GridRefMgr<Creature> CreatureMapType;
|
||||
typedef GridRefMgr<DynamicObject> DynamicObjectMapType;
|
||||
typedef GridRefMgr<GameObject> GameObjectMapType;
|
||||
typedef GridRefMgr<Player> PlayerMapType;
|
||||
|
||||
enum GridMapTypeMask
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,19 +7,19 @@
|
|||
#ifndef _GRIDREFMANAGER
|
||||
#define _GRIDREFMANAGER
|
||||
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
|
||||
template<class OBJECT>
|
||||
class GridReference;
|
||||
|
||||
template<class OBJECT>
|
||||
class GridRefManager : public RefManager<GridRefManager<OBJECT>, OBJECT>
|
||||
class GridRefMgr : public RefMgr<GridRefMgr<OBJECT>, OBJECT>
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< GridReference<OBJECT> > iterator;
|
||||
|
||||
GridReference<OBJECT>* getFirst() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getFirst(); }
|
||||
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getLast(); }
|
||||
GridReference<OBJECT>* getFirst() { return (GridReference<OBJECT>*)RefMgr<GridRefMgr<OBJECT>, OBJECT>::getFirst(); }
|
||||
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefMgr<GridRefMgr<OBJECT>, OBJECT>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
|
|
@ -10,10 +10,10 @@
|
|||
#include "LinkedReference/Reference.h"
|
||||
|
||||
template<class OBJECT>
|
||||
class GridRefManager;
|
||||
class GridRefMgr;
|
||||
|
||||
template<class OBJECT>
|
||||
class GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
|
||||
class GridReference : public Reference<GridRefMgr<OBJECT>, OBJECT>
|
||||
{
|
||||
protected:
|
||||
void targetObjectBuildLink() override
|
||||
|
|
@ -33,8 +33,8 @@ protected:
|
|||
this->getTarget()->decSize();
|
||||
}
|
||||
public:
|
||||
GridReference() : Reference<GridRefManager<OBJECT>, OBJECT>() {}
|
||||
GridReference() : Reference<GridRefMgr<OBJECT>, OBJECT>() {}
|
||||
~GridReference() override { this->unlink(); }
|
||||
GridReference* next() { return (GridReference*)Reference<GridRefManager<OBJECT>, OBJECT>::next(); }
|
||||
GridReference* next() { return (GridReference*)Reference<GridRefMgr<OBJECT>, OBJECT>::next(); }
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public:
|
|||
[[nodiscard]] int32 getX() const { return i_x; }
|
||||
[[nodiscard]] int32 getY() const { return i_y; }
|
||||
|
||||
void link(GridRefManager<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> >* pTo)
|
||||
void link(GridRefMgr<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> >* pTo)
|
||||
{
|
||||
i_Reference.link(pTo, this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,10 +327,10 @@ void MessageDistDelivererToHostile::Visit(DynamicObjectMapType& m)
|
|||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectUpdater::Visit(GridRefManager<T>& m)
|
||||
void ObjectUpdater::Visit(GridRefMgr<T>& m)
|
||||
{
|
||||
T* obj;
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); )
|
||||
for (typename GridRefMgr<T>::iterator iter = m.begin(); iter != m.end(); )
|
||||
{
|
||||
obj = iter->GetSource();
|
||||
++iter;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Acore
|
|||
}
|
||||
|
||||
void Visit(GameObjectMapType&);
|
||||
template<class T> void Visit(GridRefManager<T>& m);
|
||||
template<class T> void Visit(GridRefMgr<T>& m);
|
||||
void SendToSelf(void);
|
||||
};
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ namespace Acore
|
|||
WorldObject& i_object;
|
||||
|
||||
explicit VisibleChangesNotifier(WorldObject& object) : i_object(object) {}
|
||||
template<class T> void Visit(GridRefManager<T>&) {}
|
||||
template<class T> void Visit(GridRefMgr<T>&) {}
|
||||
void Visit(PlayerMapType&);
|
||||
void Visit(CreatureMapType&);
|
||||
void Visit(DynamicObjectMapType&);
|
||||
|
|
@ -61,7 +61,7 @@ namespace Acore
|
|||
{
|
||||
PlayerRelocationNotifier(Player& player, bool largeOnly): VisibleNotifier(player, false, largeOnly) { }
|
||||
|
||||
template<class T> void Visit(GridRefManager<T>& m) { VisibleNotifier::Visit(m); }
|
||||
template<class T> void Visit(GridRefMgr<T>& m) { VisibleNotifier::Visit(m); }
|
||||
void Visit(PlayerMapType&);
|
||||
};
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ namespace Acore
|
|||
{
|
||||
Creature& i_creature;
|
||||
CreatureRelocationNotifier(Creature& c) : i_creature(c) {}
|
||||
template<class T> void Visit(GridRefManager<T>&) {}
|
||||
template<class T> void Visit(GridRefMgr<T>&) {}
|
||||
void Visit(PlayerMapType&);
|
||||
};
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ namespace Acore
|
|||
Unit& i_unit;
|
||||
bool isCreature;
|
||||
explicit AIRelocationNotifier(Unit& unit) : i_unit(unit), isCreature(unit.GetTypeId() == TYPEID_UNIT) {}
|
||||
template<class T> void Visit(GridRefManager<T>&) {}
|
||||
template<class T> void Visit(GridRefMgr<T>&) {}
|
||||
void Visit(CreatureMapType&);
|
||||
};
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ namespace Acore
|
|||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
template<class SKIP> void Visit(GridRefManager<SKIP>&) {}
|
||||
template<class SKIP> void Visit(GridRefMgr<SKIP>&) {}
|
||||
|
||||
void SendPacket(Player* player)
|
||||
{
|
||||
|
|
@ -127,7 +127,7 @@ namespace Acore
|
|||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
template<class SKIP> void Visit(GridRefManager<SKIP>&) {}
|
||||
template<class SKIP> void Visit(GridRefMgr<SKIP>&) {}
|
||||
|
||||
void SendPacket(Player* player)
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ namespace Acore
|
|||
uint32 i_timeDiff;
|
||||
bool i_largeOnly;
|
||||
explicit ObjectUpdater(const uint32 diff, bool largeOnly) : i_timeDiff(diff), i_largeOnly(largeOnly) {}
|
||||
template<class T> void Visit(GridRefManager<T>& m);
|
||||
template<class T> void Visit(GridRefMgr<T>& m);
|
||||
void Visit(PlayerMapType&) {}
|
||||
void Visit(CorpseMapType&) {}
|
||||
};
|
||||
|
|
@ -170,7 +170,7 @@ namespace Acore
|
|||
void Visit(CorpseMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -190,7 +190,7 @@ namespace Acore
|
|||
void Visit(CorpseMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -210,7 +210,7 @@ namespace Acore
|
|||
void Visit(GameObjectMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Do>
|
||||
|
|
@ -267,7 +267,7 @@ namespace Acore
|
|||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Gameobject searchers
|
||||
|
|
@ -284,7 +284,7 @@ namespace Acore
|
|||
|
||||
void Visit(GameObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Last accepted by Check GO if any (Check can change requirements at each call)
|
||||
|
|
@ -300,7 +300,7 @@ namespace Acore
|
|||
|
||||
void Visit(GameObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -315,7 +315,7 @@ namespace Acore
|
|||
|
||||
void Visit(GameObjectMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Functor>
|
||||
|
|
@ -331,7 +331,7 @@ namespace Acore
|
|||
_func(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
|
||||
private:
|
||||
Functor& _func;
|
||||
|
|
@ -354,7 +354,7 @@ namespace Acore
|
|||
void Visit(CreatureMapType& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Last accepted by Check Unit if any (Check can change requirements at each call)
|
||||
|
|
@ -371,7 +371,7 @@ namespace Acore
|
|||
void Visit(CreatureMapType& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// All accepted by Check units if any
|
||||
|
|
@ -388,7 +388,7 @@ namespace Acore
|
|||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Creature searchers
|
||||
|
|
@ -405,7 +405,7 @@ namespace Acore
|
|||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Last accepted by Check Creature if any (Check can change requirements at each call)
|
||||
|
|
@ -421,7 +421,7 @@ namespace Acore
|
|||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -436,7 +436,7 @@ namespace Acore
|
|||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Do>
|
||||
|
|
@ -455,7 +455,7 @@ namespace Acore
|
|||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// Player searchers
|
||||
|
|
@ -472,7 +472,7 @@ namespace Acore
|
|||
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -487,7 +487,7 @@ namespace Acore
|
|||
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -503,7 +503,7 @@ namespace Acore
|
|||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Check>
|
||||
|
|
@ -519,7 +519,7 @@ namespace Acore
|
|||
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Do>
|
||||
|
|
@ -538,7 +538,7 @@ namespace Acore
|
|||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
template<class Do>
|
||||
|
|
@ -558,7 +558,7 @@ namespace Acore
|
|||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefMgr<NOT_INTERESTED>&) {}
|
||||
};
|
||||
|
||||
// CHECKS && DO classes
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@
|
|||
#include "WorldPacket.h"
|
||||
|
||||
template<class T>
|
||||
inline void Acore::VisibleNotifier::Visit(GridRefManager<T>& m)
|
||||
inline void Acore::VisibleNotifier::Visit(GridRefMgr<T>& m)
|
||||
{
|
||||
// Xinef: Update gameobjects only
|
||||
if (i_gobjOnly)
|
||||
return;
|
||||
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefMgr<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (i_largeOnly != iter->GetSource()->IsVisibilityOverridden())
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
void Visit(CorpseMapType& m);
|
||||
|
||||
template<class T> void Visit(GridRefManager<T>&) { }
|
||||
template<class T> void Visit(GridRefMgr<T>&) { }
|
||||
|
||||
private:
|
||||
Cell i_cell;
|
||||
|
|
@ -54,7 +54,7 @@ template<> void ObjectGridLoader::SetObjectCell(GameObject* obj, CellCoord const
|
|||
}
|
||||
|
||||
template <class T>
|
||||
void AddObjectHelper(CellCoord& cell, GridRefManager<T>& m, uint32& count, Map* /*map*/, T* obj)
|
||||
void AddObjectHelper(CellCoord& cell, GridRefMgr<T>& m, uint32& count, Map* /*map*/, T* obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
|
|
@ -87,7 +87,7 @@ void AddObjectHelper(CellCoord& cell, GameObjectMapType& m, uint32& count, Map*
|
|||
}
|
||||
|
||||
template <class T>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefManager<T>& m, uint32& count, Map* map)
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefMgr<T>& m, uint32& count, Map* map)
|
||||
{
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefManager<T>&
|
|||
}
|
||||
|
||||
template <>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefManager<GameObject>& m, uint32& count, Map* map)
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefMgr<GameObject>& m, uint32& count, Map* map)
|
||||
{
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
|
|
@ -187,7 +187,7 @@ void ObjectGridLoader::LoadN(void)
|
|||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectGridUnloader::Visit(GridRefManager<T>& m)
|
||||
void ObjectGridUnloader::Visit(GridRefMgr<T>& m)
|
||||
{
|
||||
while (!m.isEmpty())
|
||||
{
|
||||
|
|
@ -206,9 +206,9 @@ void ObjectGridUnloader::Visit(GridRefManager<T>& m)
|
|||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectGridCleaner::Visit(GridRefManager<T>& m)
|
||||
void ObjectGridCleaner::Visit(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()->CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ private:
|
|||
class ObjectGridCleaner
|
||||
{
|
||||
public:
|
||||
template<class T> void Visit(GridRefManager<T>&);
|
||||
template<class T> void Visit(GridRefMgr<T>&);
|
||||
};
|
||||
|
||||
//Delete objects before deleting NGrid
|
||||
|
|
@ -54,6 +54,6 @@ class ObjectGridUnloader
|
|||
{
|
||||
public:
|
||||
void Visit(CorpseMapType&) { } // corpses are deleted with Map
|
||||
template<class T> void Visit(GridRefManager<T>& m);
|
||||
template<class T> void Visit(GridRefMgr<T>& m);
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "LFG.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#define AZEROTHCORE_GROUP_H
|
||||
|
||||
#include "DBCEnums.h"
|
||||
#include "GroupRefManager.h"
|
||||
#include "GroupRefMgr.h"
|
||||
#include "LootMgr.h"
|
||||
#include "QueryResult.h"
|
||||
#include "SharedDefines.h"
|
||||
|
|
@ -318,7 +318,7 @@ protected:
|
|||
void ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply);
|
||||
|
||||
MemberSlotList m_memberSlots;
|
||||
GroupRefManager m_memberMgr;
|
||||
GroupRefMgr m_memberMgr;
|
||||
InvitesList m_invitees;
|
||||
ObjectGuid m_leaderGuid;
|
||||
std::string m_leaderName;
|
||||
|
|
|
|||
|
|
@ -7,16 +7,16 @@
|
|||
#ifndef _GROUPREFMANAGER
|
||||
#define _GROUPREFMANAGER
|
||||
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
|
||||
class Group;
|
||||
class Player;
|
||||
class GroupReference;
|
||||
|
||||
class GroupRefManager : public RefManager<Group, Player>
|
||||
class GroupRefMgr : public RefMgr<Group, Player>
|
||||
{
|
||||
public:
|
||||
GroupReference* getFirst() { return ((GroupReference*)RefManager<Group, Player>::getFirst()); }
|
||||
GroupReference const* getFirst() const { return ((GroupReference const*)RefManager<Group, Player>::getFirst()); }
|
||||
GroupReference* getFirst() { return ((GroupReference*)RefMgr<Group, Player>::getFirst()); }
|
||||
GroupReference const* getFirst() const { return ((GroupReference const*)RefMgr<Group, Player>::getFirst()); }
|
||||
};
|
||||
#endif
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "InstanceSaveMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MathUtil.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Pet.h"
|
||||
|
|
@ -47,9 +47,9 @@ void WorldSession::HandleMoveWorldportAck()
|
|||
WorldLocation const& loc = GetPlayer()->GetTeleportDest();
|
||||
|
||||
// possible errors in the coordinate validity check
|
||||
if (!MapManager::IsValidMapCoord(loc))
|
||||
if (!MapMgr::IsValidMapCoord(loc))
|
||||
{
|
||||
KickPlayer("!MapManager::IsValidMapCoord(loc)");
|
||||
KickPlayer("!MapMgr::IsValidMapCoord(loc)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -115,8 +115,8 @@ void WorldSession::HandleMoveWorldportAck()
|
|||
_player->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
||||
if (!_player->getHostileRefManager().isEmpty())
|
||||
_player->getHostileRefManager().deleteReferences(); // pussywizard: multithreading crashfix
|
||||
if (!_player->getHostileRefMgr().isEmpty())
|
||||
_player->getHostileRefMgr().deleteReferences(); // pussywizard: multithreading crashfix
|
||||
|
||||
CellCoord pair(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "NPCHandler.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
|
@ -22,11 +22,11 @@
|
|||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
|
||||
uint16 InstanceSaveManager::ResetTimeDelay[] = {3600, 900, 300, 60, 0};
|
||||
PlayerBindStorage InstanceSaveManager::playerBindStorage;
|
||||
BoundInstancesMap InstanceSaveManager::emptyBoundInstancesMap;
|
||||
uint16 InstanceSaveMgr::ResetTimeDelay[] = {3600, 900, 300, 60, 0};
|
||||
PlayerBindStorage InstanceSaveMgr::playerBindStorage;
|
||||
BoundInstancesMap InstanceSaveMgr::emptyBoundInstancesMap;
|
||||
|
||||
InstanceSaveManager::~InstanceSaveManager()
|
||||
InstanceSaveMgr::~InstanceSaveMgr()
|
||||
{
|
||||
lock_instLists = true;
|
||||
// pussywizard: crashes on calling function in destructor (PlayerUnbindInstance), completely not needed anyway
|
||||
|
|
@ -42,35 +42,35 @@ InstanceSaveManager::~InstanceSaveManager()
|
|||
}*/
|
||||
}
|
||||
|
||||
InstanceSaveManager* InstanceSaveManager::instance()
|
||||
InstanceSaveMgr* InstanceSaveMgr::instance()
|
||||
{
|
||||
static InstanceSaveManager instance;
|
||||
static InstanceSaveMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
/*
|
||||
- adding instance into manager
|
||||
*/
|
||||
InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instanceId, Difficulty difficulty, bool startup /*=false*/)
|
||||
InstanceSave* InstanceSaveMgr::AddInstanceSave(uint32 mapId, uint32 instanceId, Difficulty difficulty, bool startup /*=false*/)
|
||||
{
|
||||
ASSERT(!GetInstanceSave(instanceId));
|
||||
|
||||
const MapEntry* entry = sMapStore.LookupEntry(mapId);
|
||||
if (!entry)
|
||||
{
|
||||
LOG_ERROR("instance.save", "InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
|
||||
LOG_ERROR("instance.save", "InstanceSaveMgr::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (instanceId == 0)
|
||||
{
|
||||
LOG_ERROR("instance.save", "InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
|
||||
LOG_ERROR("instance.save", "InstanceSaveMgr::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (difficulty >= (entry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
||||
{
|
||||
LOG_ERROR("instance.save", "InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
|
||||
LOG_ERROR("instance.save", "InstanceSaveMgr::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -93,18 +93,18 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
|||
return save;
|
||||
}
|
||||
|
||||
InstanceSave* InstanceSaveManager::GetInstanceSave(uint32 InstanceId)
|
||||
InstanceSave* InstanceSaveMgr::GetInstanceSave(uint32 InstanceId)
|
||||
{
|
||||
InstanceSaveHashMap::iterator itr = m_instanceSaveById.find(InstanceId);
|
||||
return itr != m_instanceSaveById.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
bool InstanceSaveManager::DeleteInstanceSaveIfNeeded(uint32 InstanceId, bool skipMapCheck)
|
||||
bool InstanceSaveMgr::DeleteInstanceSaveIfNeeded(uint32 InstanceId, bool skipMapCheck)
|
||||
{
|
||||
return DeleteInstanceSaveIfNeeded(GetInstanceSave(InstanceId), skipMapCheck);
|
||||
}
|
||||
|
||||
bool InstanceSaveManager::DeleteInstanceSaveIfNeeded(InstanceSave* save, bool skipMapCheck)
|
||||
bool InstanceSaveMgr::DeleteInstanceSaveIfNeeded(InstanceSave* save, bool skipMapCheck)
|
||||
{
|
||||
// pussywizard: save is removed only when there are no more players bound AND the map doesn't exist
|
||||
// pussywizard: this function is called when unbinding a player and when unloading a map
|
||||
|
|
@ -202,7 +202,7 @@ void InstanceSave::AddPlayer(ObjectGuid guid)
|
|||
m_playerList.push_back(guid);
|
||||
}
|
||||
|
||||
bool InstanceSave::RemovePlayer(ObjectGuid guid, InstanceSaveManager* ism)
|
||||
bool InstanceSave::RemovePlayer(ObjectGuid guid, InstanceSaveMgr* ism)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(_lock);
|
||||
m_playerList.remove(guid);
|
||||
|
|
@ -211,7 +211,7 @@ bool InstanceSave::RemovePlayer(ObjectGuid guid, InstanceSaveManager* ism)
|
|||
return ism->DeleteInstanceSaveIfNeeded(this->GetInstanceId(), false);
|
||||
}
|
||||
|
||||
void InstanceSaveManager::LoadInstances()
|
||||
void InstanceSaveMgr::LoadInstances()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ void InstanceSaveManager::LoadInstances()
|
|||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
void InstanceSaveManager::LoadResetTimes()
|
||||
void InstanceSaveMgr::LoadResetTimes()
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
time_t today = (now / DAY) * DAY;
|
||||
|
|
@ -267,7 +267,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff)
|
||||
{
|
||||
LOG_ERROR("instance.save", "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||
LOG_ERROR("instance.save", "InstanceSaveMgr::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
|
||||
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid, difficulty);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ void InstanceSaveManager::LoadResetTimes()
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::LoadInstanceSaves()
|
||||
void InstanceSaveMgr::LoadInstanceSaves()
|
||||
{
|
||||
QueryResult result = CharacterDatabase.Query("SELECT id, map, resettime, difficulty, completedEncounters, data FROM instance ORDER BY id ASC");
|
||||
if (result)
|
||||
|
|
@ -353,7 +353,7 @@ void InstanceSaveManager::LoadInstanceSaves()
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::LoadCharacterBinds()
|
||||
void InstanceSaveMgr::LoadCharacterBinds()
|
||||
{
|
||||
lock_instLists = true;
|
||||
|
||||
|
|
@ -405,12 +405,12 @@ void InstanceSaveManager::LoadCharacterBinds()
|
|||
lock_instLists = false;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::ScheduleReset(time_t time, InstResetEvent event)
|
||||
void InstanceSaveMgr::ScheduleReset(time_t time, InstResetEvent event)
|
||||
{
|
||||
m_resetTimeQueue.insert(std::pair<time_t, InstResetEvent>(time, event));
|
||||
}
|
||||
|
||||
void InstanceSaveManager::Update()
|
||||
void InstanceSaveMgr::Update()
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
time_t t;
|
||||
|
|
@ -455,7 +455,7 @@ void InstanceSaveManager::Update()
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator& itr)
|
||||
void InstanceSaveMgr::_ResetSave(InstanceSaveHashMap::iterator& itr)
|
||||
{
|
||||
lock_instLists = true;
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator& itr)
|
|||
lock_instLists = false;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime)
|
||||
void InstanceSaveMgr::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime)
|
||||
{
|
||||
// global reset for all instances of the given map
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||
|
|
@ -518,7 +518,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
|||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff || !mapDiff->resetTime)
|
||||
{
|
||||
LOG_ERROR("instance.save", "InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
|
||||
LOG_ERROR("instance.save", "InstanceSaveMgr::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
|||
}
|
||||
}
|
||||
|
||||
InstancePlayerBind* InstanceSaveManager::PlayerBindToInstance(ObjectGuid guid, InstanceSave* save, bool permanent, Player* player /*= nullptr*/)
|
||||
InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, InstanceSave* save, bool permanent, Player* player /*= nullptr*/)
|
||||
{
|
||||
InstancePlayerBind& bind = playerBindStorage[guid]->m[save->GetDifficulty()][save->GetMapId()];
|
||||
ASSERT(!bind.perm || permanent); // ensure there's no changing permanent to temporary, this can be done only by unbinding
|
||||
|
|
@ -649,7 +649,7 @@ InstancePlayerBind* InstanceSaveManager::PlayerBindToInstance(ObjectGuid guid, I
|
|||
return &bind;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::PlayerUnbindInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty, bool deleteFromDB, Player* player /*= nullptr*/)
|
||||
void InstanceSaveMgr::PlayerUnbindInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty, bool deleteFromDB, Player* player /*= nullptr*/)
|
||||
{
|
||||
BoundInstancesMapWrapper* w = playerBindStorage[guid];
|
||||
BoundInstancesMap::iterator itr = w->m[difficulty].find(mapid);
|
||||
|
|
@ -672,7 +672,7 @@ void InstanceSaveManager::PlayerUnbindInstance(ObjectGuid guid, uint32 mapid, Di
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::PlayerUnbindInstanceNotExtended(ObjectGuid guid, uint32 mapid, Difficulty difficulty, Player* player /*= nullptr*/)
|
||||
void InstanceSaveMgr::PlayerUnbindInstanceNotExtended(ObjectGuid guid, uint32 mapid, Difficulty difficulty, Player* player /*= nullptr*/)
|
||||
{
|
||||
BoundInstancesMapWrapper* w = playerBindStorage[guid];
|
||||
BoundInstancesMap::iterator itr = w->m[difficulty].find(mapid);
|
||||
|
|
@ -692,7 +692,7 @@ void InstanceSaveManager::PlayerUnbindInstanceNotExtended(ObjectGuid guid, uint3
|
|||
}
|
||||
}
|
||||
|
||||
InstancePlayerBind* InstanceSaveManager::PlayerGetBoundInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
InstancePlayerBind* InstanceSaveMgr::PlayerGetBoundInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
{
|
||||
Difficulty difficulty_fixed = ( IsSharedDifficultyMap(mapid) ? Difficulty(difficulty % 2) : difficulty);
|
||||
|
||||
|
|
@ -714,7 +714,7 @@ InstancePlayerBind* InstanceSaveManager::PlayerGetBoundInstance(ObjectGuid guid,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool InstanceSaveManager::PlayerIsPermBoundToInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
bool InstanceSaveMgr::PlayerIsPermBoundToInstance(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
{
|
||||
if (InstancePlayerBind* bind = PlayerGetBoundInstance(guid, mapid, difficulty))
|
||||
if (bind->perm)
|
||||
|
|
@ -722,7 +722,7 @@ bool InstanceSaveManager::PlayerIsPermBoundToInstance(ObjectGuid guid, uint32 ma
|
|||
return false;
|
||||
}
|
||||
|
||||
BoundInstancesMap const& InstanceSaveManager::PlayerGetBoundInstances(ObjectGuid guid, Difficulty difficulty)
|
||||
BoundInstancesMap const& InstanceSaveMgr::PlayerGetBoundInstances(ObjectGuid guid, Difficulty difficulty)
|
||||
{
|
||||
PlayerBindStorage::iterator itr = playerBindStorage.find(guid);
|
||||
if (itr != playerBindStorage.end())
|
||||
|
|
@ -730,19 +730,19 @@ BoundInstancesMap const& InstanceSaveManager::PlayerGetBoundInstances(ObjectGuid
|
|||
return emptyBoundInstancesMap;
|
||||
}
|
||||
|
||||
void InstanceSaveManager::PlayerCreateBoundInstancesMaps(ObjectGuid guid)
|
||||
void InstanceSaveMgr::PlayerCreateBoundInstancesMaps(ObjectGuid guid)
|
||||
{
|
||||
if (playerBindStorage.find(guid) == playerBindStorage.end())
|
||||
playerBindStorage[guid] = new BoundInstancesMapWrapper;
|
||||
}
|
||||
|
||||
InstanceSave* InstanceSaveManager::PlayerGetInstanceSave(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
InstanceSave* InstanceSaveMgr::PlayerGetInstanceSave(ObjectGuid guid, uint32 mapid, Difficulty difficulty)
|
||||
{
|
||||
InstancePlayerBind* pBind = PlayerGetBoundInstance(guid, mapid, difficulty);
|
||||
return (pBind ? pBind->save : nullptr);
|
||||
}
|
||||
|
||||
uint32 InstanceSaveManager::PlayerGetDestinationInstanceId(Player* player, uint32 mapid, Difficulty difficulty)
|
||||
uint32 InstanceSaveMgr::PlayerGetDestinationInstanceId(Player* player, uint32 mapid, Difficulty difficulty)
|
||||
{
|
||||
// returning 0 means a new instance will be created
|
||||
// non-zero implicates that InstanceSave exists
|
||||
|
|
@ -759,7 +759,7 @@ uint32 InstanceSaveManager::PlayerGetDestinationInstanceId(Player* player, uint3
|
|||
return ipb ? ipb->save->GetInstanceId() : 0; // 4. self temp
|
||||
}
|
||||
|
||||
void InstanceSaveManager::CopyBinds(ObjectGuid from, ObjectGuid to, Player* toPlr)
|
||||
void InstanceSaveMgr::CopyBinds(ObjectGuid from, ObjectGuid to, Player* toPlr)
|
||||
{
|
||||
if (from == to)
|
||||
return;
|
||||
|
|
@ -773,7 +773,7 @@ void InstanceSaveManager::CopyBinds(ObjectGuid from, ObjectGuid to, Player* toPl
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceSaveManager::UnbindAllFor(InstanceSave* save)
|
||||
void InstanceSaveMgr::UnbindAllFor(InstanceSave* save)
|
||||
{
|
||||
GuidList& pList = save->m_playerList;
|
||||
while (!pList.empty())
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct InstanceTemplate;
|
|||
struct MapEntry;
|
||||
class Player;
|
||||
class Group;
|
||||
class InstanceSaveManager;
|
||||
class InstanceSaveMgr;
|
||||
class InstanceSave;
|
||||
|
||||
struct InstancePlayerBind
|
||||
|
|
@ -43,7 +43,7 @@ typedef std::unordered_map<ObjectGuid /*guid*/, BoundInstancesMapWrapper* > Play
|
|||
|
||||
class InstanceSave
|
||||
{
|
||||
friend class InstanceSaveManager;
|
||||
friend class InstanceSaveMgr;
|
||||
public:
|
||||
InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficulty, time_t resetTime, time_t extendedResetTime);
|
||||
~InstanceSave();
|
||||
|
|
@ -74,7 +74,7 @@ public:
|
|||
MapEntry const* GetMapEntry();
|
||||
|
||||
void AddPlayer(ObjectGuid guid);
|
||||
bool RemovePlayer(ObjectGuid guid, InstanceSaveManager* ism);
|
||||
bool RemovePlayer(ObjectGuid guid, InstanceSaveMgr* ism);
|
||||
|
||||
private:
|
||||
GuidList m_playerList;
|
||||
|
|
@ -92,16 +92,16 @@ private:
|
|||
|
||||
typedef std::unordered_map<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
|
||||
|
||||
class InstanceSaveManager
|
||||
class InstanceSaveMgr
|
||||
{
|
||||
friend class InstanceSave;
|
||||
|
||||
private:
|
||||
InstanceSaveManager() {};
|
||||
~InstanceSaveManager();
|
||||
InstanceSaveMgr() {};
|
||||
~InstanceSaveMgr();
|
||||
|
||||
public:
|
||||
static InstanceSaveManager* instance();
|
||||
static InstanceSaveMgr* instance();
|
||||
|
||||
typedef std::unordered_map<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
|
||||
|
||||
|
|
@ -186,6 +186,6 @@ private:
|
|||
ResetTimeQueue m_resetTimeQueue;
|
||||
};
|
||||
|
||||
#define sInstanceSaveMgr InstanceSaveManager::instance()
|
||||
#define sInstanceSaveMgr InstanceSaveMgr::instance()
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "ConditionMgr.h"
|
||||
#include "ItemEnchantmentMgr.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
|
@ -278,13 +278,13 @@ public:
|
|||
|
||||
//=====================================================
|
||||
|
||||
class LootValidatorRefManager : public RefManager<Loot, LootValidatorRef>
|
||||
class LootValidatorRefMgr : public RefMgr<Loot, LootValidatorRef>
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< LootValidatorRef > iterator;
|
||||
|
||||
LootValidatorRef* getFirst() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getFirst(); }
|
||||
LootValidatorRef* getLast() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getLast(); }
|
||||
LootValidatorRef* getFirst() { return (LootValidatorRef*)RefMgr<Loot, LootValidatorRef>::getFirst(); }
|
||||
LootValidatorRef* getLast() { return (LootValidatorRef*)RefMgr<Loot, LootValidatorRef>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
|
|
@ -324,7 +324,7 @@ struct Loot
|
|||
// if loot becomes invalid this reference is used to inform the listener
|
||||
void addLootValidatorRef(LootValidatorRef* pLootValidatorRef)
|
||||
{
|
||||
i_LootValidatorRefManager.insertFirst(pLootValidatorRef);
|
||||
i_LootValidatorRefMgr.insertFirst(pLootValidatorRef);
|
||||
}
|
||||
|
||||
// void clear();
|
||||
|
|
@ -348,7 +348,7 @@ struct Loot
|
|||
gold = 0;
|
||||
unlootedCount = 0;
|
||||
roundRobinPlayer.Clear();
|
||||
i_LootValidatorRefManager.clearReferences();
|
||||
i_LootValidatorRefMgr.clearReferences();
|
||||
loot_type = LOOT_NONE;
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ private:
|
|||
QuestItemMap PlayerNonQuestNonFFAConditionalItems;
|
||||
|
||||
// All rolls are registered here. They need to know, when the loot is not valid anymore
|
||||
LootValidatorRefManager i_LootValidatorRefManager;
|
||||
LootValidatorRefMgr i_LootValidatorRefMgr;
|
||||
};
|
||||
|
||||
struct LootView
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
#include "DynamicTree.h"
|
||||
#include "GameObjectModel.h"
|
||||
#include "GridDefines.h"
|
||||
#include "GridRefManager.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "GridRefMgr.h"
|
||||
#include "MapRefMgr.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "PathGenerator.h"
|
||||
|
|
@ -284,7 +284,7 @@ enum EncounterCreditType
|
|||
ENCOUNTER_CREDIT_CAST_SPELL = 1,
|
||||
};
|
||||
|
||||
class Map : public GridRefManager<NGridType>
|
||||
class Map : public GridRefMgr<NGridType>
|
||||
{
|
||||
friend class MapReference;
|
||||
public:
|
||||
|
|
@ -447,7 +447,7 @@ public:
|
|||
bool isCellMarkedLarge(uint32 pCellId) { return marked_cells_large.test(pCellId); }
|
||||
void markCellLarge(uint32 pCellId) { marked_cells_large.set(pCellId); }
|
||||
|
||||
[[nodiscard]] bool HavePlayers() const { return !m_mapRefManager.isEmpty(); }
|
||||
[[nodiscard]] bool HavePlayers() const { return !m_mapRefMgr.isEmpty(); }
|
||||
[[nodiscard]] uint32 GetPlayersCountExceptGMs() const;
|
||||
|
||||
void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); }
|
||||
|
|
@ -455,8 +455,8 @@ public:
|
|||
|
||||
void SendToPlayers(WorldPacket const* data) const;
|
||||
|
||||
typedef MapRefManager PlayerList;
|
||||
[[nodiscard]] PlayerList const& GetPlayers() const { return m_mapRefManager; }
|
||||
typedef MapRefMgr PlayerList;
|
||||
[[nodiscard]] PlayerList const& GetPlayers() const { return m_mapRefMgr; }
|
||||
|
||||
//per-map script storage
|
||||
void ScriptsStart(std::map<uint32, std::multimap<uint32, ScriptInfo> > const& scripts, uint32 id, Object* source, Object* target);
|
||||
|
|
@ -671,8 +671,8 @@ protected:
|
|||
DynamicMapTree _dynamicTree;
|
||||
time_t _instanceResetPeriod; // pussywizard
|
||||
|
||||
MapRefManager m_mapRefManager;
|
||||
MapRefManager::iterator m_mapRefIter;
|
||||
MapRefMgr m_mapRefMgr;
|
||||
MapRefMgr::iterator m_mapRefIter;
|
||||
|
||||
typedef std::set<WorldObject*> ActiveNonPlayers;
|
||||
ActiveNonPlayers m_activeNonPlayers;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "Group.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
class MapInstanced : public Map
|
||||
{
|
||||
friend class MapManager;
|
||||
friend class MapMgr;
|
||||
public:
|
||||
typedef std::unordered_map< uint32, Map*> InstancedMaps;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -29,24 +29,24 @@
|
|||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
MapManager::MapManager()
|
||||
MapMgr::MapMgr()
|
||||
{
|
||||
i_timer[3].SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
|
||||
mapUpdateStep = 0;
|
||||
_nextInstanceId = 0;
|
||||
}
|
||||
|
||||
MapManager::~MapManager()
|
||||
MapMgr::~MapMgr()
|
||||
{
|
||||
}
|
||||
|
||||
MapManager* MapManager::instance()
|
||||
MapMgr* MapMgr::instance()
|
||||
{
|
||||
static MapManager instance;
|
||||
static MapMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void MapManager::Initialize()
|
||||
void MapMgr::Initialize()
|
||||
{
|
||||
int num_threads(sWorld->getIntConfig(CONFIG_NUMTHREADS));
|
||||
|
||||
|
|
@ -55,13 +55,13 @@ void MapManager::Initialize()
|
|||
m_updater.activate(num_threads);
|
||||
}
|
||||
|
||||
void MapManager::InitializeVisibilityDistanceInfo()
|
||||
void MapMgr::InitializeVisibilityDistanceInfo()
|
||||
{
|
||||
for (MapMapType::iterator iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
(*iter).second->InitVisibilityDistance();
|
||||
}
|
||||
|
||||
Map* MapManager::CreateBaseMap(uint32 id)
|
||||
Map* MapMgr::CreateBaseMap(uint32 id)
|
||||
{
|
||||
Map* map = FindBaseMap(id);
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ Map* MapManager::CreateBaseMap(uint32 id)
|
|||
return map;
|
||||
}
|
||||
|
||||
Map* MapManager::FindBaseNonInstanceMap(uint32 mapId) const
|
||||
Map* MapMgr::FindBaseNonInstanceMap(uint32 mapId) const
|
||||
{
|
||||
Map* map = FindBaseMap(mapId);
|
||||
if (map && map->Instanceable())
|
||||
|
|
@ -100,7 +100,7 @@ Map* MapManager::FindBaseNonInstanceMap(uint32 mapId) const
|
|||
return map;
|
||||
}
|
||||
|
||||
Map* MapManager::CreateMap(uint32 id, Player* player)
|
||||
Map* MapMgr::CreateMap(uint32 id, Player* player)
|
||||
{
|
||||
Map* m = CreateBaseMap(id);
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ Map* MapManager::CreateMap(uint32 id, Player* player)
|
|||
return m;
|
||||
}
|
||||
|
||||
Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
|
||||
Map* MapMgr::FindMap(uint32 mapid, uint32 instanceId) const
|
||||
{
|
||||
Map* map = FindBaseMap(mapid);
|
||||
if (!map)
|
||||
|
|
@ -122,7 +122,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
|
|||
return ((MapInstanced*)map)->FindInstanceMap(instanceId);
|
||||
}
|
||||
|
||||
Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
{
|
||||
MapEntry const* entry = sMapStore.LookupEntry(mapid);
|
||||
if (!entry)
|
||||
|
|
@ -236,7 +236,7 @@ Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool
|
|||
return player->Satisfy(sObjectMgr->GetAccessRequirement(mapid, targetDifficulty), mapid, true) ? Map::CAN_ENTER : Map::CANNOT_ENTER_UNSPECIFIED_REASON;
|
||||
}
|
||||
|
||||
void MapManager::Update(uint32 diff)
|
||||
void MapMgr::Update(uint32 diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
i_timer[i].Update(diff);
|
||||
|
|
@ -288,11 +288,11 @@ void MapManager::Update(uint32 diff)
|
|||
}
|
||||
}
|
||||
|
||||
void MapManager::DoDelayedMovesAndRemoves()
|
||||
void MapMgr::DoDelayedMovesAndRemoves()
|
||||
{
|
||||
}
|
||||
|
||||
bool MapManager::ExistMapAndVMap(uint32 mapid, float x, float y)
|
||||
bool MapMgr::ExistMapAndVMap(uint32 mapid, float x, float y)
|
||||
{
|
||||
GridCoord p = Acore::ComputeGridCoord(x, y);
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ bool MapManager::ExistMapAndVMap(uint32 mapid, float x, float y)
|
|||
return Map::ExistMap(mapid, gx, gy) && Map::ExistVMap(mapid, gx, gy);
|
||||
}
|
||||
|
||||
bool MapManager::IsValidMAP(uint32 mapid, bool startUp)
|
||||
bool MapMgr::IsValidMAP(uint32 mapid, bool startUp)
|
||||
{
|
||||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ bool MapManager::IsValidMAP(uint32 mapid, bool startUp)
|
|||
// TODO: add check for battleground template
|
||||
}
|
||||
|
||||
void MapManager::UnloadAll()
|
||||
void MapMgr::UnloadAll()
|
||||
{
|
||||
for (MapMapType::iterator iter = i_maps.begin(); iter != i_maps.end();)
|
||||
{
|
||||
|
|
@ -331,7 +331,7 @@ void MapManager::UnloadAll()
|
|||
m_updater.deactivate();
|
||||
}
|
||||
|
||||
void MapManager::GetNumInstances(uint32& dungeons, uint32& battlegrounds, uint32& arenas)
|
||||
void MapMgr::GetNumInstances(uint32& dungeons, uint32& battlegrounds, uint32& arenas)
|
||||
{
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
{
|
||||
|
|
@ -348,7 +348,7 @@ void MapManager::GetNumInstances(uint32& dungeons, uint32& battlegrounds, uint32
|
|||
}
|
||||
}
|
||||
|
||||
void MapManager::GetNumPlayersInInstances(uint32& dungeons, uint32& battlegrounds, uint32& arenas, uint32& spectators)
|
||||
void MapMgr::GetNumPlayersInInstances(uint32& dungeons, uint32& battlegrounds, uint32& arenas, uint32& spectators)
|
||||
{
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
{
|
||||
|
|
@ -374,7 +374,7 @@ void MapManager::GetNumPlayersInInstances(uint32& dungeons, uint32& battleground
|
|||
}
|
||||
}
|
||||
|
||||
void MapManager::InitInstanceIds()
|
||||
void MapMgr::InitInstanceIds()
|
||||
{
|
||||
_nextInstanceId = 1;
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ void MapManager::InitInstanceIds()
|
|||
}
|
||||
}
|
||||
|
||||
void MapManager::RegisterInstanceId(uint32 instanceId)
|
||||
void MapMgr::RegisterInstanceId(uint32 instanceId)
|
||||
{
|
||||
// Allocation was done in InitInstanceIds()
|
||||
_instanceIds[instanceId] = true;
|
||||
|
|
@ -397,7 +397,7 @@ void MapManager::RegisterInstanceId(uint32 instanceId)
|
|||
++_nextInstanceId;
|
||||
}
|
||||
|
||||
uint32 MapManager::GenerateInstanceId()
|
||||
uint32 MapMgr::GenerateInstanceId()
|
||||
{
|
||||
uint32 newInstanceId = _nextInstanceId;
|
||||
|
||||
|
|
@ -21,10 +21,10 @@ class StaticTransport;
|
|||
class MotionTransport;
|
||||
struct TransportCreatureProto;
|
||||
|
||||
class MapManager
|
||||
class MapMgr
|
||||
{
|
||||
public:
|
||||
static MapManager* instance();
|
||||
static MapMgr* instance();
|
||||
|
||||
Map* CreateBaseMap(uint32 mapId);
|
||||
Map* FindBaseNonInstanceMap(uint32 mapId) const;
|
||||
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
[[nodiscard]] uint32 GetAreaId(uint32 phaseMask, uint32 mapid, float x, float y, float z) const
|
||||
{
|
||||
Map const* m = const_cast<MapManager*>(this)->CreateBaseMap(mapid);
|
||||
Map const* m = const_cast<MapMgr*>(this)->CreateBaseMap(mapid);
|
||||
return m->GetAreaId(phaseMask, x, y, z);
|
||||
}
|
||||
[[nodiscard]] uint32 GetAreaId(uint32 phaseMask, uint32 mapid, Position const& pos) const { return GetAreaId(phaseMask, mapid, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
|
||||
|
|
@ -47,7 +47,7 @@ public:
|
|||
|
||||
[[nodiscard]] uint32 GetZoneId(uint32 phaseMask, uint32 mapid, float x, float y, float z) const
|
||||
{
|
||||
Map const* m = const_cast<MapManager*>(this)->CreateBaseMap(mapid);
|
||||
Map const* m = const_cast<MapMgr*>(this)->CreateBaseMap(mapid);
|
||||
return m->GetZoneId(phaseMask, x, y, z);
|
||||
}
|
||||
[[nodiscard]] uint32 GetZoneId(uint32 phaseMask, uint32 mapid, Position const& pos) const { return GetZoneId(phaseMask, mapid, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
|
||||
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
void GetZoneAndAreaId(uint32 phaseMask, uint32& zoneid, uint32& areaid, uint32 mapid, float x, float y, float z)
|
||||
{
|
||||
Map const* m = const_cast<MapManager*>(this)->CreateBaseMap(mapid);
|
||||
Map const* m = const_cast<MapMgr*>(this)->CreateBaseMap(mapid);
|
||||
m->GetZoneAndAreaId(phaseMask, zoneid, areaid, x, y, z);
|
||||
}
|
||||
|
||||
|
|
@ -143,11 +143,11 @@ private:
|
|||
typedef std::unordered_map<uint32, Map*> MapMapType;
|
||||
typedef std::vector<bool> InstanceIds;
|
||||
|
||||
MapManager();
|
||||
~MapManager();
|
||||
MapMgr();
|
||||
~MapMgr();
|
||||
|
||||
MapManager(const MapManager&);
|
||||
MapManager& operator=(const MapManager&);
|
||||
MapMgr(const MapMgr&);
|
||||
MapMgr& operator=(const MapMgr&);
|
||||
|
||||
std::mutex Lock;
|
||||
MapMapType i_maps;
|
||||
|
|
@ -160,7 +160,7 @@ private:
|
|||
};
|
||||
|
||||
template<typename Worker>
|
||||
void MapManager::DoForAllMaps(Worker&& worker)
|
||||
void MapMgr::DoForAllMaps(Worker&& worker)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(Lock);
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ void MapManager::DoForAllMaps(Worker&& worker)
|
|||
}
|
||||
|
||||
template<typename Worker>
|
||||
inline void MapManager::DoForAllMapsWithMapId(uint32 mapId, Worker&& worker)
|
||||
inline void MapMgr::DoForAllMapsWithMapId(uint32 mapId, Worker&& worker)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(Lock);
|
||||
|
||||
|
|
@ -198,6 +198,6 @@ inline void MapManager::DoForAllMapsWithMapId(uint32 mapId, Worker&& worker)
|
|||
}
|
||||
}
|
||||
|
||||
#define sMapMgr MapManager::instance()
|
||||
#define sMapMgr MapMgr::instance()
|
||||
|
||||
#endif
|
||||
|
|
@ -7,20 +7,20 @@
|
|||
#ifndef _MAPREFMANAGER
|
||||
#define _MAPREFMANAGER
|
||||
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
|
||||
class MapReference;
|
||||
|
||||
class MapRefManager : public RefManager<Map, Player>
|
||||
class MapRefMgr : public RefMgr<Map, Player>
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< MapReference > iterator;
|
||||
typedef LinkedListHead::Iterator< MapReference const > const_iterator;
|
||||
|
||||
MapReference* getFirst() { return (MapReference*)RefManager<Map, Player>::getFirst(); }
|
||||
[[nodiscard]] MapReference const* getFirst() const { return (MapReference const*)RefManager<Map, Player>::getFirst(); }
|
||||
MapReference* getLast() { return (MapReference*)RefManager<Map, Player>::getLast(); }
|
||||
[[nodiscard]] MapReference const* getLast() const { return (MapReference const*)RefManager<Map, Player>::getLast(); }
|
||||
MapReference* getFirst() { return (MapReference*)RefMgr<Map, Player>::getFirst(); }
|
||||
[[nodiscard]] MapReference const* getFirst() const { return (MapReference const*)RefMgr<Map, Player>::getFirst(); }
|
||||
MapReference* getLast() { return (MapReference*)RefMgr<Map, Player>::getLast(); }
|
||||
[[nodiscard]] MapReference const* getLast() const { return (MapReference const*)RefMgr<Map, Player>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
|
|
@ -16,18 +16,18 @@ protected:
|
|||
void targetObjectBuildLink() override
|
||||
{
|
||||
// called from link()
|
||||
getTarget()->m_mapRefManager.insertFirst(this);
|
||||
getTarget()->m_mapRefManager.incSize();
|
||||
getTarget()->m_mapRefMgr.insertFirst(this);
|
||||
getTarget()->m_mapRefMgr.incSize();
|
||||
}
|
||||
void targetObjectDestroyLink() override
|
||||
{
|
||||
// called from unlink()
|
||||
if (isValid()) getTarget()->m_mapRefManager.decSize();
|
||||
if (isValid()) getTarget()->m_mapRefMgr.decSize();
|
||||
}
|
||||
void sourceObjectDestroyLink() override
|
||||
{
|
||||
// called from invalidate()
|
||||
getTarget()->m_mapRefManager.decSize();
|
||||
getTarget()->m_mapRefMgr.decSize();
|
||||
}
|
||||
public:
|
||||
MapReference() : Reference<Map, Player>() {}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "InstanceScript.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "Transport.h"
|
||||
#include "TransportMgr.h"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "BanManager.h"
|
||||
#include "BanMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
BanManager* BanManager::instance()
|
||||
BanMgr* BanMgr::instance()
|
||||
{
|
||||
static BanManager instance;
|
||||
static BanMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
/// Ban an account, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban
|
||||
BanReturn BanManager::BanAccount(std::string const& AccountName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
BanReturn BanMgr::BanAccount(std::string const& AccountName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
{
|
||||
if (AccountName.empty() || Duration.empty())
|
||||
return BAN_SYNTAX_ERROR;
|
||||
|
|
@ -82,7 +82,7 @@ BanReturn BanManager::BanAccount(std::string const& AccountName, std::string con
|
|||
}
|
||||
|
||||
/// Ban an account by player name, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban
|
||||
BanReturn BanManager::BanAccountByPlayerName(std::string const& CharacterName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
BanReturn BanMgr::BanAccountByPlayerName(std::string const& CharacterName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
{
|
||||
if (CharacterName.empty() || Duration.empty())
|
||||
return BAN_SYNTAX_ERROR;
|
||||
|
|
@ -148,7 +148,7 @@ BanReturn BanManager::BanAccountByPlayerName(std::string const& CharacterName, s
|
|||
}
|
||||
|
||||
/// Ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban
|
||||
BanReturn BanManager::BanIP(std::string const& IP, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
BanReturn BanMgr::BanIP(std::string const& IP, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
{
|
||||
if (IP.empty() || Duration.empty())
|
||||
return BAN_SYNTAX_ERROR;
|
||||
|
|
@ -206,7 +206,7 @@ BanReturn BanManager::BanIP(std::string const& IP, std::string const& Duration,
|
|||
}
|
||||
|
||||
/// Ban an character, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban
|
||||
BanReturn BanManager::BanCharacter(std::string const& CharacterName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
BanReturn BanMgr::BanCharacter(std::string const& CharacterName, std::string const& Duration, std::string const& Reason, std::string const& Author)
|
||||
{
|
||||
Player* target = ObjectAccessor::FindPlayerByName(CharacterName, false);
|
||||
uint32 DurationSecs = TimeStringToSecs(Duration);
|
||||
|
|
@ -254,7 +254,7 @@ BanReturn BanManager::BanCharacter(std::string const& CharacterName, std::string
|
|||
}
|
||||
|
||||
/// Remove a ban from an account
|
||||
bool BanManager::RemoveBanAccount(std::string const& AccountName)
|
||||
bool BanMgr::RemoveBanAccount(std::string const& AccountName)
|
||||
{
|
||||
uint32 AccountID = AccountMgr::GetId(AccountName);
|
||||
if (!AccountID)
|
||||
|
|
@ -269,7 +269,7 @@ bool BanManager::RemoveBanAccount(std::string const& AccountName)
|
|||
}
|
||||
|
||||
/// Remove a ban from an player name
|
||||
bool BanManager::RemoveBanAccountByPlayerName(std::string const& CharacterName)
|
||||
bool BanMgr::RemoveBanAccountByPlayerName(std::string const& CharacterName)
|
||||
{
|
||||
uint32 AccountID = sObjectMgr->GetPlayerAccountIdByPlayerName(CharacterName);
|
||||
if (!AccountID)
|
||||
|
|
@ -284,7 +284,7 @@ bool BanManager::RemoveBanAccountByPlayerName(std::string const& CharacterName)
|
|||
}
|
||||
|
||||
/// Remove a ban from an account
|
||||
bool BanManager::RemoveBanIP(std::string const& IP)
|
||||
bool BanMgr::RemoveBanIP(std::string const& IP)
|
||||
{
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
|
||||
stmt->setString(0, IP);
|
||||
|
|
@ -294,7 +294,7 @@ bool BanManager::RemoveBanIP(std::string const& IP)
|
|||
}
|
||||
|
||||
/// Remove a ban from a character
|
||||
bool BanManager::RemoveBanCharacter(std::string const& CharacterName)
|
||||
bool BanMgr::RemoveBanCharacter(std::string const& CharacterName)
|
||||
{
|
||||
Player* pBanned = ObjectAccessor::FindPlayerByName(CharacterName, false);
|
||||
ObjectGuid guid;
|
||||
|
|
@ -16,10 +16,10 @@ enum BanReturn
|
|||
BAN_LONGER_EXISTS
|
||||
};
|
||||
|
||||
class BanManager
|
||||
class BanMgr
|
||||
{
|
||||
public:
|
||||
static BanManager* instance();
|
||||
static BanMgr* instance();
|
||||
|
||||
BanReturn BanAccount(std::string const& AccountName, std::string const& Duration, std::string const& Reason, std::string const& Author);
|
||||
BanReturn BanAccountByPlayerName(std::string const& CharacterName, std::string const& Duration, std::string const& Reason, std::string const& Author);
|
||||
|
|
@ -32,6 +32,6 @@ public:
|
|||
bool RemoveBanCharacter(std::string const& CharacterName);
|
||||
};
|
||||
|
||||
#define sBan BanManager::instance()
|
||||
#define sBan BanMgr::instance()
|
||||
|
||||
#endif // _BAN_MANAGER_H
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#include "DBCStores.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
|
||||
Graveyard* Graveyard::instance()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#ifndef _FOLLOWERREFMANAGER
|
||||
#define _FOLLOWERREFMANAGER
|
||||
|
||||
#include "RefManager.h"
|
||||
#include "RefMgr.h"
|
||||
|
||||
class Unit;
|
||||
class TargetedMovementGeneratorBase;
|
||||
|
||||
class FollowerRefManager : public RefManager<Unit, TargetedMovementGeneratorBase>
|
||||
class FollowerRefMgr : public RefMgr<Unit, TargetedMovementGeneratorBase>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "ConfusedMovementGenerator.h"
|
||||
#include "Creature.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "FleeingMovementGenerator.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "MMapManager.h"
|
||||
#include "MMapMgr.h"
|
||||
#include "PathGenerator.h"
|
||||
|
||||
////////////////// PathGenerator //////////////////
|
||||
|
|
@ -25,7 +25,7 @@ PathGenerator::PathGenerator(WorldObject const* owner) :
|
|||
uint32 mapId = _source->GetMapId();
|
||||
//if (DisableMgr::IsPathfindingEnabled(_sourceUnit->FindMap()))
|
||||
{
|
||||
MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
MMAP::MMapMgr* mmap = MMAP::MMapFactory::createOrGetMMapMgr();
|
||||
_navMesh = mmap->GetNavMesh(mapId);
|
||||
_navMeshQuery = mmap->GetNavMeshQuery(mapId, _source->GetInstanceId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "DetourNavMeshQuery.h"
|
||||
#include "MapDefines.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "MMapManager.h"
|
||||
#include "MMapMgr.h"
|
||||
#include "MoveSplineInitArgs.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <G3D/Vector3.h>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "Creature.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
@ -310,7 +310,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
|||
|
||||
if (player->m_taxi.empty())
|
||||
{
|
||||
player->getHostileRefManager().setOnlineOfflineState(true);
|
||||
player->getHostileRefMgr().setOnlineOfflineState(true);
|
||||
// update z position to ground and orientation for landing point
|
||||
// this prevent cheating with landing point at lags
|
||||
// when client side flight end early in comparison server side
|
||||
|
|
@ -325,7 +325,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
|||
|
||||
void FlightPathMovementGenerator::DoReset(Player* player)
|
||||
{
|
||||
player->getHostileRefManager().setOnlineOfflineState(false);
|
||||
player->getHostileRefMgr().setOnlineOfflineState(false);
|
||||
player->AddUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "MovementGenerator.h"
|
||||
#include "Player.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WaypointMgr.h"
|
||||
|
||||
#define FLIGHT_TRAVEL_UPDATE 100
|
||||
#define TIMEDIFF_NEXT_WP 250
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "DatabaseEnv.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Log.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WaypointMgr.h"
|
||||
|
||||
WaypointMgr::WaypointMgr()
|
||||
{
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "Containers.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "Transport.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MapRefMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "WaypointMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
/// Put scripts in the execution queue
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -524,7 +524,7 @@ void WorldSession::LogoutPlayer(bool save)
|
|||
//FIXME: logout must be delayed in case lost connection with client in time of combat
|
||||
if (_player->GetDeathTimer())
|
||||
{
|
||||
_player->getHostileRefManager().deleteReferences();
|
||||
_player->getHostileRefMgr().deleteReferences();
|
||||
_player->BuildPlayerRepop();
|
||||
_player->RepopAtGraveyard();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "AccountMgr.h"
|
||||
#include "AuthDefines.h"
|
||||
#include "AddonMgr.h"
|
||||
#include "BanManager.h"
|
||||
#include "BanMgr.h"
|
||||
#include "CircularBuffer.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
|
|
|
|||
|
|
@ -2435,13 +2435,13 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
|||
// Xinef: replaced with CombatStop(false)
|
||||
target->AttackStop();
|
||||
target->RemoveAllAttackers();
|
||||
target->getHostileRefManager().addThreatPercent(-100);
|
||||
target->getHostileRefMgr().addThreatPercent(-100);
|
||||
target->ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
|
||||
}
|
||||
else
|
||||
{
|
||||
target->CombatStop();
|
||||
target->getHostileRefManager().deleteReferences();
|
||||
target->getHostileRefMgr().deleteReferences();
|
||||
}
|
||||
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
|
|
@ -2999,7 +2999,7 @@ void AuraEffect::HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 m
|
|||
|
||||
Unit* caster = GetCaster();
|
||||
if (caster && caster->IsAlive())
|
||||
target->getHostileRefManager().addTempThreat((float)GetAmount(), apply);
|
||||
target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
|
|
@ -6435,7 +6435,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
|
|||
heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
|
||||
|
||||
int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal);
|
||||
caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo());
|
||||
caster->getHostileRefMgr().threatAssist(caster, gain * 0.5f, GetSpellInfo());
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const
|
||||
|
|
@ -6573,7 +6573,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
|||
target->SendPeriodicAuraLog(&pInfo);
|
||||
|
||||
if (caster)
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
|
||||
bool haveCastItem = GetBase()->GetCastItemGUID();
|
||||
|
||||
|
|
@ -6711,7 +6711,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
|||
int32 gain = target->ModifyPower(PowerType, amount);
|
||||
|
||||
if (caster)
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const
|
||||
|
|
@ -6745,7 +6745,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
|||
int32 gain = target->ModifyPower(PowerType, amount);
|
||||
|
||||
if (caster)
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "MMapManager.h"
|
||||
#include "MMapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -2567,7 +2567,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
|||
}
|
||||
|
||||
int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit);
|
||||
unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
|
||||
unitTarget->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
|
||||
m_healing = gain;
|
||||
|
||||
// Xinef: if heal acutally healed something, add no overheal flag
|
||||
|
|
@ -2826,7 +2826,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
|||
if (unit->IsInCombat() && !m_spellInfo->HasAttribute(SPELL_ATTR3_SUPRESS_TARGET_PROCS) && !m_triggeredByAuraSpell)
|
||||
{
|
||||
m_caster->SetInCombatState(unit->GetCombatTimer() > 0, unit);
|
||||
unit->getHostileRefManager().threatAssist(m_caster, 0.0f);
|
||||
unit->getHostileRefMgr().threatAssist(m_caster, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5149,7 +5149,7 @@ void Spell::HandleThreatSpells()
|
|||
bool IsFriendly = m_caster->IsFriendlyTo(target);
|
||||
// positive spells distribute threat among all units that are in combat with target, like healing
|
||||
if (m_spellInfo->_IsPositiveSpell() && IsFriendly)
|
||||
target->getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo);
|
||||
target->getHostileRefMgr().threatAssist(m_caster, threatToAdd, m_spellInfo);
|
||||
// for negative spells threat gets distributed among affected targets
|
||||
else if (!m_spellInfo->_IsPositiveSpell() && !IsFriendly && target->CanHaveThreatList())
|
||||
target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo);
|
||||
|
|
@ -5239,7 +5239,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER /*&& VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled()*/) // pussywizard: optimization (commented)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER /*&& VMAP::VMapFactory::createOrGetVMapMgr()->isLineOfSightCalcEnabled()*/) // pussywizard: optimization (commented)
|
||||
{
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR0_ONLY_OUTDOORS) &&
|
||||
!m_caster->IsOutdoors())
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
|
|
@ -2628,7 +2628,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
|
|||
|
||||
// put in combat
|
||||
if (unitTarget->IsFriendlyTo(m_caster))
|
||||
unitTarget->getHostileRefManager().threatAssist(m_caster, 0.0f, m_spellInfo);
|
||||
unitTarget->getHostileRefMgr().threatAssist(m_caster, 0.0f, m_spellInfo);
|
||||
|
||||
if (success_list.empty())
|
||||
return;
|
||||
|
|
@ -3270,17 +3270,17 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!unitTarget->getThreatManager().getOnlineContainer().empty())
|
||||
if (!unitTarget->getThreatMgr().getOnlineContainer().empty())
|
||||
{
|
||||
// Also use this effect to set the taunter's threat to the taunted creature's highest value
|
||||
float myThreat = unitTarget->getThreatManager().getThreat(m_caster);
|
||||
float topThreat = unitTarget->getThreatManager().getOnlineContainer().getMostHated()->getThreat();
|
||||
float myThreat = unitTarget->getThreatMgr().getThreat(m_caster);
|
||||
float topThreat = unitTarget->getThreatMgr().getOnlineContainer().getMostHated()->getThreat();
|
||||
if (topThreat > myThreat)
|
||||
unitTarget->getThreatManager().doAddThreat(m_caster, topThreat - myThreat);
|
||||
unitTarget->getThreatMgr().doAddThreat(m_caster, topThreat - myThreat);
|
||||
|
||||
//Set aggro victim to caster
|
||||
if (HostileReference* forcedVictim = unitTarget->getThreatManager().getOnlineContainer().getReferenceByTarget(m_caster))
|
||||
unitTarget->getThreatManager().setCurrentVictim(forcedVictim);
|
||||
if (HostileReference* forcedVictim = unitTarget->getThreatMgr().getOnlineContainer().getReferenceByTarget(m_caster))
|
||||
unitTarget->getThreatMgr().setCurrentVictim(forcedVictim);
|
||||
}
|
||||
|
||||
if (unitTarget->ToCreature()->IsAIEnabled && !unitTarget->ToCreature()->HasReactState(REACT_PASSIVE))
|
||||
|
|
@ -4230,21 +4230,21 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
|
|||
|
||||
if (unitTarget->GetInstanceScript() && unitTarget->GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
unitTarget->getHostileRefManager().UpdateVisibility(true);
|
||||
unitTarget->getHostileRefMgr().UpdateVisibility(true);
|
||||
// Xinef: replaced with CombatStop(false)
|
||||
unitTarget->AttackStop();
|
||||
unitTarget->RemoveAllAttackers();
|
||||
|
||||
// Night Elf: Shadowmeld only resets threat temporarily
|
||||
if (m_spellInfo->Id != 59646)
|
||||
unitTarget->getHostileRefManager().addThreatPercent(-100);
|
||||
unitTarget->getHostileRefMgr().addThreatPercent(-100);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
unitTarget->ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
|
||||
}
|
||||
else
|
||||
{
|
||||
unitTarget->getHostileRefManager().UpdateVisibility(m_spellInfo->Id == 59646); // Night Elf: Shadowmeld
|
||||
unitTarget->getHostileRefMgr().UpdateVisibility(m_spellInfo->Id == 59646); // Night Elf: Shadowmeld
|
||||
unitTarget->CombatStop(true);
|
||||
}
|
||||
|
||||
|
|
@ -5327,7 +5327,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
|
|||
|
||||
// put in combat
|
||||
if (unitTarget->IsFriendlyTo(m_caster))
|
||||
unitTarget->getHostileRefManager().threatAssist(m_caster, 0.0f, m_spellInfo);
|
||||
unitTarget->getHostileRefMgr().threatAssist(m_caster, 0.0f, m_spellInfo);
|
||||
}
|
||||
|
||||
void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
|
||||
|
|
@ -5467,7 +5467,7 @@ void Spell::EffectModifyThreatPercent(SpellEffIndex /*effIndex*/)
|
|||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
unitTarget->getThreatManager().modifyThreatPercent(m_caster, damage);
|
||||
unitTarget->getThreatMgr().modifyThreatPercent(m_caster, damage);
|
||||
}
|
||||
|
||||
void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "DBCStores.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "SharedDefines.h"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "AccountMgr.h"
|
||||
#include "BanManager.h"
|
||||
#include "BanMgr.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
#include "LootItemStorage.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MMapFactory.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
#include "TransportMgr.h"
|
||||
#include "Util.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "VMapManager2.h"
|
||||
#include "VMapMgr2.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Warden.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
|
|
@ -1269,8 +1269,8 @@ void World::LoadConfigSettings(bool reload)
|
|||
if (!enableHeight)
|
||||
LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
|
||||
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->setEnableLineOfSightCalc(enableLOS);
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight);
|
||||
VMAP::VMapFactory::createOrGetVMapMgr()->setEnableLineOfSightCalc(enableLOS);
|
||||
VMAP::VMapFactory::createOrGetVMapMgr()->setEnableHeightCalc(enableHeight);
|
||||
LOG_INFO("server.loading", "WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS);
|
||||
|
||||
m_bool_configs[CONFIG_PET_LOS] = sConfigMgr->GetOption<bool>("vmap.petLOS", true);
|
||||
|
|
@ -1426,8 +1426,8 @@ void World::SetInitialWorldSettings()
|
|||
LOG_INFO("server.loading", "Initializing Scripts...");
|
||||
sScriptMgr->Initialize();
|
||||
|
||||
///- Initialize VMapManager function pointers (to untangle game/collision circular deps)
|
||||
VMAP::VMapManager2* vmmgr2 = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
///- Initialize VMapMgr function pointers (to untangle game/collision circular deps)
|
||||
VMAP::VMapMgr2* vmmgr2 = VMAP::VMapFactory::createOrGetVMapMgr();
|
||||
vmmgr2->GetLiquidFlagsPtr = &GetLiquidFlags;
|
||||
vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor;
|
||||
|
||||
|
|
@ -1443,15 +1443,15 @@ void World::SetInitialWorldSettings()
|
|||
if (!sConfigMgr->isDryRun())
|
||||
{
|
||||
///- Check the existence of the map files for all starting areas.
|
||||
if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f)
|
||||
|| !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
||||
|| !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
|
||||
|| !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -2917.58f, -257.98f)
|
||||
if (!MapMgr::ExistMapAndVMap(0, -6240.32f, 331.033f)
|
||||
|| !MapMgr::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
||||
|| !MapMgr::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
||||
|| !MapMgr::ExistMapAndVMap(0, 1676.35f, 1677.45f)
|
||||
|| !MapMgr::ExistMapAndVMap(1, 10311.3f, 832.463f)
|
||||
|| !MapMgr::ExistMapAndVMap(1, -2917.58f, -257.98f)
|
||||
|| (m_int_configs[CONFIG_EXPANSION] && (
|
||||
!MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
|
||||
!MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
|
||||
!MapMgr::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
|
||||
!MapMgr::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -1502,7 +1502,7 @@ void World::SetInitialWorldSettings()
|
|||
|
||||
vmmgr2->InitializeThreadUnsafe(mapIds);
|
||||
|
||||
MMAP::MMapManager* mmmgr = MMAP::MMapFactory::createOrGetMMapManager();
|
||||
MMAP::MMapMgr* mmmgr = MMAP::MMapFactory::createOrGetMMapMgr();
|
||||
mmmgr->InitializeThreadUnsafe(mapIds);
|
||||
|
||||
LOG_INFO("server.loading", "Loading Game Graveyard...");
|
||||
|
|
@ -1960,7 +1960,7 @@ void World::SetInitialWorldSettings()
|
|||
///- Initilize static helper structures
|
||||
AIRegistry::Initialize();
|
||||
|
||||
///- Initialize MapManager
|
||||
///- Initialize MapMgr
|
||||
LOG_INFO("server.loading", "Starting Map System");
|
||||
LOG_INFO("server.loading", " ");
|
||||
sMapMgr->Initialize();
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue