feat(Core/Misc): remove and replace ACE_Singleton (#2418)

This commit is contained in:
Kargatum
2019-12-21 00:29:29 +07:00
committed by GitHub
parent 16b45bf334
commit 4a8f1de538
88 changed files with 486 additions and 250 deletions

View File

@@ -158,6 +158,12 @@ World::~World()
//TODO free addSessQueue
}
World* World::instance()
{
static World instance;
return &instance;
}
/// Find a player in a specified zone
Player* World::FindPlayerInZone(uint32 zone)
{
@@ -182,7 +188,7 @@ bool World::IsClosed() const
{
return m_isClosed;
}
void World::SetClosed(bool val)
{
m_isClosed = val;

View File

@@ -13,7 +13,6 @@
#include "Common.h"
#include "Timer.h"
#include <ace/Singleton.h>
#include <ace/Atomic_Op.h>
#include "SharedDefines.h"
#include "QueryResult.h"
@@ -563,11 +562,13 @@ struct PetitionData
class World
{
public:
static uint32 m_worldLoopCounter;
World();
~World();
static World* instance();
static uint32 m_worldLoopCounter;
WorldSession* FindSession(uint32 id) const;
WorldSession* FindOfflineSession(uint32 id) const;
WorldSession* FindOfflineSessionForCharacterGUID(uint32 guidLow) const;
@@ -897,7 +898,7 @@ class World
std::string m_configFileList;
};
#define sWorld ACE_Singleton<World, ACE_Null_Mutex>::instance()
#define sWorld World::instance()
#endif
/// @}