ClientCx Class Reference
[Generic Client Application]

Handle connection with the server.

Takes care of network connection with the server, provides methods to connect, disconnect, ... More...

#include <ClientCx.hh>

Inheritance diagram for ClientCx:

Inheritance graph
[legend]
List of all members.

Public Member Functions

bool connect (xml::XMLConfig &cfg)
 Connect to the server.
bool join (xml::XMLConfig &cfg, const struct RuleDescription &desc)
 Join a game on the server.
bool openLog (const std::string &filename)
 Open a log file (for game replay).
void disconnect (bool send_abort=false)
 Disconnect from the server, or close the log file.
bool isConnected () const
 Is there currently a connection with the server.
bool process (bool block=false)
 Main method to fetch and handle incoming packets.
void setRules (BaseCRules *rules)
 Set Client rules.
void setClientGameId (int client_gid)
 Set client game ID.
void setReady ()
 Set readyness.

Detailed Description

Handle connection with the server.

Takes care of network connection with the server, provides methods to connect, disconnect, ...


Member Function Documentation

bool ClientCx::connect ( xml::XMLConfig cfg  ) 

Connect to the server.

Parameters:
cfg The client configuration.
Returns:
true if the connection was successful, false otherwise.

bool ClientCx::join ( xml::XMLConfig cfg,
const struct RuleDescription desc 
)

Join a game on the server.

Parameters:
cfg The client configuration.
desc The rules description (usually loaded from dynamic library).
Returns:
true if the join was successful, false otherwise.

bool ClientCx::openLog ( const std::string &  filename  ) 

Open a log file (for game replay).

Note:
Mutually exclusive with connect()/join().

bool ClientCx::process ( bool  block = false  ) 

Main method to fetch and handle incoming packets.

Returns:
true if a packet was processed.

void ClientCx::setReady (  ) 

Set readyness.

See how specific Rules handle this state, mostly useful for viewers.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:09:52 2007 for Stechec/TBT by  doxygen 1.4.7