Planeshift
ServerSongManager Class Reference

This class takes care of played songs and players' ranking for musical instruments skills. More...

#include <serversongmngr.h>

Public Member Functions

void HandlePlaySongMessage (MsgEntry *me, Client *client)
 Handles a play song request. More...
 
void HandleStopSongMessage (MsgEntry *me, Client *client)
 Handles a stop song request. More...
 
bool Initialize ()
 
void OnStopSong (gemActor *charActor, bool isEnded)
 Stop the song and (contrary to StopSong) update the player's mode. More...
 
 ServerSongManager ()
 Constructor. More...
 
void StopSong (gemActor *charActor, bool skillRanking)
 Takes care of the skill ranking and of sending the stop song message to the player's proximity list. More...
 
 ~ServerSongManager ()
 Destructor. More...
 
- Public Member Functions inherited from MessageManager< ServerSongManager >
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)
 
- Public Member Functions inherited from Singleton< ServerSongManager >
 Singleton (ServerSongManager *ptr)
 
 Singleton (void)
 
 ~Singleton ()
 

Additional Inherited Members

- Public Types inherited from MessageManager< ServerSongManager >
typedef void(ServerSongManager::* FunctionPointer) (MsgEntry *, Client *)
 
- Static Public Member Functions inherited from Singleton< ServerSongManager >
static ServerSongManagerGetSingleton (void)
 
static ServerSongManagerGetSingletonPtr (void)
 

Detailed Description

This class takes care of played songs and players' ranking for musical instruments skills.

Definition at line 80 of file serversongmngr.h.

Constructor & Destructor Documentation

ServerSongManager::ServerSongManager ( )

Constructor.

ServerSongManager::~ServerSongManager ( )

Destructor.

Member Function Documentation

void ServerSongManager::HandlePlaySongMessage ( MsgEntry me,
Client client 
)

Handles a play song request.

Parameters
methe message from the client.
clientthe sender.
void ServerSongManager::HandleStopSongMessage ( MsgEntry me,
Client client 
)

Handles a stop song request.

Parameters
methe message from the client.
clientthe sender.
bool ServerSongManager::Initialize ( )
void ServerSongManager::OnStopSong ( gemActor charActor,
bool  isEnded 
)

Stop the song and (contrary to StopSong) update the player's mode.

This is the function called when the player stop manually the song or when it ends.

Parameters
charActorthe gemActor of the player.
isEndedtrue if the song has is ended, false otherwise.
void ServerSongManager::StopSong ( gemActor charActor,
bool  skillRanking 
)

Takes care of the skill ranking and of sending the stop song message to the player's proximity list.

Parameters
charActorthe player that has just stopped to play his instrument.
skillRankingtrue to make the player gain practice points, false otherwise.
Note
This function is called by a gemActor when it exits from the PLAY mode thus StopSong does not take care of updating the player's status.

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