aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapManager.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-06-25 00:18:01 +0200
committerMachiavelli <none@none>2010-06-25 00:18:01 +0200
commit0f7657b68c8b6444fadb480cdd0f87631391afa5 (patch)
treea5ffdaecbb1332ffbc655916842a23a622340c98 /src/server/game/Maps/MapManager.cpp
parenta6b9e716a61334e218cff227f66b0c51053e72f3 (diff)
Get rid of Trinity Singleton and Threading patterns and replace them with ACE_Singletons and ACE_GUARD_x macro´s with ACE_Thread_Mutex´es respectively.
Also get rid of unused CountedReference class that used Trinity threading pattern. --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Maps/MapManager.cpp')
-rw-r--r--src/server/game/Maps/MapManager.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 42233db4a9a..46b604388c5 100644
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -20,7 +20,6 @@
#include "MapManager.h"
#include "InstanceSaveMgr.h"
-#include "SingletonImp.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -37,10 +36,6 @@
#include "Language.h"
#include "WorldPacket.h"
-#define CLASS_LOCK Trinity::ClassLevelLockable<MapManager, ACE_Thread_Mutex>
-INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK);
-INSTANTIATE_CLASS_MUTEX(MapManager, ACE_Thread_Mutex);
-
extern GridState* si_GridStates[]; // debugging code, should be deleted some day
MapManager::MapManager()
@@ -116,7 +111,7 @@ Map* MapManager::_createBaseMap(uint32 id)
if (m == NULL)
{
- Guard guard(*this);
+ ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
const MapEntry* entry = sMapStore.LookupEntry(id);
if (entry && entry->Instanceable())
@@ -236,7 +231,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(player);
if (boundedInstance && boundedInstance->save)
{
- if (Map *boundedMap = MapManager::Instance().FindMap(mapid,boundedInstance->save->GetInstanceId()))
+ if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId()))
{
// Player permanently bounded to different instance than groups one
InstancePlayerBind* playerBoundedInstance = player->GetBoundInstance(mapid, player->GetDungeonDifficulty());
@@ -307,7 +302,7 @@ void MapManager::Update(uint32 diff)
for (iter = i_maps.begin(); iter != i_maps.end(); ++iter)
iter->second->DelayedUpdate(i_timer.GetCurrent());
- ObjectAccessor::Instance().Update(i_timer.GetCurrent());
+ sObjectAccessor.Update(i_timer.GetCurrent());
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)
(*iter)->Update(i_timer.GetCurrent());
@@ -361,7 +356,7 @@ void MapManager::InitMaxInstanceId()
uint32 MapManager::GetNumInstances()
{
- Guard guard(*this);
+ ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
uint32 ret = 0;
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
@@ -378,7 +373,7 @@ uint32 MapManager::GetNumInstances()
uint32 MapManager::GetNumPlayersInInstances()
{
- Guard guard(*this);
+ ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
uint32 ret = 0;
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)