SRules Class Reference
[Server Rules]

Rules implementation for the server.It symbolizes the main referee, making sure the game goes smoothly. More...

#include <SRules.hh>

Inheritance diagram for SRules:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SRules (App *app)
void sendIllegal (int token, int from, enum eError error)
 Send a MSG_ILLEGAL packet with error code.
OpStackgetOpStack ()
AppgetApp ()
SMatchgetMatch ()
SPlayerMsggetPlayerMsg ()
STeamMsggetTeamMsg ()
virtual void setState (int new_state)
 Set the current game state.
virtual void serverStartup ()
 Called once when all clients have joined the server.
virtual void serverProcess ()
 Called periodically from server.
virtual bool coachKilled (int coach_id, CoachErrorCustom *&cec)
 Called when a coach is disconnected.
virtual void serialize (std::ostream &os) const
virtual void unserialize (std::istream &is)

Friends

std::ostream & operator<< (std::ostream &os, const SRules &r)

Detailed Description

Rules implementation for the server.

It symbolizes the main referee, making sure the game goes smoothly.

You will have only one instance of this class at runtime, handled by the stechec server.


Member Function Documentation

void SRules::serverProcess (  )  [virtual]

Called periodically from server.

Check if turn time is not elapsed, otherwise throw turnover.

Reimplemented from BaseSRules.

References Match< T >::getTimer(), Timer::isTimeElapsed(), and SMatch::turnover().

void SRules::serverStartup (  )  [virtual]

Called once when all clients have joined the server.

Initialize rules and start the game.

Reimplemented from BaseSRules.

References Timer::getAllowedTime(), Match< T >::getTimer(), GS_INITGAME, BaseSRules::sendPacket(), setState(), and MsgInitGame::time_per_turn.


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 21:17:46 2010 for Stechec/TBT by  doxygen 1.6.3