Planeshift
|
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... | |
![]() | |
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... | |
![]() | |
csArray< csString > | DecodeCommandArea (Client *client, csString target) |
Decodes an area: expression. More... | |
gemObject * | FindObjectByString (const csString &str, gemActor *me) const |
Find the object we are referring to in str. More... | |
Client * | FindPlayerClient (const char *name) |
Finds Client* of character with given name. More... | |
virtual bool | Verify (MsgEntry *pMsg, unsigned int flags, Client *&client) |
![]() | |
Singleton (ServerSongManager *ptr) | |
Singleton (void) | |
~Singleton () | |
Additional Inherited Members | |
![]() | |
typedef void(ServerSongManager::* | FunctionPointer) (MsgEntry *, Client *) |
![]() | |
static ServerSongManager & | GetSingleton (void) |
static ServerSongManager * | GetSingletonPtr (void) |
This class takes care of played songs and players' ranking for musical instruments skills.
Definition at line 80 of file serversongmngr.h.
ServerSongManager::ServerSongManager | ( | ) |
Constructor.
ServerSongManager::~ServerSongManager | ( | ) |
Destructor.
Handles a play song request.
me | the message from the client. |
client | the sender. |
Handles a stop song request.
me | the message from the client. |
client | the 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.
charActor | the gemActor of the player. |
isEnded | true 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.
charActor | the player that has just stopped to play his instrument. |
skillRanking | true to make the player gain practice points, false otherwise. |