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. More... | |
void | AddItemEntity (gemItem *item) |
void | AttachObject (iObject *object, gemObject *gobject) |
Attach a server gemObject to a Crystal Space object. More... | |
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. More... | |
csArray< gemObject * > | FindNearbyEntities (iSector *sector, const csVector3 &pos, InstanceID instance, float radius, bool doInvisible=false) |
Create a list of all nearby gem objects. More... | |
csArray< gemObject * > | FindSectorEntities (iSector *sector, bool doInvisible=false) |
Create a list of all gem objects in a sector. More... | |
GEMSupervisor (iObjectRegistry *objreg, psDatabase *db, EntityManager *entitymanager, CacheManager *cachemanager) | |
Create a new singleton of the GEM Supervisor object. More... | |
void | GetAllEntityPos (csArray< psAllEntityPosMessage > &msgs) |
csHash< gemObject *, EID > & | GetAllGEMS () |
Get a hash of all the current entities on the server. More... | |
void | GetPlayerObjects (PID playerID, csArray< gemObject * > &list) |
Gets a list of all the 'live' entities that this player has ownership of. More... | |
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. More... | |
void | UnattachObject (iObject *object, gemObject *gobject) |
Unattach a gemObject from a Crystal Space object. More... | |
void | UpdateAllDR () |
void | UpdateAllStats () |
Searches all actors in the game, and updates their vitals. More... | |
virtual | ~GEMSupervisor () |
Destroy this singleton. More... | |
Search functions | |
EID | FindItemID (psItem *item) |
Find an entity ID (EID) for an item. More... | |
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) |
![]() | |
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... | |
![]() | |
csArray< csString > | DecodeCommandArea (Client *client, csString target) |
Decodes an area: expression. More... | |
gemObject * | FindObjectByString (const csString &str, gemActor *me) const |
Find the object we are referring to in str. More... | |
Client * | FindPlayerClient (const char *name) |
Finds Client* of character with given name. More... | |
virtual bool | Verify (MsgEntry *pMsg, unsigned int flags, Client *&client) |
Public Attributes | |
psDatabase * | database |
The main PlaneShift database object. More... | |
NPCManager * | npcmanager |
NPC controller. More... | |
iObjectRegistry * | object_reg |
The Crystal Space Object Registry. More... | |
Protected Member Functions | |
EID | GetNextID () |
Get the next ID for an object. More... | |
Protected Attributes | |
csHash< gemActor *, PID > | actors_by_pid |
A list of all the actors stored by PID (player/character ID). More... | |
csRef< iEngine > | engine |
Stored here to save expensive csQueryRegistry calls. More... | |
csHash< gemObject *, EID > | entities_by_eid |
A list of all the entities stored by EID (entity/gem ID). More... | |
csHash< gemItem *, uint32 > | items_by_uid |
A list of all the items stored by UID (psItem ID). More... | |
uint32 | nextEID |
The next ID available for an object. More... | |
Additional Inherited Members | |
![]() | |
typedef void(GEMSupervisor::* | FunctionPointer) (MsgEntry *, Client *) |
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 |
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 | ( | EID | cel_id | ) |
gemObject* GEMSupervisor::FindObject | ( | const csString & | name | ) |
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 | ) |
|
inline |
|
protected |
Get the next ID for an object.
void GEMSupervisor::GetPlayerObjects | ( | PID | playerID, |
csArray< gemObject * > & | list | ||
) |
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 | ( | ) |
Searches all actors in the game, and updates their vitals.
|
protected |
psDatabase* GEMSupervisor::database |
|
protected |
|
protected |
|
protected |
|
protected |
NPCManager* GEMSupervisor::npcmanager |
iObjectRegistry* GEMSupervisor::object_reg |