Set use mtmaps by default, and cleanup some code in MapManager.
TODO: Set MapUpdate.Threads=0 in config, for full disable mtmaps, for correct work mtmaps, need ACE 5.7.2+, recommend 5.7.5 --HG-- branch : trunk
This commit is contained in:
@@ -23,7 +23,6 @@ OPTION(DO_DEBUG "Debug mode" 0)
|
|||||||
OPTION(DO_WARN "Enable all compile warnings" 0)
|
OPTION(DO_WARN "Enable all compile warnings" 0)
|
||||||
OPTION(LARGE_CELL "Large cell size" 0)
|
OPTION(LARGE_CELL "Large cell size" 0)
|
||||||
OPTION(CENTOS "CENTOS" 0)
|
OPTION(CENTOS "CENTOS" 0)
|
||||||
OPTION(USE_MULTI_THREAD_MAP "With Multithread maps" 0)
|
|
||||||
|
|
||||||
SET(GENREV_SRC
|
SET(GENREV_SRC
|
||||||
src/tools/genrevision/genrevision.cpp
|
src/tools/genrevision/genrevision.cpp
|
||||||
@@ -101,10 +100,6 @@ SET(SCRIPT_LIB trinityinterface)
|
|||||||
SET(SCRIPT_INCLUDE src/bindings/interface)
|
SET(SCRIPT_INCLUDE src/bindings/interface)
|
||||||
endif(DO_SCRIPTS)
|
endif(DO_SCRIPTS)
|
||||||
|
|
||||||
IF (USE_MULTI_THREAD_MAP)
|
|
||||||
message("* With Multithread maps")
|
|
||||||
ENDIF (USE_MULTI_THREAD_MAP)
|
|
||||||
|
|
||||||
message("-- Miscellaneus options:")
|
message("-- Miscellaneus options:")
|
||||||
|
|
||||||
if(DO_CLI)
|
if(DO_CLI)
|
||||||
|
|||||||
@@ -155,19 +155,8 @@ typedef uint64 OBJECT_HANDLE;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(DEBUG) && !defined(MANGOS_DEBUG) && !defined(TRINITY_DEBUG)
|
|
||||||
#if defined(USE_MULTI_THREAD_MAP)
|
|
||||||
#define MULTI_THREAD_MAP
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MULTI_THREAD_MAP
|
|
||||||
#define MAP_BASED_RAND_GEN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CLIENT_VER
|
#ifndef CLIENT_VER
|
||||||
#define CLIENT_VER 313
|
#define CLIENT_VER 313
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //TRINITY_DEFINE_H
|
#endif //TRINITY_DEFINE_H
|
||||||
|
|
||||||
|
|||||||
+11
-30
@@ -42,8 +42,9 @@ INSTANTIATE_CLASS_MUTEX(MapManager, ACE_Thread_Mutex);
|
|||||||
|
|
||||||
extern GridState* si_GridStates[]; // debugging code, should be deleted some day
|
extern GridState* si_GridStates[]; // debugging code, should be deleted some day
|
||||||
|
|
||||||
MapManager::MapManager() : i_gridCleanUpDelay(sWorld.getConfig(CONFIG_INTERVAL_GRIDCLEAN))
|
MapManager::MapManager()
|
||||||
{
|
{
|
||||||
|
i_gridCleanUpDelay = sWorld.getConfig(CONFIG_INTERVAL_GRIDCLEAN);
|
||||||
i_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_MAPUPDATE));
|
i_timer.SetInterval(sWorld.getConfig(CONFIG_INTERVAL_MAPUPDATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +59,7 @@ MapManager::~MapManager()
|
|||||||
Map::DeleteStateMachine();
|
Map::DeleteStateMachine();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapManager::Initialize()
|
||||||
MapManager::Initialize()
|
|
||||||
{
|
{
|
||||||
Map::InitStateMachine();
|
Map::InitStateMachine();
|
||||||
|
|
||||||
@@ -70,12 +70,10 @@ MapManager::Initialize()
|
|||||||
|
|
||||||
i_GridStateErrorCount = 0;
|
i_GridStateErrorCount = 0;
|
||||||
}
|
}
|
||||||
#ifdef MULTI_THREAD_MAP
|
|
||||||
int num_threads(sWorld.getConfig(CONFIG_NUMTHREADS));
|
int num_threads(sWorld.getConfig(CONFIG_NUMTHREADS));
|
||||||
// Start mtmaps if needed.
|
// Start mtmaps if needed.
|
||||||
if (num_threads > 0 && m_updater.activate(num_threads) == -1)
|
if (num_threads > 0 && m_updater.activate(num_threads) == -1)
|
||||||
abort();
|
abort();
|
||||||
#endif
|
|
||||||
|
|
||||||
InitMaxInstanceId();
|
InitMaxInstanceId();
|
||||||
}
|
}
|
||||||
@@ -111,8 +109,7 @@ void MapManager::checkAndCorrectGridStatesArray()
|
|||||||
++i_GridStateErrorCount;
|
++i_GridStateErrorCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map*
|
Map* MapManager::_createBaseMap(uint32 id)
|
||||||
MapManager::_createBaseMap(uint32 id)
|
|
||||||
{
|
{
|
||||||
Map *m = _findMap(id);
|
Map *m = _findMap(id);
|
||||||
|
|
||||||
@@ -159,14 +156,11 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
|
|||||||
return ((MapInstanced*)map)->FindMap(instanceId);
|
return ((MapInstanced*)map)->FindMap(instanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
checks that do not require a map to be created
|
|
||||||
will send transfer error messages on fail
|
|
||||||
*/
|
|
||||||
bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
||||||
{
|
{
|
||||||
const MapEntry *entry = sMapStore.LookupEntry(mapid);
|
const MapEntry *entry = sMapStore.LookupEntry(mapid);
|
||||||
if(!entry) return false;
|
if(!entry)
|
||||||
|
return false;
|
||||||
const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
|
const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
|
||||||
|
|
||||||
if(entry->map_type == MAP_INSTANCE || entry->map_type == MAP_RAID)
|
if(entry->map_type == MAP_INSTANCE || entry->map_type == MAP_RAID)
|
||||||
@@ -186,8 +180,6 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
|||||||
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
|
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Åñëè ÈÊ èëè È×, òî ïðîâåðÿòü óðîâåíü øìîòà îäåòîãî íà ïåðñå.
|
|
||||||
//if (mapid == 649)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,15 +289,13 @@ void MapManager::RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapManager::Update(uint32 diff)
|
||||||
MapManager::Update(uint32 diff)
|
|
||||||
{
|
{
|
||||||
i_timer.Update(diff);
|
i_timer.Update(diff);
|
||||||
if (!i_timer.Passed())
|
if (!i_timer.Passed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MapMapType::iterator iter = i_maps.begin();
|
MapMapType::iterator iter = i_maps.begin();
|
||||||
#ifdef MULTI_THREAD_MAP
|
|
||||||
for (; iter != i_maps.end(); ++iter)
|
for (; iter != i_maps.end(); ++iter)
|
||||||
{
|
{
|
||||||
if (m_updater.activated())
|
if (m_updater.activated())
|
||||||
@@ -317,22 +307,13 @@ MapManager::Update(uint32 diff)
|
|||||||
}
|
}
|
||||||
if (m_updater.activated())
|
if (m_updater.activated())
|
||||||
m_updater.wait();
|
m_updater.wait();
|
||||||
#else
|
|
||||||
for (; iter != i_maps.end(); ++iter)
|
|
||||||
{
|
|
||||||
iter->second->Update(i_timer.GetCurrent());
|
|
||||||
sWorld.RecordTimeDiff("UpdateMap %u", iter->second->GetId());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
for (iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||||
iter->second->DelayedUpdate(i_timer.GetCurrent());
|
iter->second->DelayedUpdate(i_timer.GetCurrent());
|
||||||
|
|
||||||
ObjectAccessor::Instance().Update(i_timer.GetCurrent());
|
ObjectAccessor::Instance().Update(i_timer.GetCurrent());
|
||||||
sWorld.RecordTimeDiff("UpdateObjectAccessor");
|
|
||||||
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)
|
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)
|
||||||
(*iter)->Update(i_timer.GetCurrent());
|
(*iter)->Update(i_timer.GetCurrent());
|
||||||
sWorld.RecordTimeDiff("UpdateTransports");
|
|
||||||
|
|
||||||
i_timer.SetCurrent(0);
|
i_timer.SetCurrent(0);
|
||||||
}
|
}
|
||||||
@@ -369,10 +350,8 @@ void MapManager::UnloadAll()
|
|||||||
i_maps.erase(i_maps.begin());
|
i_maps.erase(i_maps.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MULTI_THREAD_MAP
|
|
||||||
if (m_updater.activated())
|
if (m_updater.activated())
|
||||||
m_updater.deactivate();
|
m_updater.deactivate();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapManager::InitMaxInstanceId()
|
void MapManager::InitMaxInstanceId()
|
||||||
@@ -395,7 +374,8 @@ uint32 MapManager::GetNumInstances()
|
|||||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||||
{
|
{
|
||||||
Map *map = itr->second;
|
Map *map = itr->second;
|
||||||
if(!map->Instanceable()) continue;
|
if (!map->Instanceable())
|
||||||
|
continue;
|
||||||
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
||||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||||
if(mitr->second->IsDungeon()) ret++;
|
if(mitr->second->IsDungeon()) ret++;
|
||||||
@@ -411,7 +391,8 @@ uint32 MapManager::GetNumPlayersInInstances()
|
|||||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||||
{
|
{
|
||||||
Map *map = itr->second;
|
Map *map = itr->second;
|
||||||
if(!map->Instanceable()) continue;
|
if (!map->Instanceable())
|
||||||
|
continue;
|
||||||
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
||||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||||
if (mitr->second->IsDungeon())
|
if (mitr->second->IsDungeon())
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
class Transport;
|
class Transport;
|
||||||
|
|
||||||
#define DEFAULT_VISIBILITY_NOTIFY_PERIOD 1000
|
#define DEFAULT_VISIBILITY_NOTIFY_PERIOD 1100
|
||||||
|
|
||||||
class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinity::ClassLevelLockable<MapManager, ACE_Thread_Mutex> >
|
class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinity::ClassLevelLockable<MapManager, ACE_Thread_Mutex> >
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4772,16 +4772,6 @@ void AuraEffect::HandlePeriodicTriggerSpell(bool apply, bool Real, bool /*change
|
|||||||
void AuraEffect::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real, bool /*changeAmount*/)
|
void AuraEffect::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real, bool /*changeAmount*/)
|
||||||
{
|
{
|
||||||
m_isPeriodic = apply;
|
m_isPeriodic = apply;
|
||||||
|
|
||||||
SpellEntry const* spell = GetSpellProto();
|
|
||||||
switch (spell->Id)
|
|
||||||
{
|
|
||||||
case 58730: // No fly zone - Wintergrasp (3.1.3 only 3.2.2 Does not call this aura)
|
|
||||||
if (apply)
|
|
||||||
if (m_target->GetTypeId() == TYPEID_PLAYER)
|
|
||||||
((Player *)m_target)->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuraEffect::HandlePeriodicEnergize(bool apply, bool Real, bool changeAmount)
|
void AuraEffect::HandlePeriodicEnergize(bool apply, bool Real, bool changeAmount)
|
||||||
|
|||||||
Reference in New Issue
Block a user