Planeshift
EntityManager Class Reference

Manages CEL entities on the server. More...

#include <entitymanager.h>

Public Member Functions

bool AddRideRelation (gemActor *rider, gemActor *mount)
 
gemNPCCloneNPC (psCharacter *chardata)
 Clone a NPC. More...
 
PID CopyNPCFromDatabase (PID master_id, float x, float y, float z, float angle, const csString &sector, InstanceID instance, const char *firstName=NULL, const char *lastName=NULL)
 
bool CreateActionLocation (psActionLocation *instance, bool transient)
 
gemNPCCreateFamiliar (gemActor *owner, PID masterPID)
 Create a new familiar NPC. More...
 
gemNPCCreateHiredNPC (gemActor *owner, PID masterPID, const csString &name)
 Create a new hired NPC. More...
 
gemItemCreateItem (psItem *iteminstance, bool transient, int tribeID=0)
 
EID CreateNPC (PID npcID, bool updateProxList=true, bool alwaysWatching=false)
 
EID CreateNPC (psCharacter *chardata, bool updateProxList=true, bool alwaysWatching=false)
 
EID CreateNPC (psCharacter *chardata, InstanceID instance, csVector3 pos, iSector *sector, float yrot, bool updateProxList=true, bool alwaysWatching=false)
 
bool CreatePlayer (Client *client)
 
bool DeleteActor (gemObject *actor)
 Delete an actor from the world. More...
 
bool DeletePlayer (Client *client)
 
 EntityManager ()
 
iSector * FindSector (const char *name)
 
ClientConnectionSetGetClients ()
 
iEngine * GetEngine ()
 
GEMSupervisorGetGEM ()
 
psWorldGetWorld ()
 
void HandleActor (MsgEntry *me, Client *client)
 
void HandleAllRequest (MsgEntry *me, Client *client)
 
void HandleUserAction (MsgEntry *me, Client *client)
 
void HandleWorld (MsgEntry *me, Client *client)
 
bool HasBeenReady ()
 
bool Initialize (iObjectRegistry *object_reg, ClientConnectionSet *clients, UserManager *usermanager, GEMSupervisor *gemsupervisor, psServerDR *psserverdr, CacheManager *cachemanager)
 
bool IsReady ()
 
bool LoadMap (const char *mapname)
 
gemItemMoveItemToWorld (psItem *keyItem, InstanceID instance, psSectorInfo *sectorinfo, float loc_x, float loc_y, float loc_z, float loc_xrot, float loc_yrot, float loc_zrot, psCharacter *owner, bool transient)
 
bool RemoveActor (gemObject *actor)
 
void RemoveRideRelation (gemActor *rider)
 
void SendMovementInfo (MsgEntry *me, Client *client)
 
void SetReady (bool flag)
 
virtual ~EntityManager ()
 
- Public Member Functions inherited from MessageManager< EntityManager >
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)
 
- Public Member Functions inherited from Singleton< EntityManager >
 Singleton (EntityManager *ptr)
 
 Singleton (void)
 
 ~Singleton ()
 

Protected Member Functions

int CalculateFamiliarAffinity (psCharacter *chardata, size_t type, size_t lifecycle, size_t attacktool, size_t attacktype)
 
void CreateMovementInfoMsg ()
 
PID GetMasterFamiliarID (psCharacter *charData)
 
void LoadFamiliarAffinityAttributes ()
 
void LoadFamiliarTypes ()
 
bool SendActorList (Client *client)
 

Protected Attributes

csHash< psAffinityAttribute * > affinityAttributeList
 
CacheManagercacheManager
 
ClientConnectionSetclients
 
psDatabasedatabase
 
iEngine * engine
 
csHash< psFamiliarType *, PID > familiarTypeList
 
psWorldgameWorld
 
GEMSupervisorgem
 
bool hasBeenReady
 
psMovementInfoMessagemoveinfomsg
 
bool ready
 
psServerDRserverdr
 
UserManagerusermanager
 

Additional Inherited Members

- Public Types inherited from MessageManager< EntityManager >
typedef void(EntityManager::* FunctionPointer) (MsgEntry *, Client *)
 
- Static Public Member Functions inherited from Singleton< EntityManager >
static EntityManagerGetSingleton (void)
 
static EntityManagerGetSingletonPtr (void)
 

Detailed Description

Manages CEL entities on the server.

Definition at line 77 of file entitymanager.h.

Constructor & Destructor Documentation

EntityManager::EntityManager ( )
virtual EntityManager::~EntityManager ( )
virtual

Member Function Documentation

bool EntityManager::AddRideRelation ( gemActor rider,
gemActor mount 
)
int EntityManager::CalculateFamiliarAffinity ( psCharacter chardata,
size_t  type,
size_t  lifecycle,
size_t  attacktool,
size_t  attacktype 
)
protected
gemNPC* EntityManager::CloneNPC ( psCharacter chardata)

Clone a NPC.

Used by the tribe system to generate new mebers.

