Planeshift
psCelClient Class Reference

Client version of the Cel Manager Requests world loading. More...

#include <pscelclient.h>

Public Member Functions

void AddInstanceObject (const char *name, csRef< InstanceObject > object)
 Add an instance object to the tree. More...
 
void AddNullFactory (const char *name, csRef< iMeshFactoryWrapper > object)
 
void AttachObject (iObject *object, GEMClientObject *clientObject)
 Attach a client object to a Crystal Space object. More...
 
void CheckEntityQueues ()
 Add one new actor or item entity from the queue. More...
 
GEMClientObjectFindAttachedObject (iObject *object)
 See if there is a client object attached to a given object. More...
 
csPtr< InstanceObjectFindInstanceObject (const char *name) const
 Search for an instance object and return it if existing. More...
 
csArray< GEMClientObject * > FindNearbyEntities (iSector *sector, const csVector3 &pos, float radius, bool doInvisible=false)
 Create a list of all nearby GEM objects. More...
 
csPtr< iMeshFactoryWrapper > FindNullFactory (const char *name) const
 
GEMClientObjectFindObject (EID eid)
 
void ForceEntityQueues ()
 Add all new entities on the queue. More...
 
GEMClientActorGetActorByName (const char *name, bool trueName=true) const
 
psClientDRGetClientDR ()
 
const csPDelArray< GEMClientObject > & GetEntities () const
 
psEntityLabelsGetEntityLabels ()
 
GEMClientActorGetMainPlayer ()
 
const char * GetMainPlayerName ()
 
int GetRequestStatus ()
 
psShadowManagerGetShadowManager ()
 
iSector * GetUnresSector ()
 
psWorldGetWorld () const
 
void HandleItemEffect (const char *factName, iMeshWrapper *mw, bool onGround=true, const char *slot=0, csHash< int, csString > *effectids=0, csHash< int, csString > *lightids=0)
 Check if the item has an effect attached to it and process it if so. More...
 
virtual void HandleMessage (MsgEntry *me)
 
void HandleUnresolvedPos (GEMClientObject *entity, const csVector3 &pos, const csVector3 &rot, const csString &sector)
 This is called when position of some entity could not be resolved (see the UnresolvedPos struct) It adds this position to list of unresolved positions which we will attempt to resolve later and moves the entity to special sector that keeps these unfortunate entities. More...
 
bool Initialize (iObjectRegistry *object_reg, MsgHandler *msghandler)
 
bool InstanceItems ()
 
bool IsMeshSubjectToAction (const char *sector, const char *mesh)
 
bool IsReady ()
 
bool IsUnresSector (iSector *sector)
 
void OnMapsLoaded ()
 Called when new world maps were loaded CelClient looks for GEM Objects which have sectors with unknown name and checks if this name is known now. More...
 
void OnRegionsDeleted (csArray< iCollection * > &regions)
 Called when a region of the world is deleted from the client (because we don't need it loaded now) CelClient removes all GEMClientObjects that are in this region. More...
 
void PruneEntities ()
 
 psCelClient ()
 
void RemoveInstanceObject (const char *name)
 Remove an instance object to the tree. More...
 
void RemoveNullFactory (const char *name)
 
void RemoveObject (GEMClientObject *entity)
 
void replaceRacialGroup (csString &string)
 Substituites in a string the group identifiers like $H $B etc depending on the race of the player. More...
 
void RequestActor ()
 
void RequestServerWorld ()
 
void SetMainActor (GEMClientActor *object)
 
void SetMainPlayerName (const char *name)
 
void SetPlayerReady (bool flag)
 
void SetupWorldColliders ()
 
void UnattachObject (iObject *object, GEMClientObject *clientObject)
 Unattach a client object from a Crystal Space object. More...
 
void Update (bool loaded)
 
virtual ~psCelClient ()
 
- Public Member Functions inherited from psClientNetSubscriber
virtual void HandleMessage (MsgEntry *msg, Client *)
 Interprets a received message and executes the command. More...
 
virtual bool Verify (MsgEntry *, unsigned int, Client *&)
 
virtual ~psClientNetSubscriber ()
 

Protected Member Functions

void AddEntity (GEMClientObject *obj)
 
csList< UnresolvedPos * >::Iterator FindUnresolvedPos (GEMClientObject *entity)
 Finds given entity in list of unresolved entities. More...
 
void HandleActionLocation (MsgEntry *me)
 
void HandleActor (MsgEntry *me)
 
void HandleGroupChange (MsgEntry *me)
 
void HandleGuildChange (MsgEntry *me)
 
void HandleItem (MsgEntry *me)
 
void HandleMecsActivate (MsgEntry *me)
 
void HandleNameChange (MsgEntry *me)
 
void HandleObjectRemoval (MsgEntry *me)
 
void HandleStats (MsgEntry *me)
 Handles a stats message from the server. More...
 
void HandleWorld (MsgEntry *me)
 

Protected Attributes

psClientDRclientdr
 
psEntityLabelsentityLabels
 
psWorldgameWorld
 
GEMClientActorlocal_player
 
csRef< MsgHandlermsghandler
 
csString player_name
 name of player character More...
 
int requeststatus
 
psShadowManagershadowManager
 
csList< UnresolvedPos * > unresPos
 list of entities with unresolved location More...
 
csRef< iSector > unresSector
 sector where we keep these entities More...
 
csRef< iVFS > vfs
 

Detailed Description

Client version of the Cel Manager Requests world loading.

Handles entities client side, attaching players and objects to meshes, placing lights, and effects, ....

Definition at line 108 of file pscelclient.h.

Constructor & Destructor Documentation

psCelClient::psCelClient ( )
virtual psCelClient::~psCelClient ( )
virtual

Member Function Documentation

void psCelClient::AddEntity ( GEMClientObject obj)
protected
void psCelClient::AddInstanceObject ( const char *  name,
csRef< InstanceObject object 
)

Add an instance object to the tree.

void psCelClient::AddNullFactory ( const char *  name,
csRef< iMeshFactoryWrapper >  object 
)
void psCelClient::AttachObject ( iObject *  object,
GEMClientObject clientObject 
)

Attach a client object to a Crystal Space object.

In most cases the Crystal Space object is a meshwrapper.

Parameters
objectThe Crystal Space object we want to attach our client object to.
clientObjectThe client object we want to attach.
void psCelClient::CheckEntityQueues ( )

Add one new actor or item entity from the queue.

GEMClientObject* psCelClient::FindAttachedObject ( iObject *  object)

See if there is a client object attached to a given object.

Parameters
objectThe Cyrstal Space object we want to see if there is a client object attached to.
Returns
A GEMClientObject if it exists that is attached to the Crystal Space object.
csPtr<InstanceObject> psCelClient::FindInstanceObject ( const char *  name) const

Search for an instance object and return it if existing.

Else return 0 csPtr.

csArray<GEMClientObject*> psCelClient::FindNearbyEntities ( iSector *  sector,
const csVector3 &  pos,
float  radius,
bool  doInvisible = false 
)

Create a list of all nearby GEM objects.

Parameters
sectorThe sector to check in.
posThe starting position
radiusThe distance around the starting point to check.
doInvisibleIf true check invisible meshes otherwise ignore them.
Returns
A csArray<> of all the objects in the given radius.
csPtr<iMeshFactoryWrapper> psCelClient::FindNullFactory ( const char *  name) const
GEMClientObject* psCelClient::FindObject ( EID  eid)
csList<UnresolvedPos*>::Iterator psCelClient::FindUnresolvedPos ( GEMClientObject entity)
protected

Finds given entity in list of unresolved entities.

void psCelClient::ForceEntityQueues ( )

Add all new entities on the queue.

GEMClientActor* psCelClient::GetActorByName ( const char *  name,
bool  trueName = true 
) const
psClientDR* psCelClient::GetClientDR ( )
inline

Definition at line 171 of file pscelclient.h.

const csPDelArray<GEMClientObject>& psCelClient::GetEntities ( ) const
inline

Definition at line 175 of file pscelclient.h.

psEntityLabels* psCelClient::GetEntityLabels ( )
inline

Definition at line 186 of file pscelclient.h.

GEMClientActor* psCelClient::GetMainPlayer ( )
inline

Definition at line 205 of file pscelclient.h.

const char* psCelClient::GetMainPlayerName ( )
inline

Definition at line 200 of file pscelclient.h.

int psCelClient::GetRequestStatus ( )
inline

Definition at line 244 of file pscelclient.h.

psShadowManager* psCelClient::GetShadowManager ( )
inline

Definition at line 190 of file pscelclient.h.

iSector* psCelClient::GetUnresSector ( )
inline

Definition at line 239 of file pscelclient.h.

psWorld* psCelClient::GetWorld ( ) const
inline

Definition at line 222 of file pscelclient.h.

void psCelClient::HandleActionLocation ( MsgEntry me)
protected
void psCelClient::HandleActor ( MsgEntry me)
protected
void psCelClient::HandleGroupChange ( MsgEntry me)
protected
void psCelClient::HandleGuildChange ( MsgEntry me)
protected
void psCelClient::HandleItem ( MsgEntry me)
protected
void psCelClient::HandleItemEffect ( const char *  factName,
iMeshWrapper *  mw,
bool  onGround = true,
const char *  slot = 0,
csHash< int, csString > *  effectids = 0,
csHash< int, csString > *  lightids = 0 
)

Check if the item has an effect attached to it and process it if so.

void psCelClient::HandleMecsActivate ( MsgEntry me)
protected
virtual void psCelClient::HandleMessage ( MsgEntry me)
virtual

Implements psClientNetSubscriber.

void psCelClient::HandleNameChange ( MsgEntry me)
protected
void psCelClient::HandleObjectRemoval ( MsgEntry me)
protected
void psCelClient::HandleStats ( MsgEntry me)
protected

Handles a stats message from the server.

This basically just publishes the data to PAWS so various widgets can be updated.

void psCelClient::HandleUnresolvedPos ( GEMClientObject entity,
const csVector3 &  pos,
const csVector3 &  rot,
const csString &  sector 
)

This is called when position of some entity could not be resolved (see the UnresolvedPos struct) It adds this position to list of unresolved positions which we will attempt to resolve later and moves the entity to special sector that keeps these unfortunate entities.

void psCelClient::HandleWorld ( MsgEntry me)
protected
bool psCelClient::Initialize ( iObjectRegistry *  object_reg,
MsgHandler msghandler 
)
bool psCelClient::InstanceItems ( )
inline

Definition at line 317 of file pscelclient.h.

bool psCelClient::IsMeshSubjectToAction ( const char *  sector,
const char *  mesh 
)
bool psCelClient::IsReady ( )
bool psCelClient::IsUnresSector ( iSector *  sector)
inline

Definition at line 235 of file pscelclient.h.

void psCelClient::OnMapsLoaded ( )

Called when new world maps were loaded CelClient looks for GEM Objects which have sectors with unknown name and checks if this name is known now.

void psCelClient::OnRegionsDeleted ( csArray< iCollection * > &  regions)

Called when a region of the world is deleted from the client (because we don't need it loaded now) CelClient removes all GEMClientObjects that are in this region.

void psCelClient::PruneEntities ( )
void psCelClient::RemoveInstanceObject ( const char *  name)

Remove an instance object to the tree.

void psCelClient::RemoveNullFactory ( const char *  name)
void psCelClient::RemoveObject ( GEMClientObject entity)
void psCelClient::replaceRacialGroup ( csString &  string)

Substituites in a string the group identifiers like $H $B etc depending on the race of the player.

Parameters
stringThe string where do to the replacements
void psCelClient::RequestActor ( )
void psCelClient::RequestServerWorld ( )
void psCelClient::SetMainActor ( GEMClientActor object)
void psCelClient::SetMainPlayerName ( const char *  name)
inline

Definition at line 195 of file pscelclient.h.

void psCelClient::SetPlayerReady ( bool  flag)
void psCelClient::SetupWorldColliders ( )
void psCelClient::UnattachObject ( iObject *  object,
GEMClientObject clientObject 
)

Unattach a client object from a Crystal Space object.

In most cases the Crystal Space object is a meshwrapper.

Parameters
objectThe Crystal Space object we want to unattach our client object from.
clientObjectThe client object we want to unattach.
void psCelClient::Update ( bool  loaded)

Member Data Documentation

psClientDR* psCelClient::clientdr
protected

Definition at line 329 of file pscelclient.h.

psEntityLabels* psCelClient::entityLabels
protected

Definition at line 331 of file pscelclient.h.

psWorld* psCelClient::gameWorld
protected

Definition at line 334 of file pscelclient.h.

GEMClientActor* psCelClient::local_player
protected

Definition at line 354 of file pscelclient.h.

csRef<MsgHandler> psCelClient::msghandler
protected

Definition at line 328 of file pscelclient.h.

csString psCelClient::player_name
protected

name of player character

Definition at line 355 of file pscelclient.h.

int psCelClient::requeststatus
protected

Definition at line 326 of file pscelclient.h.

psShadowManager* psCelClient::shadowManager
protected

Definition at line 332 of file pscelclient.h.

csList<UnresolvedPos*> psCelClient::unresPos
protected

list of entities with unresolved location

Definition at line 357 of file pscelclient.h.

csRef<iSector> psCelClient::unresSector
protected

sector where we keep these entities

Definition at line 358 of file pscelclient.h.

csRef<iVFS> psCelClient::vfs
protected

Definition at line 327 of file pscelclient.h.


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