ReplicaNet and RNLobby  1
Public Member Functions | Static Public Member Functions | List of all members
BackendClient Class Reference

#include <BackendClient.h>

Inheritance diagram for BackendClient:
Inheritance graph
[legend]
Collaboration diagram for BackendClient:
Collaboration graph
[legend]

Public Member Functions

bool Start (const int titleID, const char *encryptionKey)
 
bool GetCompleted (void)
 
BackendServer::Reply GetReply (void) const
 
virtual void CallbackCompleted (void)
 
virtual bool CallbackServerAddress (XPAddress &address)
 
void UseReleaseServers (const bool use=false)
 
- Public Member Functions inherited from BaseServer
virtual bool StartWithSocket (t_XPSocket *socket, const bool allowDelete=true)
 
virtual bool Stop (void)
 
void SetEncryptionKey (const void *data, const int length)
 
virtual void CallbackDataReceived (DynamicMessageHelper &message, XPAddress &address)
 
virtual void CallbackDataSend (DynamicMessageHelper &message, XPAddress &address)
 
virtual void CallbackQueryReplyTime (const float seconds)
 
virtual void CallbackTidy (void)
 
- Public Member Functions inherited from ThreadClass
 ThreadClass ()
 
virtual ~ThreadClass ()
 
void Sleep (int milliseconds)
 
- Public Member Functions inherited from MutexClass
 MutexClass ()
 
virtual ~MutexClass ()
 
void Lock (void)
 
void UnLock (void)
 
- Public Member Functions inherited from Thread
 Thread ()
 
virtual ~Thread ()
 
void Begin (ThreadClass *threaded_class)
 
void Terminate (void)
 
bool GetTerminated (void)
 
bool GetEverTerminated (void)
 
bool GetIsRunning (void) const
 
void SetPreferredProcessor (int processor=kReplicaNetPreferredProcessorOSChoice)
 
int GetPreferredProcessor (void)
 

Static Public Member Functions

static void DisableValidateOrderingCheck (void)
 
static bool IsAuthenticated (void)
 When the BackendClient has successfully completed an authentication request this returns true.
 
- Static Public Member Functions inherited from BaseServer
static SysTimeType FloatTime (void)
 
- Static Public Member Functions inherited from Thread
static int CallThreadEntry (ThreadClass *thread_class)
 
static int GetCurrentProcessorNumber (void)
 
static size_t GetNumAllocated (void)
 
static size_t GetNumActive (void)
 

Additional Inherited Members

- Public Types inherited from MutexClass
enum  { kNoOwnerThread = -1 }
 
- Protected Member Functions inherited from BaseServer
virtual bool PackageAndSendData (t_XPSocket *socket, const DynamicMessageHelper &message, const XPAddress &address)
 
virtual bool CallbackParsePacketData (t_XPSocket *socket, const XPAddress &addr, void *data, size_t &length, DynamicMessageHelper &result)
 
int ThreadEntry (void)
 
- Protected Member Functions inherited from ThreadClass
void DoQuitNow (const int returnCode)
 
void CheckQuit (void)
 
- Static Protected Member Functions inherited from ThreadClass
static size_t GetNumAllocated (void)
 
- Protected Attributes inherited from BaseServer
t_XPSocketmSocket
 
bool mAllowDelete
 
int mNOnce
 

Detailed Description

This backend client can query a backend server to verify the title ID is valid, or can be used to program the rest of the interfaces used by RNLobby.
When using this class to verify a titleID BackendClient::GetReply() must successfully return BackendServer::kReply_ValidTitleID before any other RNLobby client classes are started with their Start() member functions. This is because BackendClient will set the correct server address and encryption key to use for each component service when the component is constructed.

Member Function Documentation

virtual bool CallbackServerAddress ( XPAddress address)
virtual
Returns
Success returns true, failure returns false.
static void DisableValidateOrderingCheck ( void  )
static

In debug mode an assert will be generated if BackendClient is used after any other RNLobby service. To disable this check for the cases where LAN mode (without internet verification) is used before connecting to the internet please call this function.

bool GetCompleted ( void  )

Tests the completion state of the last query. When the query completes the result can be retrieved by using GetReply()

Returns
A completed query returns true, a pending query returns false.
BackendServer::Reply GetReply ( void  ) const

Returns the last reply from a completed query.

Returns
The last reply from a completed query.
bool Start ( const int  titleID,
const char *  encryptionKey 
)

Starts a thread to verify the supplied title ID and encryption key. Using title ID 0 (zero) with any encryption key is a special case and will allow locally hosted servers to be used for debugging purposes.

Returns
Success returns true, failure returns false.
void UseReleaseServers ( const bool  use = false)

Sets BackendClient to query the debug or release servers for server configuration information. For development use the debug servers. For public releases use the release servers.

Parameters
useSet to true to use the release servers. By default the debug servers are used.