Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

AdviceManager Class Reference

AdviceManager keeps track of all the invitations of any kind that are pending, using a collection of PendingAdvice objects. More...

#include <advicemanager.h>

List of all members.

Public Member Functions

void AddAdvisor (Client *client)
 Adds a new advisor available to answer questions.
 AdviceManager (psDatabase *db)
void AdviceRequestTimeout (AdviceSession *adviceSession)
 Resend request for advice due to timeout.
void CancelAdvisorSession (gemActor *who, AdviceSession *adviceSession, const char *msg)
 Remove advise session due to timeout.
bool GetAdvisorMode (int id, int connectionId)
 Retrieve the clients advisor mode.
void HandleAdviceMessage (MsgEntry *pMsg, Client *client)
void RemoveAdvisor (uint32_t id, int connectionId)
 Remove advisor available to answer questions.
void RemoveSession (AdviceSession *adviceSession)
virtual ~AdviceManager ()

Protected Member Functions

bool FloodControl (csString &newmessage, Client *client)
void HandleAdviceList (Client *advisor)
void HandleAdviceRequest (Client *advisee, csString message)
void HandleAdviceResponse (Client *advisee, csString sAdvisee, csString message)
void HandleAdviseeList (Client *advisor)
void HandleListAdvisors (Client *advisor)

Protected Attributes

csHash< AdviceSession * > AdviseeList
size_t advisorPos
csArray< AdvisorStructadvisors
psDatabasedatabase

Detailed Description

AdviceManager keeps track of all the invitations of any kind that are pending, using a collection of PendingAdvice objects.

An invitation is pending between the time that the Noob sends the invitation and when an Advisor sends a response.

Definition at line 77 of file advicemanager.h.


Constructor & Destructor Documentation

AdviceManager::AdviceManager ( psDatabase db)
virtual AdviceManager::~AdviceManager ( ) [virtual]

Member Function Documentation

void AdviceManager::AddAdvisor ( Client client)

Adds a new advisor available to answer questions.

Parameters:
clientThe player client.
void AdviceManager::AdviceRequestTimeout ( AdviceSession *  adviceSession)

Resend request for advice due to timeout.

Parameters:
adviceSessionThe session that has expired
void AdviceManager::CancelAdvisorSession ( gemActor who,
AdviceSession *  adviceSession,
const char *  msg 
)

Remove advise session due to timeout.

Parameters:
whoThe actor.
adviceSessionThe session that has expired.
msgA message for the player.
bool AdviceManager::FloodControl ( csString &  newmessage,
Client client 
) [protected]
bool AdviceManager::GetAdvisorMode ( int  id,
int  connectionId 
)

Retrieve the clients advisor mode.

Parameters:
idThe id of the advisor to remove ( same as player ID )
connectionIdThe client id that client dropping advisor role.
void AdviceManager::HandleAdviceList ( Client advisor) [protected]
void AdviceManager::HandleAdviceMessage ( MsgEntry pMsg,
Client client 
)
void AdviceManager::HandleAdviceRequest ( Client advisee,
csString  message 
) [protected]
void AdviceManager::HandleAdviceResponse ( Client advisee,
csString  sAdvisee,
csString  message 
) [protected]
void AdviceManager::HandleAdviseeList ( Client advisor) [protected]
void AdviceManager::HandleListAdvisors ( Client advisor) [protected]
void AdviceManager::RemoveAdvisor ( uint32_t  id,
int  connectionId 
)

Remove advisor available to answer questions.

Parameters:
idThe id of the advisor to remove ( same as player ID )
connectionIdThe client id that client dropping advisor role.
void AdviceManager::RemoveSession ( AdviceSession *  adviceSession)

Member Data Documentation

csHash<AdviceSession*> AdviceManager::AdviseeList [protected]

Definition at line 137 of file advicemanager.h.

size_t AdviceManager::advisorPos [protected]

Definition at line 139 of file advicemanager.h.

Definition at line 138 of file advicemanager.h.

Definition at line 140 of file advicemanager.h.


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