Planeshift
|
This class holds the refs to the core factories, etc in CEL. More...
#include <gem.h>
Public Member Functions | |
void | ActivateNPCs (AccountID superclientID) |
void | AddActorEntity (gemActor *actor) |
void | AddEntity (gemObject *obj, EID objEid) |
Ugly function, used for gemAL. | |
void | AddItemEntity (gemItem *item) |
void | AttachObject (iObject *object, gemObject *gobject) |
Attach a server gemObject to a Crystal Space object. | |
int | CountManagedNPCs (AccountID superclientID) |
EID | CreateEntity (gemObject *obj) |
void | FillNPCList (MsgEntry *msg, AccountID superclientID) |
gemObject * | FindAttachedObject (iObject *object) |
See if there is a gemObject attached to a given Crystal Space object. | |
csArray< gemObject * > | FindNearbyEntities (iSector *sector, const csVector3 &pos, InstanceID instance, float radius, bool doInvisible=false) |
Create a list of all nearby gem objects. | |
csArray< gemObject * > | FindSectorEntities (iSector *sector, bool doInvisible=false) |
Create a list of all gem objects in a sector. | |
GEMSupervisor (iObjectRegistry *objreg, psDatabase *db, EntityManager *entitymanager, CacheManager *cachemanager) | |
Create a new singleton of the GEM Supervisor object. | |
void | GetAllEntityPos (csArray< psAllEntityPosMessage > &msgs) |
csHash< gemObject *, EID > & | GetAllGEMS () |
Get a hash of all the current entities on the server. | |
void | GetPlayerObjects (PID playerID, csArray< gemObject * > &list) |
Gets a list of all the 'live' entities that this player has ownership of. | |
void | HandleDamageMessage (MsgEntry *me, Client *client) |
void | HandleStatDRUpdateMessage (MsgEntry *me, Client *client) |
void | HandleStatsMessage (MsgEntry *me, Client *client) |
void | RemoveActorEntity (gemActor *actor) |
void | RemoveEntity (gemObject *which) |
void | RemoveItemEntity (gemItem *item, uint32 uid) |
void | RemovePlayerFromLootables (PID playerID) |
void | SendAllNPCStats (AccountID superclientID) |
void | StopAllNPCs (AccountID superclientID) |
void | Teleport (gemObject *object, float x, float y, float z, float rot, const char *sectorname) |
Teleport a player to a location. | |
void | UnattachObject (iObject *object, gemObject *gobject) |
Unattach a gemObject from a Crystal Space object. | |
void | UpdateAllDR () |
void | UpdateAllStats () |
virtual | ~GEMSupervisor () |
Destroy this singleton. | |
Search functions | |
EID | FindItemID (psItem *item) |
Find an entity ID (EID) for an item. | |
gemObject * | FindObject (EID cel_id) |
gemObject * | FindObject (const csString &name) |
gemActor * | FindPlayerEntity (PID player_id) |
gemNPC * | FindNPCEntity (PID npc_id) |
gemNPC * | FindNPCEntity (EID eid) |
gemItem * | FindItemEntity (uint32 item_id) |
Public Attributes | |
psDatabase * | database |
The main PlaneShift database object. | |
NPCManager * | npcmanager |
NPC controller. | |
iObjectRegistry * | object_reg |
The Crystal Space Object Registry. | |
Protected Member Functions | |
EID | GetNextID () |
Get the next ID for an object. | |
Protected Attributes | |
csHash< gemActor *, PID > | actors_by_pid |
A list of all the actors stored by PID (player/character ID). | |
csRef< iEngine > | engine |
Stored here to save expensive csQueryRegistry calls. | |
csHash< gemObject *, EID > | entities_by_eid |
A list of all the entities stored by EID (entity/gem ID). | |
csHash< gemItem *, uint32 > | items_by_uid |
A list of all the items stored by UID (psItem ID). | |
uint32 | nextEID |
The next ID available for an object. |
GEMSupervisor::GEMSupervisor | ( | iObjectRegistry * | objreg, |
psDatabase * | db, | ||
EntityManager * | entitymanager, | ||
CacheManager * | cachemanager | ||
) |
Create a new singleton of the GEM Supervisor object.
objreg | The Crystal Space Object Registry. |
db | The main PlaneShift database. |
entitymanager | The EntityManager. |
cachemanager | The CacheManager. |
virtual GEMSupervisor::~GEMSupervisor | ( | ) | [virtual] |
Destroy this singleton.
This will only be ever called on a server shutdown.
void GEMSupervisor::ActivateNPCs | ( | AccountID | superclientID | ) |
void GEMSupervisor::AddActorEntity | ( | gemActor * | actor | ) |
void GEMSupervisor::AddEntity | ( | gemObject * | obj, |
EID | objEid | ||
) |
Ugly function, used for gemAL.
void GEMSupervisor::AddItemEntity | ( | gemItem * | item | ) |
void GEMSupervisor::AttachObject | ( | iObject * | object, |
gemObject * | gobject | ||
) |
int GEMSupervisor::CountManagedNPCs | ( | AccountID | superclientID | ) |
EID GEMSupervisor::CreateEntity | ( | gemObject * | obj | ) |
void GEMSupervisor::FillNPCList | ( | MsgEntry * | msg, |
AccountID | superclientID | ||
) |
gemObject* GEMSupervisor::FindAttachedObject | ( | iObject * | object | ) |
gemItem* GEMSupervisor::FindItemEntity | ( | uint32 | item_id | ) |
EID GEMSupervisor::FindItemID | ( | psItem * | item | ) |
Find an entity ID (EID) for an item.
item | The psItem that we want to find the entity ID for. |
csArray<gemObject*> GEMSupervisor::FindNearbyEntities | ( | iSector * | sector, |
const csVector3 & | pos, | ||
InstanceID | instance, | ||
float | radius, | ||
bool | doInvisible = false |
||
) |
Create a list of all nearby gem objects.
sector | The sector to check in. |
pos | The starting position |
instance | The instance ID for the starting point |
radius | The distance around the starting point to check. |
doInvisible | If true check invisible meshes otherwise ignore them. |
gemNPC* GEMSupervisor::FindNPCEntity | ( | PID | npc_id | ) |
gemNPC* GEMSupervisor::FindNPCEntity | ( | EID | eid | ) |
gemObject* GEMSupervisor::FindObject | ( | const csString & | name | ) |
gemObject* GEMSupervisor::FindObject | ( | EID | cel_id | ) |
gemActor* GEMSupervisor::FindPlayerEntity | ( | PID | player_id | ) |
csArray<gemObject*> GEMSupervisor::FindSectorEntities | ( | iSector * | sector, |
bool | doInvisible = false |
||
) |
Create a list of all gem objects in a sector.
sector | The sector to check in. |
doInvisible | If true check invisible meshes otherwise ignore them. |
void GEMSupervisor::GetAllEntityPos | ( | csArray< psAllEntityPosMessage > & | msgs | ) |
csHash<gemObject*, EID>& GEMSupervisor::GetAllGEMS | ( | ) | [inline] |
EID GEMSupervisor::GetNextID | ( | ) | [protected] |
Get the next ID for an object.
Gets a list of all the 'live' entities that this player has ownership of.
This can be things like items in containers or work items.
playerID | The character owner ID we are looking for. |
list | The populated list of items that are active in game. |
void GEMSupervisor::RemoveActorEntity | ( | gemActor * | actor | ) |
void GEMSupervisor::RemoveEntity | ( | gemObject * | which | ) |
void GEMSupervisor::RemoveItemEntity | ( | gemItem * | item, |
uint32 | uid | ||
) |
void GEMSupervisor::RemovePlayerFromLootables | ( | PID | playerID | ) |
void GEMSupervisor::SendAllNPCStats | ( | AccountID | superclientID | ) |
void GEMSupervisor::StopAllNPCs | ( | AccountID | superclientID | ) |
void GEMSupervisor::UnattachObject | ( | iObject * | object, |
gemObject * | gobject | ||
) |
Unattach a gemObject from a Crystal Space object.
In most cases the Crystal Space object is a meshwrapper.
object | The Crystal Space object we want to unattach our client object from. |
gobject | The gem object we want to unattach. |
void GEMSupervisor::UpdateAllDR | ( | ) |
void GEMSupervisor::UpdateAllStats | ( | ) |
csHash<gemActor*, PID> GEMSupervisor::actors_by_pid [protected] |
csRef<iEngine> GEMSupervisor::engine [protected] |
csHash<gemObject*, EID> GEMSupervisor::entities_by_eid [protected] |
csHash<gemItem*, uint32> GEMSupervisor::items_by_uid [protected] |
uint32 GEMSupervisor::nextEID [protected] |
iObjectRegistry* GEMSupervisor::object_reg |