TrinityCore
RealmList Class Reference

Storage object for the list of realms on the server. More...

#include <RealmList.h>

Public Types

typedef std::map< Battlenet::RealmHandle, RealmRealmMap
 

Public Member Functions

 ~RealmList ()
 
void Initialize (Trinity::Asio::IoContext &ioContext, uint32 updateInterval)
 
void Close ()
 
Realm const * GetRealm (Battlenet::RealmHandle const &id) const
 
bool GetRealmNames (Battlenet::RealmHandle const &id, std::string *name, std::string *normalizedName) const
 
RealmBuildInfo const * GetBuildInfo (uint32 build) const
 
uint32 GetMinorMajorBugfixVersionForBuild (uint32 build) const
 
void WriteSubRegions (bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse *response) const
 
std::vector< uint8GetRealmEntryJSON (Battlenet::RealmHandle const &id, uint32 build) const
 
std::vector< uint8GetRealmList (uint32 build, std::string const &subRegion) const
 
uint32 JoinRealm (uint32 realmAddress, uint32 build, boost::asio::ip::address const &clientAddress, std::array< uint8, 32 > const &clientSecret, LocaleConstant locale, std::string const &os, Minutes timezoneOffset, std::string const &accountName, bgs::protocol::game_utilities::v1::ClientResponse *response) const
 

Static Public Member Functions

static RealmListInstance ()
 

Private Member Functions

 RealmList ()
 
void LoadBuildInfo ()
 
void UpdateRealms ()
 
void UpdateRealm (Realm &realm, Battlenet::RealmHandle const &id, uint32 build, std::string const &name, boost::asio::ip::address &&address, boost::asio::ip::address &&localAddr, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population)
 

Private Attributes

std::vector< RealmBuildInfo_builds
 
std::shared_mutex _realmsMutex
 
RealmMap _realms
 
std::unordered_set< std::string > _subRegions
 
uint32 _updateInterval
 
std::unique_ptr< Trinity::Asio::DeadlineTimer_updateTimer
 
std::unique_ptr< Trinity::Asio::Resolver_resolver
 

Detailed Description

Storage object for the list of realms on the server.

Definition at line 54 of file RealmList.h.

Member Typedef Documentation

◆ RealmMap

Definition at line 57 of file RealmList.h.

Constructor & Destructor Documentation

◆ ~RealmList()

RealmList::~RealmList ( )
default

◆ RealmList()

RealmList::RealmList ( )
private

Definition at line 35 of file RealmList.cpp.

Member Function Documentation

◆ Close()

void RealmList::Close ( )

Definition at line 59 of file RealmList.cpp.

◆ GetBuildInfo()

RealmBuildInfo const * RealmList::GetBuildInfo ( uint32  build) const

Definition at line 235 of file RealmList.cpp.

+ Here is the caller graph for this function:

◆ GetMinorMajorBugfixVersionForBuild()

uint32 RealmList::GetMinorMajorBugfixVersionForBuild ( uint32  build) const

Definition at line 244 of file RealmList.cpp.

◆ GetRealm()

Realm const * RealmList::GetRealm ( Battlenet::RealmHandle const &  id) const

Definition at line 217 of file RealmList.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRealmEntryJSON()

std::vector< uint8 > RealmList::GetRealmEntryJSON ( Battlenet::RealmHandle const &  id,
uint32  build 
) const

Definition at line 260 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ GetRealmList()

std::vector< uint8 > RealmList::GetRealmList ( uint32  build,
std::string const &  subRegion 
) const

Definition at line 314 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ GetRealmNames()

bool RealmList::GetRealmNames ( Battlenet::RealmHandle const &  id,
std::string *  name,
std::string *  normalizedName 
) const

Definition at line 223 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ Initialize()

void RealmList::Initialize ( Trinity::Asio::IoContext ioContext,
uint32  updateInterval 
)

Definition at line 48 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ Instance()

RealmList * RealmList::Instance ( )
static

Definition at line 41 of file RealmList.cpp.

◆ JoinRealm()

uint32 RealmList::JoinRealm ( uint32  realmAddress,
uint32  build,
boost::asio::ip::address const &  clientAddress,
std::array< uint8, 32 > const &  clientSecret,
LocaleConstant  locale,
std::string const &  os,
Minutes  timezoneOffset,
std::string const &  accountName,
bgs::protocol::game_utilities::v1::ClientResponse response 
) const

Definition at line 374 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ LoadBuildInfo()

void RealmList::LoadBuildInfo ( )
private

Definition at line 64 of file RealmList.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRealm()

void RealmList::UpdateRealm ( Realm realm,
Battlenet::RealmHandle const &  id,
uint32  build,
std::string const &  name,
boost::asio::ip::address &&  address,
boost::asio::ip::address &&  localAddr,
uint16  port,
uint8  icon,
RealmFlags  flag,
uint8  timezone,
AccountTypes  allowedSecurityLevel,
float  population 
)
private

Definition at line 96 of file RealmList.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRealms()

void RealmList::UpdateRealms ( )
private

Definition at line 116 of file RealmList.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WriteSubRegions()

void RealmList::WriteSubRegions ( bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse response) const

Definition at line 253 of file RealmList.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _builds

std::vector<RealmBuildInfo> RealmList::_builds
private

Definition at line 87 of file RealmList.h.

◆ _realms

RealmMap RealmList::_realms
private

Definition at line 89 of file RealmList.h.

◆ _realmsMutex

std::shared_mutex RealmList::_realmsMutex
mutableprivate

Definition at line 88 of file RealmList.h.

◆ _resolver

std::unique_ptr<Trinity::Asio::Resolver> RealmList::_resolver
private

Definition at line 93 of file RealmList.h.

◆ _subRegions

std::unordered_set<std::string> RealmList::_subRegions
private

Definition at line 90 of file RealmList.h.

◆ _updateInterval

uint32 RealmList::_updateInterval
private

Definition at line 91 of file RealmList.h.

◆ _updateTimer

std::unique_ptr<Trinity::Asio::DeadlineTimer> RealmList::_updateTimer
private

Definition at line 92 of file RealmList.h.


The documentation for this class was generated from the following files: