Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
RealmList.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_REALMLIST_H
7#define SF_REALMLIST_H
8
9#include "Common.h"
10#include "NetworkAddress.h"
11#include "Platform/Singleton.h"
12
25
26// Storage object for a realm
43
46{
47public:
48 typedef std::map<std::string, Realm> RealmMap;
49
50 RealmList();
52
53 void Initialize(uint32 updateInterval);
54
55 void UpdateIfNeed();
56
57 void AddRealm(const Realm& NewRealm) { m_realms[NewRealm.name] = NewRealm; }
58
59 RealmMap::const_iterator begin() const { return m_realms.begin(); }
60 RealmMap::const_iterator end() const { return m_realms.end(); }
61 uint32 size() const { return m_realms.size(); }
62
63private:
64 void UpdateRealms(bool init = false);
65 void UpdateRealm(uint32 id, const std::string& name, Skyfire::Net::Address const& address,
66 Skyfire::Net::Address const& localAddr, Skyfire::Net::Address const& localSubmask,
67 uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel,
68 float popu, uint32 build);
69
73};
74
75#define sRealmList Skyfire::Singleton<RealmList, Skyfire::NullMutex>::instance()
76#endif
AccountTypes
Definition Common.h:129
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
RealmFlags
Definition RealmList.h:14
@ REALM_FLAG_NEW
Definition RealmList.h:22
@ REALM_FLAG_OFFLINE
Definition RealmList.h:17
@ REALM_FLAG_UNK1
Definition RealmList.h:19
@ REALM_FLAG_NONE
Definition RealmList.h:15
@ REALM_FLAG_INVALID
Definition RealmList.h:16
@ REALM_FLAG_UNK2
Definition RealmList.h:20
@ REALM_FLAG_RECOMMENDED
Definition RealmList.h:21
@ REALM_FLAG_FULL
Definition RealmList.h:23
@ REALM_FLAG_SPECIFYBUILD
Definition RealmList.h:18
time_t m_NextUpdateTime
Definition RealmList.h:72
uint32 m_UpdateInterval
Definition RealmList.h:71
RealmMap::const_iterator end() const
Definition RealmList.h:60
void AddRealm(const Realm &NewRealm)
Definition RealmList.h:57
RealmMap::const_iterator begin() const
Definition RealmList.h:59
void UpdateRealm(uint32 id, const std::string &name, Skyfire::Net::Address const &address, Skyfire::Net::Address const &localAddr, Skyfire::Net::Address const &localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build)
Definition RealmList.cpp:21
void Initialize(uint32 updateInterval)
Definition RealmList.cpp:13
std::map< std::string, Realm > RealmMap
Definition RealmList.h:48
void UpdateIfNeed()
Definition RealmList.cpp:44
uint32 size() const
Definition RealmList.h:61
RealmMap m_realms
Definition RealmList.h:70
void UpdateRealms(bool init=false)
Definition RealmList.cpp:59
Skyfire::Net::Address LocalAddress
Definition RealmList.h:32
std::string name
Definition RealmList.h:34
RealmFlags flag
Definition RealmList.h:36
AccountTypes allowedSecurityLevel
Definition RealmList.h:39
uint8 icon
Definition RealmList.h:35
uint8 timezone
Definition RealmList.h:37
uint32 m_ID
Definition RealmList.h:38
float populationLevel
Definition RealmList.h:40
Skyfire::Net::Address ExternalAddress
Definition RealmList.h:31
uint32 gamebuild
Definition RealmList.h:41
Realm()
Definition RealmList.h:29
Skyfire::Net::Address LocalSubnetMask
Definition RealmList.h:33