Planeshift
TutorialManager Class Reference

This manager catches events posted by the rest of the server and decides whether each client needs to be notified about them, in order to show a tutorial page about that event. More...

#include <tutorialmanager.h>

Public Types

enum  TutorEventType {
  CONNECT = 0, MOVEMENT = 1, NPC_SELECT = 2, NPC_TALK = 3,
  QUEST_ASSIGN = 4, DAMAGE_SELF = 5, DAMAGE_FALL = 6, DEATH_SELF = 7,
  SPAWN_MOVE = 8, TUTOREVENTTYPE_COUNT
}
 
- Public Types inherited from MessageManager< TutorialManager >
typedef void(TutorialManager::* FunctionPointer) (MsgEntry *, Client *)
 

Public Member Functions

void HandleScriptMessage (uint32_t client, unsigned int which)
 Specifically handle the message sent by a script. More...
 
 TutorialManager (ClientConnectionSet *pCCS)
 
virtual ~TutorialManager ()
 
- Public Member Functions inherited from MessageManager< TutorialManager >
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 HandleConnect (MsgEntry *pMsg, Client *client)
 Specifically handle the Connect event in the tutorial. More...
 
void HandleDamage (MsgEntry *pMsg, Client *client)
 Specifically handle the Damage event in the tutorial. More...
 
void HandleDeath (MsgEntry *pMsg, Client *client)
 Specifically handle the Death event in the tutorial. More...
 
void HandleGeneric (MsgEntry *pMsg, Client *client)
 Handle tutorial events which come from events which do not have specific msgtypes. More...
 
void HandleMovement (MsgEntry *pMsg, Client *client)
 Specifically handle the Movement event in the tutorial. More...
 
void HandleTarget (MsgEntry *pMsg, Client *client)
 Specifically handle the Target event in the tutorial. More...
 
bool LoadTutorialStrings ()
 Preload all tutorial strings from the Tips db table. More...
 
void SendTutorialMessage (int which, Client *client, const char *instrs)
 Package up the current event string for the client receiving the tutorial. More...
 
void SendTutorialMessage (int which, uint32_t clientnum, const char *instrs)
 

Protected Attributes

ClientConnectionSetclients
 
csArray< csString > tutorialMsg
 Stores all the messages in the database above id 1001 (biased to 1001 so 1001 is 0). More...
 

Detailed Description

This manager catches events posted by the rest of the server and decides whether each client needs to be notified about them, in order to show a tutorial page about that event.

Definition at line 41 of file tutorialmanager.h.

Member Enumeration Documentation

Enumerator
CONNECT 
MOVEMENT 
NPC_SELECT 
NPC_TALK 
QUEST_ASSIGN 
DAMAGE_SELF 
DAMAGE_FALL 
DEATH_SELF 
SPAWN_MOVE 
TUTOREVENTTYPE_COUNT 

Definition at line 45 of file tutorialmanager.h.

Constructor & Destructor Documentation

TutorialManager::TutorialManager ( ClientConnectionSet pCCS)
virtual TutorialManager::~TutorialManager ( )
virtual

Member Function Documentation

void TutorialManager::HandleConnect ( MsgEntry pMsg,
Client client 
)
protected

Specifically handle the Connect event in the tutorial.

void TutorialManager::HandleDamage ( MsgEntry pMsg,
Client client 
)
protected

Specifically handle the Damage event in the tutorial.

void TutorialManager::HandleDeath ( MsgEntry pMsg,
Client client 
)
protected

Specifically handle the Death event in the tutorial.

void TutorialManager::HandleGeneric ( MsgEntry pMsg,
Client client 
)
protected

Handle tutorial events which come from events which do not have specific msgtypes.

void TutorialManager::HandleMovement ( MsgEntry pMsg,
Client client 
)
protected

Specifically handle the Movement event in the tutorial.

void TutorialManager::HandleScriptMessage ( uint32_t  client,
unsigned int  which 
)

Specifically handle the message sent by a script.

Parameters
clientThe client where the message has to be sent.
whichThe ID of the tip from the database
void TutorialManager::HandleTarget ( MsgEntry pMsg,
Client client 
)
protected

Specifically handle the Target event in the tutorial.

bool TutorialManager::LoadTutorialStrings ( )
protected

Preload all tutorial strings from the Tips db table.

void TutorialManager::SendTutorialMessage ( int  which,
Client client,
const char *  instrs 
)
protected

Package up the current event string for the client receiving the tutorial.

void TutorialManager::SendTutorialMessage ( int  which,
uint32_t  clientnum,
const char *  instrs 
)
protected

Member Data Documentation

ClientConnectionSet* TutorialManager::clients
protected

Definition at line 99 of file tutorialmanager.h.

csArray<csString> TutorialManager::tutorialMsg
protected

Stores all the messages in the database above id 1001 (biased to 1001 so 1001 is 0).

Note
Not all messages are handled directly by the tutorial manager, only the first 32.

Definition at line 107 of file tutorialmanager.h.


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