Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

EntityManager Class Reference

Manages CEL entities on the server. More...

#include <entitymanager.h>

List of all members.

Public Member Functions

bool AddRideRelation (gemActor *rider, gemActor *mount)
gemNPCCloneNPC (psCharacter *chardata)
 Clone a NPC.
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.
gemNPCCreateHiredNPC (gemActor *owner, PID masterPID, const csString &name)
 Create a new hired NPC.
gemItemCreateItem (psItem *iteminstance, bool transient, int tribeID=0)
EID CreateNPC (psCharacter *chardata, InstanceID instance, csVector3 pos, iSector *sector, float yrot, bool updateProxList=true, bool alwaysWatching=false)
EID CreateNPC (PID npcID, bool updateProxList=true, bool alwaysWatching=false)
EID CreateNPC (psCharacter *chardata, bool updateProxList=true, bool alwaysWatching=false)
bool CreatePlayer (Client *client)
bool DeleteActor (gemObject *actor)
 Delete an actor from the world.
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 ()

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

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 ( psCharacter chardata,
bool  updateProxList = true,
bool  alwaysWatching = false 
)
EID EntityManager::CreateNPC ( PID  npcID,
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

Definition at line 177 of file entitymanager.h.

Definition at line 196 of file entitymanager.h.

Definition at line 193 of file entitymanager.h.

Definition at line 194 of file entitymanager.h.

iEngine* EntityManager::engine [protected]

Definition at line 198 of file entitymanager.h.

Definition at line 178 of file entitymanager.h.

Definition at line 199 of file entitymanager.h.

Definition at line 197 of file entitymanager.h.

bool EntityManager::hasBeenReady [protected]

Definition at line 191 of file entitymanager.h.

Definition at line 201 of file entitymanager.h.

bool EntityManager::ready [protected]

Definition at line 190 of file entitymanager.h.

Definition at line 192 of file entitymanager.h.

Definition at line 195 of file entitymanager.h.


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