Rules implementation for the server.It symbolizes the main referee, making sure the game goes smoothly. More...
#include <SRules.hh>

Public Member Functions | |
| SRules (App *app) | |
| void | sendIllegal (int token, int from, enum eError error) |
| Send a MSG_ILLEGAL packet with error code. | |
| OpStack * | getOpStack () |
| App * | getApp () |
| SMatch * | getMatch () |
| SPlayerMsg * | getPlayerMsg () |
| STeamMsg * | getTeamMsg () |
| 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) |
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.
| 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.
1.6.3