diff options
Diffstat (limited to 'src/server/authserver')
| -rw-r--r-- | src/server/authserver/Main.cpp | 4 | ||||
| -rw-r--r-- | src/server/authserver/Realms/RealmList.h | 6 | ||||
| -rw-r--r-- | src/server/authserver/Server/AuthSession.cpp | 4 | ||||
| -rw-r--r-- | src/server/authserver/Server/BattlenetSession.cpp | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 9fe6fb276a8..a5781171f92 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -101,9 +101,9 @@ int main(int argc, char** argv) return 1; // Get the list of realms for the server - sRealmList.Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20)); + sRealmList->Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20)); - if (sRealmList.size() == 0) + if (sRealmList->size() == 0) { TC_LOG_ERROR("server.authserver", "No valid realms specified."); return 1; diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index beb520df25a..0063b1a60c8 100644 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -71,10 +71,10 @@ class RealmList public: typedef std::map<std::string, Realm> RealmMap; - static RealmList& instance() + static RealmList* instance() { - static RealmList *instance = new RealmList(); - return *instance; + static RealmList instance; + return &instance; } ~RealmList(); diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 3bc51ace67b..560cf75b447 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -759,13 +759,13 @@ bool AuthSession::_HandleRealmList() uint32 id = fields[0].GetUInt32(); // Update realm list if need - sRealmList.UpdateIfNeed(); + sRealmList->UpdateIfNeed(); // Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm) ByteBuffer pkt; size_t RealmListSize = 0; - for (RealmList::RealmMap::const_iterator i = sRealmList.begin(); i != sRealmList.end(); ++i) + for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { const Realm &realm = i->second; // don't work with realms which not compatible with the client diff --git a/src/server/authserver/Server/BattlenetSession.cpp b/src/server/authserver/Server/BattlenetSession.cpp index 3725f5dbff8..127ce109b15 100644 --- a/src/server/authserver/Server/BattlenetSession.cpp +++ b/src/server/authserver/Server/BattlenetSession.cpp @@ -430,7 +430,7 @@ bool Battlenet::Session::HandleDisconnect(PacketHeader& /*header*/, BitStream& / bool Battlenet::Session::HandleRealmUpdateSubscribe(PacketHeader& /*header*/, BitStream& /*packet*/) { - sRealmList.UpdateIfNeed(); + sRealmList->UpdateIfNeed(); RealmCharacterCounts* counts = new RealmCharacterCounts(); @@ -447,7 +447,7 @@ bool Battlenet::Session::HandleRealmUpdateSubscribe(PacketHeader& /*header*/, Bi } while (countResult->NextRow()); } - for (RealmList::RealmMap::const_iterator i = sRealmList.begin(); i != sRealmList.end(); ++i) + for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { Realm const& realm = i->second; @@ -501,7 +501,7 @@ bool Battlenet::Session::HandleRealmJoinRequest(PacketHeader& header, BitStream& join.Read(); RealmJoinResult* result = new RealmJoinResult(); - Realm const* realm = sRealmList.GetRealm(join.Realm); + Realm const* realm = sRealmList->GetRealm(join.Realm); if (!realm || realm->flag & (REALM_FLAG_INVALID | REALM_FLAG_OFFLINE)) { AsyncWrite(result); |
