Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

ActionManager Class Reference

Handles the map interaction system. More...

#include <actionmanager.h>

List of all members.

Public Member Functions

 ActionManager (psDatabase *db)
 Constructor.
void AddActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Add a new active actionLocation for this client.
bool CacheActionLocation (psActionLocation *action)
 Loads cache with given action location.
psActionLocationFindAction (EID id)
 Finds an ActionLocation from it's CEL Entity ID.
psActionLocationFindActionByID (uint32 id)
 Finds an ActionLocation from the action ID.
psActionLocationFindAvailableEntrances (csString entranceSector)
 Finds an inactive entrance action location in the specified target sector map.
void HandleMapAction (MsgEntry *msg, Client *client)
 Processes psMapActionMessages.
bool HandleUse (gemActionLocation *actionlocation, Client *client)
 Handles the /use command on an AL or the click on use button.
bool HasActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Check if there is an active action location for this client/actionLocation pair.
void NotifyProximity (gemActor *actor, gemActionLocation *actionLocationObject, float range)
 Handle notification from the proxy system about players nearby action locations.
void RemoveActiveTrigger (EID actorEID, const psActionLocation *actionLocation)
 Remove all active trigger flag for this client and action location.
bool RepopulateActionLocations (psSectorInfo *sectorinfo=0)
 Loads cache from action_location table in db.
virtual ~ActionManager ()
 Destructor.

Protected Member Functions

void HandleDeleteMessage (csString xml, Client *client)
 Handles Delete messages from client.
void HandleExamineOperation (psActionLocation *action, Client *client)
 Handles Examine Operation for a action location.
void HandleListMessage (csString xml, Client *client)
 Handles List messages from client.
void HandleQueryMessage (csString xml, Client *client)
 Handles Query messages from client.
void HandleReloadMessage (Client *client)
 Handles Reload messages from client.
void HandleSaveMessage (csString xml, Client *client)
 Handles Save messages from client.
void HandleScriptOperation (psActionLocation *action, gemActor *actor)
 Handles Script Operation for a action location.
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

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

Definition at line 275 of file actionmanager.h.

Definition at line 273 of file actionmanager.h.

Definition at line 274 of file actionmanager.h.

Definition at line 272 of file actionmanager.h.

csHash<const psActionLocation*> ActionManager::activeTriggers [protected]

Definition at line 276 of file actionmanager.h.

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: