Public Member Functions

aesop::ServerGameLogic Class Reference
[Server-Side Game Logic Interface]

The server specifies the GameLogic interface. More...

#include <srv-game-logic.h>

Inheritance diagram for aesop::ServerGameLogic:
Inheritance graph

List of all members.

Public Member Functions

virtual ~ServerGameLogic (void) throw ()
virtual void setPlayerManager (smart_ptr< PlayerManager > &playerMgr)=0
 game logic is told about the player manager
virtual void setMapManager (smart_ptr< MapManager > &mapMgr)=0
 game logic is told about the map manager
virtual bool requestPlayerStartTS (player_rec_t &pr)=0
 game logic is frequently pinged about any players not in map return true if player state has been updated
virtual void tick (float dt)=0
 server calls game logic on every server tick WARNING: this runs in the main game loop! Keep all processing fast or you will cause game lag.
virtual void parseGameData (conn_id_t conn_id, xdrbuf::Input *input)=0
 server calls game logic if it encounters game data in incoming UDP packets.

Detailed Description

The server specifies the GameLogic interface.

Someone building their own game server, using the Server class, needs to provide an object which implements the GameLogic interface. This is where the storyteller can place all the logic specific to their game, independent of the framework.

This is essentially a callback interface, to which the server will delegate for game decisions. Through this interface, game developers can specify how the rules for their game can influence objects, players, etc.

See game_logic for a reference implementation.

At the moment, this is still experimental! It will be refactored as it is used more extensively.

WARNING: All methods must be threadsafe! Be careful about what you do here, since game logic methods are typically called from the main execution thread. Methods are appended with the TS suffix to remind implementors to keep them threadsafe.

Definition at line 76 of file aesop-core/lib/aesop-srv/srv-game-logic.h.

Constructor & Destructor Documentation

aesop::ServerGameLogic::~ServerGameLogic ( void   )  throw () [virtual]

Definition at line 42 of file aesop-core/lib/aesop-srv/srv-game-logic.cpp.

The documentation for this class was generated from the following files: