server::GameHosting Class Reference
[Generic Server Application]

Represents a game, with up to two coachs and as many viewers as they could be.

Each game is identified by a uid, passed to the ctor. More...

#include <GameHosting.hh>

Inheritance diagram for server::GameHosting:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GameHosting (int game_uid, const xml::XMLConfig &cfg, BaseSRules *rules)
void addClient (Client *cl)
 Add a client to this game.
enum eGameState getState () const
 Get client current status.
pthread_t getThreadId () const
 Get the thread_t structure of the thread running this game.
virtual void sendPacket (const Packet &p)
 Send a packet to all clients.

Static Public Member Functions

static void * startThread (void *gh_inst)
 Start the thread.

Detailed Description

Represents a game, with up to two coachs and as many viewers as they could be.

Each game is identified by a uid, passed to the ctor.

Instance of this class are under Server control, each of them run in a separate thread.


Member Function Documentation

void server::GameHosting::addClient ( Client cl  ) 

Add a client to this game.

Parameters:
cl Client data.

pthread_t server::GameHosting::getThreadId (  )  const

Get the thread_t structure of the thread running this game.

Mostly useful for joining with the main thread.

void server::GameHosting::sendPacket ( const Packet p  )  [virtual]

Send a packet to all clients.

Automatically called from the Arbiter.

Implements PacketSender.

void * server::GameHosting::startThread ( void *  gh_inst  )  [static]

Start the thread.

Call run(), and exit.

Parameters:
gh_inst A GameHosting instance, corresponding to the game.


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