Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::network::Client Class Reference

Inheritance diagram for ONE::network::Client:

Inheritance graph
[legend]
List of all members.

Detailed Description

a client that allows communciation with a game server

Author:
Henning Hamer


Public Member Functions

void connect (const NetAddress &_netAddress)
 Call this to connect the client to an address.
void connectString (const string &_ipAddressAndPortNumber)
 Call this to connect the client to an address specified by a string.
void disconnect ()
 Disconnects the client. Can be called several times.
void doNetwork ()
 Main method of the server. Must be called from main loop.
int getLocalUserID ()
 Returns the syncableID of the local UserEntity. ID was assigned by the server.
bool getNetworkReadyForGame ()
 Indicates if the network has received all information about added Syncables on the server.
SyncableMapgetSyncableMapP ()
 Returns a pointer to the server's syncableMap.
bool isConnected ()
 Check if the client is connected.
void ping ()
 Sends a ping to determine the network latency. Ping is stored in public member variable 'pingTime'.
void processControlEvent (ControlEvent &)
 Sends the Control of a dispatched ControlEvent over the network.
void sendMessageClientBusy ()
void sendMessageClientReady ()
 Call to indicate to the server that a game can begin.
void setContext (NetworkDevice *_networkDeviceP, Log *_networkLogP, Logic *_logicP)
 Prepares the client for use.

Static Public Member Functions

static void createInstance ()
 creates the singleton instance
static void destroyInstance ()
 destroys the singleton instance
static ClientgetInstance ()
 accesses the singleton instance
static bool isActive ()
 checks if the singleton is active
static bool isDestroyed ()
 checks if the singleton is destroyed
static bool isVirgin ()
 checks if the singleton has not been initialized

Public Attributes

GLfloat pingTime

Protected Member Functions

 Singleton ()

Static Protected Member Functions

static void destroyedError ()
static void initInstance ()

Friends

class ServerProxy


Member Function Documentation

void ONE::network::Client::connect const NetAddress &  _netAddress  ) 
 

Call this to connect the client to an address.

Parameters:
_netAddress address of a game server

void ONE::network::Client::connectString const string &  _ipAddressAndPortNumber  ) 
 

Call this to connect the client to an address specified by a string.

Parameters:
_ipAddressAndPortNumber address of a game server

static void ONE::util::Manual< Client >::createInstance  )  [static, inherited]
 

creates the singleton instance

static void ONE::util::Manual< Client >::destroyedError  )  [static, protected, inherited]
 

static void ONE::util::Manual< Client >::destroyInstance  )  [static, inherited]
 

destroys the singleton instance

void ONE::network::Client::disconnect  ) 
 

Disconnects the client. Can be called several times.

void ONE::network::Client::doNetwork  ) 
 

Main method of the server. Must be called from main loop.

static Client * ONE::util::Singleton< Client , Manual >::getInstance  )  [static, inherited]
 

accesses the singleton instance

The exact operation executed by calling this function is determined by the singleton policies.

Returns:
a pointer to the singleton instance

int ONE::network::Client::getLocalUserID  ) 
 

Returns the syncableID of the local UserEntity. ID was assigned by the server.

Returns:
the syncableID of the owned UserEntiy

bool ONE::network::Client::getNetworkReadyForGame  ) 
 

Indicates if the network has received all information about added Syncables on the server.

Returns:
true if the network has received all necessary information

SyncableMap* ONE::network::Client::getSyncableMapP  ) 
 

Returns a pointer to the server's syncableMap.

static void ONE::util::Manual< Client >::initInstance  )  [static, protected, inherited]
 

static bool ONE::util::Singleton< Client , Manual >::isActive  )  [static, inherited]
 

checks if the singleton is active

Returns:
if the singleton is instantiated

bool ONE::network::Client::isConnected  ) 
 

Check if the client is connected.

Returns:
true if client is connected

static bool ONE::util::Singleton< Client , Manual >::isDestroyed  )  [static, inherited]
 

checks if the singleton is destroyed

This function returns true if an instance existed and was destroyed. Note that in some cases it is possible to revive a singleton.

Returns:
if the singleton is destroyed

static bool ONE::util::Singleton< Client , Manual >::isVirgin  )  [static, inherited]
 

checks if the singleton has not been initialized

A singleton is not initialized if no instance exists and no instance has been destroyed.

Returns:
if the singleton is untouched

void ONE::network::Client::ping  ) 
 

Sends a ping to determine the network latency. Ping is stored in public member variable 'pingTime'.

void ONE::network::Client::processControlEvent ControlEvent  )  [virtual]
 

Sends the Control of a dispatched ControlEvent over the network.

Parameters:
_controlEvent the ControlEvent to be sent over the network

Implements ONE::util::ControlListener.

void ONE::network::Client::sendMessageClientBusy  ) 
 

void ONE::network::Client::sendMessageClientReady  ) 
 

Call to indicate to the server that a game can begin.

void ONE::network::Client::setContext NetworkDevice *  _networkDeviceP,
Log *  _networkLogP,
Logic _logicP
 

Prepares the client for use.

Parameters:
_networkDeviceP pointer to a NetworkDevice.
_networkLogP pointer to a Log.
_logicP Pointer to a Logic.

ONE::util::Singleton< Client , Manual >::Singleton  )  [protected, inherited]
 


Friends And Related Function Documentation

friend class ServerProxy [friend]
 


Member Data Documentation

GLfloat ONE::network::Client::pingTime
 


Generated on Wed Sep 7 19:03:24 2005 for ONEngine by  doxygen 1.4.3