Planeshift
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

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>

List of all members.

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 Member Functions

void HandleScriptMessage (uint32_t client, unsigned int which)
 Specifically handle the message sent by a script.
 TutorialManager (ClientConnectionSet *pCCS)
virtual ~TutorialManager ()

Protected Member Functions

void HandleConnect (MsgEntry *pMsg, Client *client)
 Specifically handle the Connect event in the tutorial.
void HandleDamage (MsgEntry *pMsg, Client *client)
 Specifically handle the Damage event in the tutorial.
void HandleDeath (MsgEntry *pMsg, Client *client)
 Specifically handle the Death event in the tutorial.
void HandleGeneric (MsgEntry *pMsg, Client *client)
 Handle tutorial events which come from events which do not have specific msgtypes.
void HandleMovement (MsgEntry *pMsg, Client *client)
 Specifically handle the Movement event in the tutorial.
void HandleTarget (MsgEntry *pMsg, Client *client)
 Specifically handle the Target event in the tutorial.
bool LoadTutorialStrings ()
 Preload all tutorial strings from the Tips db table.
void SendTutorialMessage (int which, uint32_t clientnum, const char *instrs)
void SendTutorialMessage (int which, Client *client, const char *instrs)
 Package up the current event string for the client receiving the tutorial.

Protected Attributes

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

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

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: