Planeshift
ActionManager Class Reference

Handles the map interaction system. More...

#include <actionmanager.h>

Public Member Functions

 ActionManager (psDatabase *db)
 Constructor. More...
 
void AddActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Add a new active actionLocation for this client. More...
 
bool CacheActionLocation (psActionLocation *action)
 Loads cache with given action location. More...
 
psActionLocationFindAction (EID id)
 Finds an ActionLocation from it's CEL Entity ID. More...
 
psActionLocationFindActionByID (uint32 id)
 Finds an ActionLocation from the action ID. More...
 
psActionLocationFindAvailableEntrances (csString entranceSector)
 Finds an inactive entrance action location in the specified target sector map. More...
 
void HandleMapAction (MsgEntry *msg, Client *client)
 Processes psMapActionMessages. More...
 
bool HandleUse (gemActionLocation *actionlocation, Client *client)
 Handles the /use command on an AL or the click on use button. More...
 
bool HasActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Check if there is an active action location for this client/actionLocation pair. More...
 
void NotifyProximity (gemActor *actor, gemActionLocation *actionLocationObject, float range)
 Handle notification from the proxy system about players nearby action locations. More...
 
void RemoveActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Remove all active trigger flag for this client and action location. More...
 
bool RepopulateActionLocations (psSectorInfo *sectorinfo=0)
 Loads cache from action_location table in db. More...
 
virtual ~ActionManager ()
 Destructor. More...
 
- Public Member Functions inherited from MessageManager< ActionManager >
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 HandleDeleteMessage (csString xml, Client *client)
 Handles Delete messages from client. More...
 
void HandleExamineOperation (psActionLocation *action, Client *client)
 Handles Examine Operation for a action location. More...
 
void HandleListMessage (csString xml, Client *client)
 Handles List messages from client. More...
 
void HandleQueryMessage (csString xml, Client *client)
 Handles Query messages from client. More...
 
void HandleReloadMessage (Client *client)
 Handles Reload messages from client. More...
 
void HandleSaveMessage (csString xml, Client *client)
 Handles Save messages from client. More...
 
void HandleScriptOperation (psActionLocation *action, gemActor *actor)
 Handles Script Operation for a action location. More...
 
bool HandleSelectQuery (iDocumentNode *topNode, Client *client)
 
void LoadXML (iDocumentNode *topNode)
 
bool ProcessMatches (csArray< psActionLocation * > matches, Client *client)
 

Protected Attributes

csHash< psActionLocation *, uint32 > actionLocation_by_id
 
csHash< psActionLocation * > actionLocation_by_name
 
csHash< psActionLocation * > actionLocation_by_sector
 
csHash< psActionLocation * > actionLocationList
 
csHash< const psActionLocation * > activeTriggers
 
psDatabasedatabase
 
csString meshName
 
csVector3 position
 
csString sectorName
 
csString triggerType
 

Additional Inherited Members

- Public Types inherited from MessageManager< ActionManager >
typedef void(ActionManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

Handles the map interaction system.

Used to populate/update/change current action locations. Action locations can either be triggered by user action or proximity to the action location.

Definition at line 107 of file actionmanager.h.

Constructor & Destructor Documentation

ActionManager::ActionManager ( psDatabase db)

Constructor.

virtual ActionManager::~ActionManager ( )
virtual

Destructor.

Member Function Documentation

void ActionManager::AddActiveTrigger ( EID  actorEID,
const psActionLocation actionLocation 
)

Add a new active actionLocation for this client.

Parameters
actorEIDThe EID of the actor to remove from the given action location.
actionLocationThe location that is triggered for the given actor.
bool ActionManager::CacheActionLocation ( psActionLocation action)

Loads cache with given action location.

Parameters
actionThe action location to which you want to load
psActionLocation* ActionManager::FindAction ( EID  id)

Finds an ActionLocation from it's CEL Entity ID.

Parameters
idThe id of the cel entity to find.
psActionLocation* ActionManager::FindActionByID ( uint32  id)

Finds an ActionLocation from the action ID.

Parameters
idThe id of the action location.
psActionLocation* ActionManager::FindAvailableEntrances ( csString  entranceSector)

Finds an inactive entrance action location in the specified target sector map.

Parameters
entranceSectorThe entrance teleport target sector string to qualify the search.
void ActionManager::HandleDeleteMessage ( csString  xml,
Client client 
)
protected

Handles Delete messages from client.

Parameters
xmlxml containing query parameters.
clientThe client that sent the message.
void ActionManager::HandleExamineOperation ( psActionLocation action,
Client client 
)
protected

Handles Examine Operation for a action location.

Parameters
actionThe action that is to be performed.
clientThe client that sent the message.
void ActionManager::HandleListMessage ( csString  xml,
Client client 
)
protected

Handles List messages from client.

Parameters
xmlxml containing query parameters.
clientThe client that sent the message.
void ActionManager::HandleMapAction ( MsgEntry msg,
Client client 
)

Processes psMapActionMessages.

Parameters
msgThe message to process
clientThe client that sent the message.
void ActionManager::HandleQueryMessage ( csString  xml,
Client client 
)
protected

Handles Query messages from client.

Parameters
xmlxml containing query parameters.
clientThe client that sent the message.
void ActionManager::HandleReloadMessage ( Client client)
protected

Handles Reload messages from client.

Parameters
clientThe client that sent the message.
void ActionManager::HandleSaveMessage ( csString  xml,
Client client 
)
protected

Handles Save messages from client.

Parameters
xmlxml containing query parameters.
clientThe client that sent the message.
void ActionManager::HandleScriptOperation ( psActionLocation action,
gemActor actor 
)
protected

Handles Script Operation for a action location.

Parameters
actionThe action that is to be performed.
actorThe actor triggered the script.
bool ActionManager::HandleSelectQuery ( iDocumentNode *  topNode,
Client client 
)
protected
bool ActionManager::HandleUse ( gemActionLocation actionlocation,
Client client 
)

Handles the /use command on an AL or the click on use button.

Parameters
clientThe client that issued the use command
bool ActionManager::HasActiveTrigger ( EID  actorEID,
const psActionLocation actionLocation 
)

Check if there is an active action location for this client/actionLocation pair.

Parameters
actorEIDThe EID of the actor to remove from the given action location.
actionLocationThe location that is triggered for the given actor.
void ActionManager::LoadXML ( iDocumentNode *  topNode)
protected
void ActionManager::NotifyProximity ( gemActor actor,
gemActionLocation actionLocationObject,
float  range 
)

Handle notification from the proxy system about players nearby action locations.

bool ActionManager::ProcessMatches ( csArray< psActionLocation * >  matches,
Client client 
)
protected
void ActionManager::RemoveActiveTrigger ( EID  actorEID,
const psActionLocation actionLocation 
)

Remove all active trigger flag for this client and action location.

Parameters
actorEIDThe EID of the actor to remove from the given action location.
actionLocationThe location that is triggered for the given actor.
bool ActionManager::RepopulateActionLocations ( psSectorInfo sectorinfo = 0)

Loads cache from action_location table in db.

Parameters
sectorinfoThe sector to repopulate. Null means all sectors.

Member Data Documentation

csHash<psActionLocation*, uint32> ActionManager::actionLocation_by_id
protected

Definition at line 275 of file actionmanager.h.

csHash<psActionLocation*> ActionManager::actionLocation_by_name
protected

Definition at line 273 of file actionmanager.h.

csHash<psActionLocation*> ActionManager::actionLocation_by_sector
protected

Definition at line 274 of file actionmanager.h.

csHash<psActionLocation*> ActionManager::actionLocationList
protected

Definition at line 272 of file actionmanager.h.

csHash<const psActionLocation*> ActionManager::activeTriggers
protected

Definition at line 276 of file actionmanager.h.

psDatabase* ActionManager::database
protected

Definition at line 271 of file actionmanager.h.

csString ActionManager::meshName
protected

Definition at line 267 of file actionmanager.h.

csVector3 ActionManager::position
protected

Definition at line 268 of file actionmanager.h.

csString ActionManager::sectorName
protected

Definition at line 266 of file actionmanager.h.

csString ActionManager::triggerType
protected

Definition at line 265 of file actionmanager.h.


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