PID EntityManager::CopyNPCFromDatabase ( PID  master_id,
float  x,
float  y,
float  z,
float  angle,
const csString &  sector,
InstanceID  instance,
const char *  firstName = NULL,
const char *  lastName = NULL 
)
bool EntityManager::CreateActionLocation ( psActionLocation instance,
bool  transient 
)
gemNPC* EntityManager::CreateFamiliar ( gemActor owner,
PID  masterPID 
)

Create a new familiar NPC.

gemNPC* EntityManager::CreateHiredNPC ( gemActor owner,
PID  masterPID,
const csString &  name 
)

Create a new hired NPC.

gemItem* EntityManager::CreateItem ( psItem iteminstance,
bool  transient,
int  tribeID = 0 
)
void EntityManager::CreateMovementInfoMsg ( )
protected
EID EntityManager::CreateNPC ( PID  npcID,
bool  updateProxList = true,
bool  alwaysWatching = false 
)
EID EntityManager::CreateNPC ( psCharacter chardata,
bool  updateProxList = true,
bool  alwaysWatching = false 
)
EID EntityManager::CreateNPC ( psCharacter chardata,
InstanceID  instance,
csVector3  pos,
iSector *  sector,
float  yrot,
bool  updateProxList = true,
bool  alwaysWatching = false 
)
bool EntityManager::CreatePlayer ( Client client)
bool EntityManager::DeleteActor ( gemObject actor)

Delete an actor from the world.

Entity is removed from world and deleted from DB. If the actor is a NPC a command is sent to NPC Clients to delte any records there as well.

bool EntityManager::DeletePlayer ( Client client)
iSector* EntityManager::FindSector ( const char *  name)
ClientConnectionSet* EntityManager::GetClients ( )
inline

Definition at line 167 of file entitymanager.h.

iEngine* EntityManager::GetEngine ( )
inline

Definition at line 162 of file entitymanager.h.

GEMSupervisor* EntityManager::GetGEM ( )
inline

Definition at line 158 of file entitymanager.h.

PID EntityManager::GetMasterFamiliarID ( psCharacter charData)
protected
psWorld* EntityManager::GetWorld ( )
inline

Definition at line 171 of file entitymanager.h.

void EntityManager::HandleActor ( MsgEntry me,
Client client 
)
void EntityManager::HandleAllRequest ( MsgEntry me,
Client client 
)
void EntityManager::HandleUserAction ( MsgEntry me,
Client client 
)
void EntityManager::HandleWorld ( MsgEntry me,
Client client 
)
bool EntityManager::HasBeenReady ( )
inline

Definition at line 154 of file entitymanager.h.

bool EntityManager::Initialize ( iObjectRegistry *  object_reg,
ClientConnectionSet clients,
UserManager usermanager,
GEMSupervisor gemsupervisor,
psServerDR psserverdr,
CacheManager cachemanager 
)
bool EntityManager::IsReady ( )
inline

Definition at line 150 of file entitymanager.h.

void EntityManager::LoadFamiliarAffinityAttributes ( )
protected
void EntityManager::LoadFamiliarTypes ( )
protected
bool EntityManager::LoadMap ( const char *  mapname)
gemItem* EntityManager::MoveItemToWorld ( psItem keyItem,
InstanceID  instance,
psSectorInfo sectorinfo,
float  loc_x,
float  loc_y,
float  loc_z,
float  loc_xrot,
float  loc_yrot,
float  loc_zrot,
psCharacter owner,
bool  transient 
)
bool EntityManager::RemoveActor ( gemObject actor)
void EntityManager::RemoveRideRelation ( gemActor rider)
bool EntityManager::SendActorList ( Client client)
protected
void EntityManager::SendMovementInfo ( MsgEntry me,
Client client 
)
void EntityManager::SetReady ( bool  flag)

Member Data Documentation

csHash<psAffinityAttribute*> EntityManager::affinityAttributeList
protected

Definition at line 177 of file entitymanager.h.

CacheManager* EntityManager::cacheManager
protected

Definition at line 196 of file entitymanager.h.

ClientConnectionSet* EntityManager::clients
protected

Definition at line 193 of file entitymanager.h.

psDatabase* EntityManager::database
protected

Definition at line 194 of file entitymanager.h.

iEngine* EntityManager::engine
protected

Definition at line 198 of file entitymanager.h.

csHash<psFamiliarType*, PID> EntityManager::familiarTypeList
protected

Definition at line 178 of file entitymanager.h.

psWorld* EntityManager::gameWorld
protected

Definition at line 199 of file entitymanager.h.

GEMSupervisor* EntityManager::gem
protected

Definition at line 197 of file entitymanager.h.

bool EntityManager::hasBeenReady
protected

Definition at line 191 of file entitymanager.h.

psMovementInfoMessage* EntityManager::moveinfomsg
protected

Definition at line 201 of file entitymanager.h.

bool EntityManager::ready
protected

Definition at line 190 of file entitymanager.h.

psServerDR* EntityManager::serverdr
protected

Definition at line 192 of file entitymanager.h.

UserManager* EntityManager::usermanager
protected

Definition at line 195 of file entitymanager.h.


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