TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
RealmList Class Reference

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

#include <RealmList.h>

Public Types

typedef std::map< Battlenet::RealmHandle, std::shared_ptr< Realm > > RealmMap
 

Public Member Functions

 RealmList (RealmList const &)=delete
 
 RealmList (RealmList &&)=delete
 
RealmListoperator= (RealmList const &)=delete
 
RealmListoperator= (RealmList &&)=delete
 
 ~RealmList ()
 
void Initialize (Trinity::Asio::IoContext &ioContext, uint32 updateInterval)
 
void Close ()
 
std::shared_ptr< Realm const > GetRealm (Battlenet::RealmHandle const &id) const
 
Battlenet::RealmHandle GetCurrentRealmId () const
 
void SetCurrentRealmId (Battlenet::RealmHandle const &id)
 
std::shared_ptr< Realm const > GetCurrentRealm () const
 
void WriteSubRegions (bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse *response) const
 
std::vector< uint8GetRealmEntryJSON (Battlenet::RealmHandle const &id, uint32 build, AccountTypes accountSecurityLevel) const
 
std::vector< uint8GetRealmList (uint32 build, AccountTypes accountSecurityLevel, std::string const &subRegion) const
 
uint32 JoinRealm (uint32 realmAddress, uint32 build, ClientBuild::VariantId const &buildVariant, boost::asio::ip::address const &clientAddress, std::array< uint8, 32 > const &clientSecret, LocaleConstant locale, std::string const &os, Minutes timezoneOffset, std::string const &accountName, AccountTypes accountSecurityLevel, bgs::protocol::game_utilities::v1::ClientResponse *response) const
 

Static Public Member Functions

static RealmListInstance ()
 

Private Member Functions

 RealmList ()
 
void UpdateRealms ()
 
void FillRealmEntry (Realm const &realm, uint32 clientBuild, AccountTypes accountSecurityLevel, JSON::RealmList::RealmEntry *realmEntry) const
 

Static Private Member Functions

static void UpdateRealm (Realm &realm, Battlenet::RealmHandle const &id, uint32 build, std::string const &name, std::vector< boost::asio::ip::address > &&addresses, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, RealmPopulationState population)
 

Private Attributes

std::shared_mutex _realmsMutex
 
RealmMap _realms
 
std::map< Battlenet::RealmHandle, std::string > _removedRealms
 
std::unordered_set< std::string > _subRegions
 
uint32 _updateInterval
 
std::unique_ptr< Trinity::Asio::DeadlineTimer_updateTimer
 
std::unique_ptr< Trinity::Net::Resolver_resolver
 
Optional< Battlenet::RealmHandle_currentRealmId
 

Detailed Description

Storage object for the list of realms on the server.

Definition at line 45 of file RealmList.h.

Member Typedef Documentation

◆ RealmMap

typedef std::map<Battlenet::RealmHandle, std::shared_ptr<Realm> > RealmList::RealmMap

Definition at line 48 of file RealmList.h.

Constructor & Destructor Documentation

◆ RealmList() [1/3]

RealmList::RealmList ( RealmList const &  )
delete

◆ RealmList() [2/3]

RealmList::RealmList ( RealmList &&  )
delete

◆ ~RealmList()

RealmList::~RealmList ( )
default

◆ RealmList() [3/3]

RealmList::RealmList ( )
private

Definition at line 54 of file RealmList.cpp.

Member Function Documentation

◆ Close()

void RealmList::Close ( )

Definition at line 78 of file RealmList.cpp.

◆ FillRealmEntry()

void RealmList::FillRealmEntry ( Realm const &  realm,
uint32  clientBuild,
AccountTypes  accountSecurityLevel,
JSON::RealmList::RealmEntry realmEntry 
) const
private

Definition at line 244 of file RealmList.cpp.

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

◆ GetCurrentRealm()

std::shared_ptr< Realm const > RealmList::GetCurrentRealm ( ) const

Definition at line 230 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ GetCurrentRealmId()

Battlenet::RealmHandle RealmList::GetCurrentRealmId ( ) const

Definition at line 220 of file RealmList.cpp.

◆ GetRealm()

std::shared_ptr< Realm const > RealmList::GetRealm ( Battlenet::RealmHandle const &  id) const

Definition at line 214 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,
AccountTypes  accountSecurityLevel 
) const

Definition at line 282 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ GetRealmList()

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

Definition at line 300 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 67 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ Instance()

RealmList * RealmList::Instance ( )
static

Definition at line 60 of file RealmList.cpp.

◆ JoinRealm()

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

Definition at line 332 of file RealmList.cpp.

+ Here is the call graph for this function:

◆ operator=() [1/2]

RealmList & RealmList::operator= ( RealmList &&  )
delete

◆ operator=() [2/2]

RealmList & RealmList::operator= ( RealmList const &  )
delete

◆ SetCurrentRealmId()

void RealmList::SetCurrentRealmId ( Battlenet::RealmHandle const &  id)

Definition at line 225 of file RealmList.cpp.

◆ UpdateRealm()

void RealmList::UpdateRealm ( Realm realm,
Battlenet::RealmHandle const &  id,
uint32  build,
std::string const &  name,
std::vector< boost::asio::ip::address > &&  addresses,
uint16  port,
uint8  icon,
RealmFlags  flag,
uint8  timezone,
AccountTypes  allowedSecurityLevel,
RealmPopulationState  population 
)
staticprivate

Definition at line 83 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 101 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 237 of file RealmList.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _currentRealmId

Optional<Battlenet::RealmHandle> RealmList::_currentRealmId
private

Definition at line 90 of file RealmList.h.

◆ _realms

RealmMap RealmList::_realms
private

Definition at line 84 of file RealmList.h.

◆ _realmsMutex

std::shared_mutex RealmList::_realmsMutex
mutableprivate

Definition at line 83 of file RealmList.h.

◆ _removedRealms

std::map<Battlenet::RealmHandle, std::string> RealmList::_removedRealms
private

Definition at line 85 of file RealmList.h.

◆ _resolver

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

Definition at line 89 of file RealmList.h.

◆ _subRegions

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

Definition at line 86 of file RealmList.h.

◆ _updateInterval

uint32 RealmList::_updateInterval
private

Definition at line 87 of file RealmList.h.

◆ _updateTimer

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

Definition at line 88 of file RealmList.h.


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