mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
feat(Core/Misc): remove and replace ACE_Singleton (#2418)
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
|
||||
RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(nullptr)) { }
|
||||
|
||||
RealmList* RealmList::instance()
|
||||
{
|
||||
static RealmList instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
// Load the realm list from the database
|
||||
void RealmList::Initialize(uint32 updateInterval)
|
||||
{
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
#ifndef _REALMLIST_H
|
||||
#define _REALMLIST_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include <ace/Null_Mutex.h>
|
||||
#include <ace/INET_Addr.h>
|
||||
#include "Common.h"
|
||||
#include <ace/INET_Addr.h>
|
||||
|
||||
enum RealmFlags
|
||||
{
|
||||
@@ -50,10 +48,10 @@ public:
|
||||
RealmList();
|
||||
~RealmList() { }
|
||||
|
||||
static RealmList* instance();
|
||||
|
||||
void Initialize(uint32 updateInterval);
|
||||
|
||||
void UpdateIfNeed();
|
||||
|
||||
void AddRealm(const Realm& NewRealm) { m_realms[NewRealm.name] = NewRealm; }
|
||||
|
||||
RealmMap::const_iterator begin() const { return m_realms.begin(); }
|
||||
@@ -69,6 +67,6 @@ private:
|
||||
time_t m_NextUpdateTime;
|
||||
};
|
||||
|
||||
#define sRealmList ACE_Singleton<RealmList, ACE_Null_Mutex>::instance()
|
||||
#define sRealmList RealmList::instance()
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user