Planeshift
MiniGameManager Class Reference

Handles minigame sessions. More...

#include <minigamemanager.h>

Public Member Functions

psMiniGameBoardDefFindGameDef (csString gameName)
 Find & return game board definition. More...
 
psMiniGameSessionGetSessionByID (uint32_t id)
 returns session by its id. More...
 
void Idle ()
 Idle function to check for idle players and players too far away. More...
 
bool Initialise ()
 Initialise Mini Game manager. More...
 
 MiniGameManager ()
 
void ResetAllGameSessions (void)
 reset all sessions, prob due to reloading action locations More...
 
 ~MiniGameManager ()
 
- Public Member Functions inherited from MessageManager< MiniGameManager >
void HandleMessage (MsgEntry *msg, Client *client)
 Transfers the message to the manager specific function. More...
 
void Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01)
 Subscribes this manager to a specific message type with a custom callback. More...
 
bool Unsubscribe (msgtype type)
 Unsubscribes this manager from a specific message type. More...
 
bool Unsubscribe (FunctionPointer handler, msgtype type)
 Unsubscribes a specific handler from a specific message type. More...
 
bool UnsubscribeAll ()
 Unsubscribes this manager from all message types. More...
 
virtual ~MessageManager ()
 Unsubscribes all messages then destroys this object. More...
 
- Public Member Functions inherited from MessageManagerBase
csArray< csString > DecodeCommandArea (Client *client, csString target)
 Decodes an area: expression. More...
 
gemObjectFindObjectByString (const csString &str, gemActor *me) const
 Find the object we are referring to in str. More...
 
ClientFindPlayerClient (const char *name)
 Finds Client* of character with given name. More...
 
virtual bool Verify (MsgEntry *pMsg, unsigned int flags, Client *&client)
 

Protected Member Functions

void HandleGameUpdate (MsgEntry *me, Client *client)
 handles a client that has made a move. More...
 
void HandleStartGameRequest (Client *client)
 client requests start of game session. More...
 
void HandleStartStop (MsgEntry *me, Client *client)
 Handle start and stop messages. More...
 
void HandleStopGameRequest (Client *client)
 client handles stopping of game session. More...
 
int16_t ParseGameboardOptions (psString optionsStr)
 function parses game options string from gameboards DB table. More...
 
void RemovePlayerFromSessions (psMiniGameSession *session, Client *client, uint32_t clientID)
 a client is removed from a game session. More...
 
void ResetGameSession (psMiniGameSession *sessionToReset)
 requests a session to be reset. More...
 

Protected Attributes

csHash< psMiniGameBoardDef *, csString > gameBoardDef
 Minigame board definitions by name. More...
 
csHash< psMiniGameSession *, uint32_t > playerSessions
 Maps players to game sessions for quicker access. More...
 
csPDelArray< psMiniGameSessionsessions
 Game sessions. More...
 

Additional Inherited Members

- Public Types inherited from MessageManager< MiniGameManager >
typedef void(MiniGameManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

Handles minigame sessions.

This is the manager class of mini-games, handling overall mini-game definitions, action-location gameboards and game sessions.

Definition at line 293 of file minigamemanager.h.

Constructor & Destructor Documentation

MiniGameManager::MiniGameManager ( )
MiniGameManager::~MiniGameManager ( )

Member Function Documentation

psMiniGameBoardDef* MiniGameManager::FindGameDef ( csString  gameName)

Find & return game board definition.

psMiniGameSession* MiniGameManager::GetSessionByID ( uint32_t  id)

returns session by its id.

void MiniGameManager::HandleGameUpdate ( MsgEntry me,
Client client 
)
protected

handles a client that has made a move.

void MiniGameManager::HandleStartGameRequest ( Client client)
protected

client requests start of game session.

void MiniGameManager::HandleStartStop ( MsgEntry me,
Client client 
)
protected

Handle start and stop messages.

void MiniGameManager::HandleStopGameRequest ( Client client)
protected

client handles stopping of game session.

void MiniGameManager::Idle ( )

Idle function to check for idle players and players too far away.

bool MiniGameManager::Initialise ( )

Initialise Mini Game manager.

int16_t MiniGameManager::ParseGameboardOptions ( psString  optionsStr)
protected

function parses game options string from gameboards DB table.

void MiniGameManager::RemovePlayerFromSessions ( psMiniGameSession session,
Client client,
uint32_t  clientID 
)
protected

a client is removed from a game session.

void MiniGameManager::ResetAllGameSessions ( void  )

reset all sessions, prob due to reloading action locations

void MiniGameManager::ResetGameSession ( psMiniGameSession sessionToReset)
protected

requests a session to be reset.

Member Data Documentation

csHash<psMiniGameBoardDef*, csString> MiniGameManager::gameBoardDef
protected

Minigame board definitions by name.

Definition at line 346 of file minigamemanager.h.

csHash<psMiniGameSession*, uint32_t> MiniGameManager::playerSessions
protected

Maps players to game sessions for quicker access.

Definition at line 343 of file minigamemanager.h.

csPDelArray<psMiniGameSession> MiniGameManager::sessions
protected

Game sessions.

Definition at line 340 of file minigamemanager.h.


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