The server specifies the GameLogic interface. More...
|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. |
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.
|aesop::ServerGameLogic::~ServerGameLogic||(||void||)|| throw ()