aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Channels
diff options
context:
space:
mode:
authorleak <leak@bitmx.net>2014-07-01 00:54:09 +0200
committerleak <leak@bitmx.net>2014-07-01 00:54:09 +0200
commit029bad6698df6ac9556fe308342e616f4a7a8cc7 (patch)
tree01142dad7e748aba7799b9c296ccc4cf11db886f /src/server/game/Chat/Channels
parentd39a013b6b979a5158bf86c37a197cb902b2c2f9 (diff)
Replaced all remaining ACE based Singletons
Replaced ACE base AutoPtr class with shared_ptr Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
Diffstat (limited to 'src/server/game/Chat/Channels')
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp6
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.h14
2 files changed, 12 insertions, 8 deletions
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 0975a690889..00824ae2056 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -29,13 +29,13 @@ ChannelMgr::~ChannelMgr()
ChannelMgr* ChannelMgr::forTeam(uint32 team)
{
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
- return ACE_Singleton<AllianceChannelMgr, ACE_Null_Mutex>::instance(); // cross-faction
+ return AllianceChannelMgr::instance(); // cross-faction
if (team == ALLIANCE)
- return ACE_Singleton<AllianceChannelMgr, ACE_Null_Mutex>::instance();
+ return AllianceChannelMgr::instance();
if (team == HORDE)
- return ACE_Singleton<HordeChannelMgr, ACE_Null_Mutex>::instance();
+ return HordeChannelMgr::instance();
return NULL;
}
diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h
index 603eb52f589..0fd5cdbfe24 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -20,7 +20,6 @@
#include "Common.h"
#include "Channel.h"
-#include <ace/Singleton.h>
#include <map>
#include <string>
@@ -31,12 +30,17 @@ class ChannelMgr
{
typedef std::map<std::wstring, Channel*> ChannelMap;
- public:
- ChannelMgr() : team(0)
- { }
-
+ protected:
+ ChannelMgr() : team(0) { }
~ChannelMgr();
+ public:
+ static ChannelMgr* instance()
+ {
+ static ChannelMgr* instance = new ChannelMgr();
+ return instance;
+ }
+
static ChannelMgr * forTeam(uint32 team);
void setTeam(uint32 newTeam) { team = newTeam; }