DDraceNetwork Docs
CServerBrowserHttp Class Reference
Inheritance diagram for CServerBrowserHttp:
[legend]
Collaboration diagram for CServerBrowserHttp:
[legend]

Public Member Functions

 CServerBrowserHttp (IEngine *pEngine, IHttp *pHttp, const char **ppUrls, int NumUrls, int PreviousBestIndex)
 
 ~CServerBrowserHttp () override
 
void Update () override
 
bool IsRefreshing () override
 
void Refresh () override
 
bool GetBestUrl (const char **pBestUrl) const override
 
int NumServers () const override
 
const CServerInfoServer (int Index) const override
 
- Public Member Functions inherited from IServerBrowserHttp
virtual ~IServerBrowserHttp ()
 
virtual void Update ()=0
 
virtual bool IsRefreshing ()=0
 
virtual void Refresh ()=0
 
virtual bool GetBestUrl (const char **pBestUrl) const =0
 
virtual int NumServers () const =0
 
virtual const CServerInfoServer (int Index) const =0
 

Private Types

enum  { STATE_DONE , STATE_WANTREFRESH , STATE_REFRESHING , STATE_NO_MASTER }
 

Static Private Member Functions

static bool Validate (json_value *pJson)
 
static bool Parse (json_value *pJson, std::vector< CServerInfo > *pvServers)
 

Private Attributes

IHttpm_pHttp
 
int m_State = STATE_DONE
 
std::shared_ptr< CHttpRequestm_pGetServers
 
std::unique_ptr< CChooseMasterm_pChooseMaster
 
std::vector< CServerInfom_vServers
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
STATE_DONE 
STATE_WANTREFRESH 
STATE_REFRESHING 
STATE_NO_MASTER 

Constructor & Destructor Documentation

◆ CServerBrowserHttp()

CServerBrowserHttp::CServerBrowserHttp ( IEngine pEngine,
IHttp pHttp,
const char **  ppUrls,
int  NumUrls,
int  PreviousBestIndex 
)

◆ ~CServerBrowserHttp()

CServerBrowserHttp::~CServerBrowserHttp ( )
override

Member Function Documentation

◆ GetBestUrl()

bool CServerBrowserHttp::GetBestUrl ( const char **  pBestUrl) const
inlineoverridevirtual

Implements IServerBrowserHttp.

◆ IsRefreshing()

bool CServerBrowserHttp::IsRefreshing ( )
inlineoverridevirtual

Implements IServerBrowserHttp.

◆ NumServers()

int CServerBrowserHttp::NumServers ( ) const
inlineoverridevirtual

Implements IServerBrowserHttp.

◆ Parse()

bool CServerBrowserHttp::Parse ( json_value pJson,
std::vector< CServerInfo > *  pvServers 
)
staticprivate

◆ Refresh()

void CServerBrowserHttp::Refresh ( )
overridevirtual

Implements IServerBrowserHttp.

◆ Server()

const CServerInfo & CServerBrowserHttp::Server ( int  Index) const
inlineoverridevirtual

Implements IServerBrowserHttp.

◆ Update()

void CServerBrowserHttp::Update ( )
overridevirtual

Implements IServerBrowserHttp.

◆ Validate()

bool CServerBrowserHttp::Validate ( json_value pJson)
staticprivate

Member Data Documentation

◆ m_pChooseMaster

std::unique_ptr<CChooseMaster> CServerBrowserHttp::m_pChooseMaster
private

◆ m_pGetServers

std::shared_ptr<CHttpRequest> CServerBrowserHttp::m_pGetServers
private

◆ m_pHttp

IHttp* CServerBrowserHttp::m_pHttp
private

◆ m_State

int CServerBrowserHttp::m_State = STATE_DONE
private

◆ m_vServers

std::vector<CServerInfo> CServerBrowserHttp::m_vServers
private

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