|
Planeshift
|
The main NPC Client class holding references to important superclient objects. More...
#include <npcclient.h>
Classes | |
| struct | DeferredNPC |
| Keep information about deferred NPCs during loading. More... | |
Public Member Functions | |
| void | Add (gemNPCObject *object) |
| bool | AddNPCType (csString newType) |
| Add an NPCType. | |
| void | AddRaceInfo (const psNPCRaceListMessage::NPCRaceInfo_t &raceInfo) |
| Add a race info to the race info list. | |
| void | AttachNPC (gemNPCActor *actor, uint8_t DRcounter, EID ownerEID, PID masterID) |
| void | AttachObject (iObject *object, gemNPCObject *gobject) |
| Attach a server gemObject to a Crystal Space object. | |
| virtual void | CatchCommand (const char *cmd) |
| Catch a command from the console. | |
| bool | CheckAttachTribes (NPC *npc) |
| Loop through every tribe and check if this npc is a member. | |
| void | Disconnect () |
| Disconnect from server nicely, before quitting. | |
| bool | DumpNPC (const char *pattern) |
| Find one npc and print its current state info. | |
| bool | DumpRace (const char *pattern) |
| Dump all race infos. | |
| void | EnableDisableNPCs (const char *pattern, bool enable) |
| Enable or disable NPCs. | |
| gemNPCObject * | FindAttachedObject (iObject *object) |
| See if there is a gemObject attached to a given Crystal Space object. | |
| gemNPCObject * | FindCharacterID (PID pid) |
| csList< Edge * > | FindEdgeRoute (Waypoint *start, Waypoint *end, const psPathNetwork::RouteFilter *filter) |
| Find the shortest route between waypoint start and stop. | |
| gemNPCObject * | FindEntityByName (const char *name) |
| Find named entity. | |
| gemNPCObject * | FindEntityID (EID eid) |
| Location * | FindLocation (const char *loctype, const char *name) |
| This function handles the searching for the specified object type and basically does the work for the <locate> script command. | |
| LocationType * | FindLocation (const char *locname) |
| Find a location with a given name. | |
| csArray< gemNPCActor * > | FindNearbyActors (iSector *sector, const csVector3 &pos, float radius, bool doInvisible=false) |
| Create a list of all nearby gem actors. | |
| csArray< gemNPCObject * > | FindNearbyEntities (iSector *sector, const csVector3 &pos, float radius, bool doInvisible=false) |
| Create a list of all nearby gem objects. | |
| Location * | FindNearestLocation (const char *loctype, csVector3 &pos, iSector *sector, float range=-1, float *found_range=NULL) |
| This function handles the searching for the specified object type and basically does the work for the <locate> script command. | |
| Waypoint * | FindNearestWaypoint (const csVector3 &v, iSector *sector, float range=-1, float *found_range=NULL) |
| This iterates over all waypoints and finds the nearest one. | |
| Waypoint * | FindNearestWaypoint (const char *group, csVector3 &v, iSector *sector, float range=-1, float *found_range=NULL) |
| This iterates over all waypoints and finds the nearest one with the given group. | |
| Waypoint * | FindNearestWaypoint (gemNPCObject *entity, float range, float *found_range) |
| Return the nearest waypoint to the entity. | |
| NPC * | FindNPC (EID entid) |
| Find the NPC* attached to the entity with the specified EID. | |
| NPC * | FindNPCByPID (PID character_id) |
| Find the NPC* attached to the entity with the specified character ID. | |
| NPCType * | FindNPCType (const char *npctype_name) |
| This function handles the searching for the specified NPCType name so that other NPCTypes can subclass an existing one. | |
| psPath * | FindPath (const char *name) |
| Find a given path. | |
| Location * | FindRandomLocation (const char *loctype, csVector3 &pos, iSector *sector, float range=-1, float *found_range=NULL) |
| This function handles the searching for the specified object type and basically does the work for the <locate> script command. | |
| Waypoint * | FindRandomWaypoint (const csVector3 &v, iSector *sector, float range=-1, float *found_range=NULL) |
| This iterates over all waypoints and finds the nearest one. | |
| Waypoint * | FindRandomWaypoint (const char *group, csVector3 &v, iSector *sector, float range=-1, float *found_range=NULL) |
| This iterates over all waypoints and finds the nearest one with the given group. | |
| LocationType * | FindRegion (const char *regname) |
| Find a region with a given name. | |
| Waypoint * | FindWaypoint (gemNPCObject *entity) |
| This iterates over all waypoints and finds the one the entity is at. | |
| Waypoint * | FindWaypoint (int id) |
| This iterates over all waypoints and finds the one with the given id. | |
| Waypoint * | FindWaypoint (const char *name, WaypointAlias **alias) |
| This iterates over all waypoints and finds the one with the given name. | |
| csList< Waypoint * > | FindWaypointRoute (Waypoint *start, Waypoint *end, const psPathNetwork::RouteFilter *filter) |
| Find the shortest route between waypoint start and stop. | |
| bool | FirePerception (int NPCId, const char *perception) |
| Fire perception. | |
| iCollideSystem * | GetCollDetSys () |
| iEngine * | GetEngine () |
| EventManager * | GetEventManager () |
| Returns the Event Manger. | |
| LocationManager * | GetLocationManager () |
| Return the location manager of the npcclient. | |
| MathScriptEngine * | GetMathScriptEngine () |
| Returns the Math Scripting Engine. | |
| iCelHNavStruct * | GetNavStruct () |
| psNetConnection * | GetNetConnection () |
| Returns the network handler so script ops can invoke the network. | |
| NetworkManager * | GetNetworkMgr () |
| Returns the network handler so script ops can invoke the network. | |
| size_t | GetNpcListAmount () |
| List the amount of npc currently loaded. | |
| iObjectRegistry * | GetObjectReg () |
| Just make iObjectRegistry available to other classes. | |
| psPathNetwork * | GetPathNetwork () |
| Return the path network of the npcclient. | |
| psNPCRaceListMessage::NPCRaceInfo_t * | GetRaceInfo (const char *name) |
| Get pointer to a race info to the given race name. | |
| csPtr< iDocumentNode > | GetRootNode (const char *xmlfile) |
| Load and return the root node of an xml file. | |
| float | GetRunVelocity (csString &race) |
| Find the run velocity for a given race. | |
| unsigned int | GetTickCounter () const |
| Retrive the current tick counter. | |
| Tribe * | GetTribe (int id) |
| Make a tribe pointer available - for the network manager. | |
| iVFS * | GetVFS () |
| float | GetWalkVelocity (csString &race) |
| Find the walk velocity for a given race. | |
| psWorld * | GetWorld () |
| void | HandleDeath (NPC *who) |
| Special handling for death notifications from the server is required, to stop behavior scripting, delete hate lists, etc. | |
| bool | InfoNPC (const char *pattern) |
| Find one npc and print its current info. | |
| bool | Initialize (iObjectRegistry *object_reg, const char *host, const char *user, const char *pass, int port) |
| Initialize the superclient. | |
| bool | IsReady () |
| If a world is ready and loaded this returns true. | |
| void | ListAllEntities (const char *pattern, bool onlyCharacters=false) |
| List all known entities on superclient. | |
| void | ListAllNPCs (const char *pattern) |
| List all NPCs matching pattern to console. | |
| void | ListLocations (const char *pattern) |
| List all locations matching pattern to console. | |
| void | ListPaths (const char *pattern) |
| List all paths matching pattern to console. | |
| void | ListReactions (const char *pattern) |
| List all the registered reactions. | |
| void | ListTribeRecipes (const char *tribeID) |
| List all the active recipes in a tribe. | |
| void | ListTribes (const char *pattern) |
| List all tribes matching pattern to console. | |
| void | ListWaypoints (const char *pattern) |
| List all waypoints matching pattern to console. | |
| void | LoadCompleted () |
| To be called when the the load process is completed. | |
| void | LoadLogSettings () |
| Used to load the log settings. | |
| bool | LoadMap (const char *mapfile) |
| Load a map into a region. | |
| bool | LoadNPCTypes (iDocumentNode *root) |
| Decode a npc type from the XML definition. | |
| bool | LoadNPCTypes () |
| Load NPC Types from DB. | |
| bool | LoadPathNetwork () |
| made public for the networkmanager to call it | |
| void | MainLoop () |
| Load and fork off a new thread for the Server Console. | |
| psNPCClient () | |
| Constructor. | |
| NPC * | ReadMasteredNPC (PID char_id, PID master_id) |
| Clones a master npc to a new npc whith the passed PID. | |
| NPC * | ReadSingleNPC (PID char_id, PID master_id=0) |
| void | RegisterReaction (NPC *npc, Reaction *reaction) |
| Register a reaction for an NPC with the client. | |
| void | Remove (gemNPCObject *object) |
| void | Remove (NPC *npc) |
| Remove NPC from NPC Client. | |
| void | RemoveAll () |
| void | SaveLogSettings () |
| Used to save the log settings. | |
| void | SetEntityPos (EID id, csVector3 &pos, iSector *sector, InstanceID instance, bool force=false) |
| SetEntityPos finds the given ID entity, and updates its position in mesh and linmove. | |
| iCelHPath * | ShortestPath (NPC *npc, const csVector3 &from, iSector *fromSector, const csVector3 &goal, iSector *goalSector) |
| void | Tick () |
| This does 1 AI calc per Tribe then returns. | |
| void | TriggerEvent (Perception *pcpt, float maxRange=-1.0, csVector3 *basePos=NULL, iSector *baseSector=NULL, bool sameSector=false) |
| Sends a perception to all npcs. | |
| void | UnattachObject (iObject *object, gemNPCObject *gobject) |
| Unattach a gemObject from a Crystal Space object. | |
| void | UpdateTime (int minute, int hour, int day, int month, int year) |
| Update with time from server in order to start timed events. | |
| ~psNPCClient () | |
| Cleans up all allocated memory and removes all the players from the world. | |
Game time | |
Functions to retrive the game time. | |
| int | GetGameTODMinute () |
| Get the minute of the game time of day. | |
| int | GetGameTODHour () |
| Get the hour of the game time of day. | |
| int | GetGameTODDay () |
| Get the day of the game time of day. | |
| int | GetGameTODMonth () |
| Get the month of the game time of day. | |
| int | GetGameTODYear () |
| Get the year of the game time of day. | |
iScriptableVar implementation | |
Functions that implement the iScriptableVar interface. | |
| virtual double | GetProperty (MathEnvironment *env, const char *ptr) |
| virtual double | CalcFunction (MathEnvironment *env, const char *functionName, const double *params) |
| virtual const char * | ToString () |
Static Public Attributes | |
| static psNPCClient * | npcclient |
Protected Member Functions | |
| bool | LoadLocations () |
| Load locations from the DB. | |
| bool | LoadTribes () |
| Load Tribes from the DB. | |
| void | PerceptProximityItems () |
| Find all items that are close to NPC's and percept the NPC. | |
| void | PerceptProximityLocations () |
| Find all locations that are close to NPC's and percept the NPC. | |
| void | PerceptProximityTribeHome () |
| Find all actors that are in a tribe home and percept tribe and actor if it is an NPC. | |
| bool | ReadNPCsFromDatabase () |
| Read NPCs from the DB. | |
Protected Attributes | |
| csArray< gemNPCActor * > | all_gem_actors |
| csArray< gemNPCItem * > | all_gem_items |
| csPDelArray< gemNPCObject > | all_gem_objects |
| csHash< gemNPCObject *, EID > | all_gem_objects_by_eid |
| csHash< gemNPCObject *, PID > | all_gem_objects_by_pid |
| csHash< NPC *, csString > | allReactions |
| Hash of all registered reactions. | |
| csRef< iCollideSystem > | cdsys |
| csRef< iConfigManager > | configmanager |
| psNetConnection * | connection |
| int | current_long_range_perception_index |
| Counters used to distribute load regarding perception generation. | |
| int | current_long_range_perception_loc_index |
| int | current_tribe_home_perception_index |
| psDatabase * | database |
| csRef< iEngine > | engine |
| EventManager * | eventmanager |
| int | gameDay |
| int | gameHour |
| int | gameMinute |
| int | gameMonth |
| csTicks | gameTimeUpdated |
| int | gameYear |
| LocationManager * | locationManager |
| The manager for location. | |
| MathScriptEngine * | mathScriptEngine |
| csRef< MsgHandler > | msghandler |
| csRef< iCelHNavStruct > | navStruct |
| NetworkManager * | network |
| csArray< csString > | notUsedReactions |
| List of not matched reactions. | |
| csPDelArray< NPC > | npcs |
| csArray< DeferredNPC > | npcsDeferred |
| csHash< NPCType *, const char * > | npctypes |
| iObjectRegistry * | objreg |
| psPathNetwork * | pathNetwork |
| csHash < psNPCRaceListMessage::NPCRaceInfo_t, csString > | raceInfos |
| Information about all the races. | |
| RecipeManager * | recipemanager |
| ServerConsole * | serverconsole |
| unsigned int | tick_counter |
| Counter used to start events at every nth client tick. | |
| csPDelArray< Tribe > | tribes |
| csRef< iVFS > | vfs |
| psWorld * | world |
The main NPC Client class holding references to important superclient objects.
Definition at line 81 of file npcclient.h.
| psNPCClient::~psNPCClient | ( | ) |
Cleans up all allocated memory and removes all the players from the world.
| void psNPCClient::Add | ( | gemNPCObject * | object | ) |
| bool psNPCClient::AddNPCType | ( | csString | newType | ) |
| void psNPCClient::AddRaceInfo | ( | const psNPCRaceListMessage::NPCRaceInfo_t & | raceInfo | ) |
Add a race info to the race info list.
| void psNPCClient::AttachNPC | ( | gemNPCActor * | actor, |
| uint8_t | DRcounter, | ||
| EID | ownerEID, | ||
| PID | masterID | ||
| ) |
| void psNPCClient::AttachObject | ( | iObject * | object, |
| gemNPCObject * | gobject | ||
| ) |
| virtual double psNPCClient::CalcFunction | ( | MathEnvironment * | env, |
| const char * | functionName, | ||
| const double * | params | ||
| ) | [virtual] |
Implements iScriptableVar.
| virtual void psNPCClient::CatchCommand | ( | const char * | cmd | ) | [virtual] |
| bool psNPCClient::CheckAttachTribes | ( | NPC * | npc | ) |
Loop through every tribe and check if this npc is a member.
| void psNPCClient::Disconnect | ( | ) |
Disconnect from server nicely, before quitting.
| bool psNPCClient::DumpNPC | ( | const char * | pattern | ) |
Find one npc and print its current state info.
| bool psNPCClient::DumpRace | ( | const char * | pattern | ) |
Dump all race infos.
| void psNPCClient::EnableDisableNPCs | ( | const char * | pattern, |
| bool | enable | ||
| ) |
Enable or disable NPCs.
Alter the Disabled state of NPCs.
| pattern | Used to mach NPC(s) to enable or disable. |
| enable | Set to true if the NPC should be enabled. |
| gemNPCObject* psNPCClient::FindAttachedObject | ( | iObject * | object | ) |
See if there is a gemObject attached to a given Crystal Space object.
| object | The Cyrstal Space object we want to see if there is an object attached to. |
| gemNPCObject* psNPCClient::FindCharacterID | ( | PID | pid | ) |
| csList<Edge*> psNPCClient::FindEdgeRoute | ( | Waypoint * | start, |
| Waypoint * | end, | ||
| const psPathNetwork::RouteFilter * | filter | ||
| ) |
Find the shortest route between waypoint start and stop.
| gemNPCObject* psNPCClient::FindEntityByName | ( | const char * | name | ) |
Find named entity.
Return first entity that macht the given name.
| gemNPCObject* psNPCClient::FindEntityID | ( | EID | eid | ) |
| LocationType* psNPCClient::FindLocation | ( | const char * | locname | ) |
Find a location with a given name.
This function handles the searching for the specified location type so that other functions can refer to the location type directly.
| Location* psNPCClient::FindLocation | ( | const char * | loctype, |
| const char * | name | ||
| ) |
This function handles the searching for the specified object type and basically does the work for the <locate> script command.
| csArray<gemNPCActor*> psNPCClient::FindNearbyActors | ( | iSector * | sector, |
| const csVector3 & | pos, | ||
| float | radius, | ||
| bool | doInvisible = false |
||
| ) |
Create a list of all nearby gem actors.
| sector | The sector to check in. |
| pos | The starting position |
| radius | The distance around the starting point to check. |
| doInvisible | If true check invisible meshes otherwise ignore them. |
| csArray<gemNPCObject*> psNPCClient::FindNearbyEntities | ( | iSector * | sector, |
| const csVector3 & | pos, | ||
| float | radius, | ||
| bool | doInvisible = false |
||
| ) |
Create a list of all nearby gem objects.
| sector | The sector to check in. |
| pos | The starting position |
| radius | The distance around the starting point to check. |
| doInvisible | If true check invisible meshes otherwise ignore them. |
| Location* psNPCClient::FindNearestLocation | ( | const char * | loctype, |
| csVector3 & | pos, | ||
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This function handles the searching for the specified object type and basically does the work for the <locate> script command.
| Waypoint* psNPCClient::FindNearestWaypoint | ( | const csVector3 & | v, |
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This iterates over all waypoints and finds the nearest one.
There is probably a more efficient structure to accomplish this.
| Waypoint* psNPCClient::FindNearestWaypoint | ( | const char * | group, |
| csVector3 & | v, | ||
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This iterates over all waypoints and finds the nearest one with the given group.
There is probably a more efficient structure to accomplish this.
| Waypoint* psNPCClient::FindNearestWaypoint | ( | gemNPCObject * | entity, |
| float | range, | ||
| float * | found_range | ||
| ) |
Return the nearest waypoint to the entity.
| NPC* psNPCClient::FindNPC | ( | EID | entid | ) |
| NPC* psNPCClient::FindNPCByPID | ( | PID | character_id | ) |
| NPCType* psNPCClient::FindNPCType | ( | const char * | npctype_name | ) |
This function handles the searching for the specified NPCType name so that other NPCTypes can subclass an existing one.
| psPath* psNPCClient::FindPath | ( | const char * | name | ) |
Find a given path.
| name | The name of the path. |
| Location* psNPCClient::FindRandomLocation | ( | const char * | loctype, |
| csVector3 & | pos, | ||
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This function handles the searching for the specified object type and basically does the work for the <locate> script command.
| Waypoint* psNPCClient::FindRandomWaypoint | ( | const csVector3 & | v, |
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This iterates over all waypoints and finds the nearest one.
There is probably a more efficient structure to accomplish this.
| Waypoint* psNPCClient::FindRandomWaypoint | ( | const char * | group, |
| csVector3 & | v, | ||
| iSector * | sector, | ||
| float | range = -1, |
||
| float * | found_range = NULL |
||
| ) |
This iterates over all waypoints and finds the nearest one with the given group.
There is probably a more efficient structure to accomplish this.
| LocationType* psNPCClient::FindRegion | ( | const char * | regname | ) |
Find a region with a given name.
This function handles the searching for the specified region name so that other functions can refer to the region directly.
| Waypoint* psNPCClient::FindWaypoint | ( | gemNPCObject * | entity | ) |
This iterates over all waypoints and finds the one the entity is at.
There is probably a more efficient structure to accomplish this.
This iterates over all waypoints and finds the one with the given id.
There is probably a more efficient structure to accomplish this.
| Waypoint* psNPCClient::FindWaypoint | ( | const char * | name, |
| WaypointAlias ** | alias | ||
| ) |
This iterates over all waypoints and finds the one with the given name.
There is probably a more efficient structure to accomplish this.
| csList<Waypoint*> psNPCClient::FindWaypointRoute | ( | Waypoint * | start, |
| Waypoint * | end, | ||
| const psPathNetwork::RouteFilter * | filter | ||
| ) |
Find the shortest route between waypoint start and stop.
| bool psNPCClient::FirePerception | ( | int | NPCId, |
| const char * | perception | ||
| ) |
Fire perception.
Method used by the console command 'fireperc'. It fires a perception on the given npc.
| NPCId | NPC on which to fire perc |
| perception | The perception to fire |
| iCollideSystem* psNPCClient::GetCollDetSys | ( | ) | [inline] |
Definition at line 508 of file npcclient.h.
| iEngine* psNPCClient::GetEngine | ( | ) | [inline] |
Definition at line 550 of file npcclient.h.
| EventManager* psNPCClient::GetEventManager | ( | ) | [inline] |
Returns the Event Manger.
Definition at line 342 of file npcclient.h.
| int psNPCClient::GetGameTODDay | ( | ) | [inline] |
Get the day of the game time of day.
Definition at line 584 of file npcclient.h.
| int psNPCClient::GetGameTODHour | ( | ) | [inline] |
Get the hour of the game time of day.
Definition at line 576 of file npcclient.h.
| int psNPCClient::GetGameTODMinute | ( | ) | [inline] |
Get the minute of the game time of day.
Definition at line 568 of file npcclient.h.
| int psNPCClient::GetGameTODMonth | ( | ) | [inline] |
Get the month of the game time of day.
Definition at line 592 of file npcclient.h.
| int psNPCClient::GetGameTODYear | ( | ) | [inline] |
Get the year of the game time of day.
Definition at line 600 of file npcclient.h.
| LocationManager* psNPCClient::GetLocationManager | ( | ) | [inline] |
Return the location manager of the npcclient.
Definition at line 718 of file npcclient.h.
| MathScriptEngine* psNPCClient::GetMathScriptEngine | ( | ) | [inline] |
Returns the Math Scripting Engine.
Definition at line 352 of file npcclient.h.
| iCelHNavStruct* psNPCClient::GetNavStruct | ( | ) | [inline] |
Definition at line 538 of file npcclient.h.
| psNetConnection* psNPCClient::GetNetConnection | ( | ) | [inline] |
Returns the network handler so script ops can invoke the network.
Definition at line 309 of file npcclient.h.
| NetworkManager* psNPCClient::GetNetworkMgr | ( | ) | [inline] |
Returns the network handler so script ops can invoke the network.
Definition at line 301 of file npcclient.h.
| size_t psNPCClient::GetNpcListAmount | ( | ) | [inline] |
List the amount of npc currently loaded.
Definition at line 416 of file npcclient.h.
| iObjectRegistry* psNPCClient::GetObjectReg | ( | ) | [inline] |
Just make iObjectRegistry available to other classes.
Definition at line 123 of file npcclient.h.
| psPathNetwork* psNPCClient::GetPathNetwork | ( | ) | [inline] |
Return the path network of the npcclient.
Definition at line 710 of file npcclient.h.
| virtual double psNPCClient::GetProperty | ( | MathEnvironment * | env, |
| const char * | ptr | ||
| ) | [virtual] |
Implements iScriptableVar.
| psNPCRaceListMessage::NPCRaceInfo_t* psNPCClient::GetRaceInfo | ( | const char * | name | ) |
Get pointer to a race info to the given race name.
| csPtr<iDocumentNode> psNPCClient::GetRootNode | ( | const char * | xmlfile | ) |
Load and return the root node of an xml file.
| xmlfile | Name of the xml file to find the root node of. |
| float psNPCClient::GetRunVelocity | ( | csString & | race | ) |
Find the run velocity for a given race.
Retrive the current tick counter.
Definition at line 424 of file npcclient.h.
| iVFS* psNPCClient::GetVFS | ( | ) | [inline] |
Definition at line 555 of file npcclient.h.
| float psNPCClient::GetWalkVelocity | ( | csString & | race | ) |
Find the walk velocity for a given race.
| psWorld* psNPCClient::GetWorld | ( | ) | [inline] |
Definition at line 545 of file npcclient.h.
| void psNPCClient::HandleDeath | ( | NPC * | who | ) |
Special handling for death notifications from the server is required, to stop behavior scripting, delete hate lists, etc.
| bool psNPCClient::InfoNPC | ( | const char * | pattern | ) |
Find one npc and print its current info.
| bool psNPCClient::Initialize | ( | iObjectRegistry * | object_reg, |
| const char * | host, | ||
| const char * | user, | ||
| const char * | pass, | ||
| int | port | ||
| ) |
Initialize the superclient.
Starts a thread for the Network, Message Handler. Also binds the status socket for the network.
| object_reg | The object registry |
| host | The host that keeps the DB. |
| user | The user for the DB. |
| pass | The password for the DB. |
| port | The port for the DB. |
| bool psNPCClient::IsReady | ( | ) |
If a world is ready and loaded this returns true.
| void psNPCClient::ListAllEntities | ( | const char * | pattern, |
| bool | onlyCharacters = false |
||
| ) |
List all known entities on superclient.
| void psNPCClient::ListAllNPCs | ( | const char * | pattern | ) |
List all NPCs matching pattern to console.
| void psNPCClient::ListLocations | ( | const char * | pattern | ) |
List all locations matching pattern to console.
| void psNPCClient::ListPaths | ( | const char * | pattern | ) |
List all paths matching pattern to console.
| void psNPCClient::ListReactions | ( | const char * | pattern | ) |
List all the registered reactions.
| void psNPCClient::ListTribeRecipes | ( | const char * | tribeID | ) |
List all the active recipes in a tribe.
| void psNPCClient::ListTribes | ( | const char * | pattern | ) |
List all tribes matching pattern to console.
| void psNPCClient::ListWaypoints | ( | const char * | pattern | ) |
List all waypoints matching pattern to console.
| void psNPCClient::LoadCompleted | ( | ) |
To be called when the the load process is completed.
| bool psNPCClient::LoadLocations | ( | ) | [protected] |
Load locations from the DB.
| void psNPCClient::LoadLogSettings | ( | ) |
Used to load the log settings.
| bool psNPCClient::LoadMap | ( | const char * | mapfile | ) |
Load a map into a region.
This is a copy of code from entitymanager->CreateRoom().
| mapfile | A file with maps to load. |
| bool psNPCClient::LoadNPCTypes | ( | iDocumentNode * | root | ) |
Decode a npc type from the XML definition.
| root | The document node that containts a NPC type. |
| bool psNPCClient::LoadNPCTypes | ( | ) |
Load NPC Types from DB.
| bool psNPCClient::LoadPathNetwork | ( | ) |
made public for the networkmanager to call it
| bool psNPCClient::LoadTribes | ( | ) | [protected] |
Load Tribes from the DB.
| void psNPCClient::MainLoop | ( | ) |
Load and fork off a new thread for the Server Console.
Then start EventManager's main loop, processing all network and server events.
| void psNPCClient::PerceptProximityItems | ( | ) | [protected] |
Find all items that are close to NPC's and percept the NPC.
| void psNPCClient::PerceptProximityLocations | ( | ) | [protected] |
Find all locations that are close to NPC's and percept the NPC.
| void psNPCClient::PerceptProximityTribeHome | ( | ) | [protected] |
Find all actors that are in a tribe home and percept tribe and actor if it is an NPC.
| NPC* psNPCClient::ReadMasteredNPC | ( | PID | char_id, |
| PID | master_id | ||
| ) |
Clones a master npc to a new npc whith the passed PID.
Used to inheredit behaviours from other npc.
| char_id | A valid PID of the character which is taking it's attributes from the master npc. |
| master_id | A valid PID of the master npc from which we will copy the attributes. |
| bool psNPCClient::ReadNPCsFromDatabase | ( | ) | [protected] |
Read NPCs from the DB.
| NPC* psNPCClient::ReadSingleNPC | ( | PID | char_id, |
| PID | master_id = 0 |
||
| ) |
Register a reaction for an NPC with the client.
Used to speed up FirePerception.
| void psNPCClient::Remove | ( | gemNPCObject * | object | ) |
| void psNPCClient::RemoveAll | ( | ) |
| void psNPCClient::SaveLogSettings | ( | ) |
Used to save the log settings.
| void psNPCClient::SetEntityPos | ( | EID | id, |
| csVector3 & | pos, | ||
| iSector * | sector, | ||
| InstanceID | instance, | ||
| bool | force = false |
||
| ) |
SetEntityPos finds the given ID entity, and updates its position in mesh and linmove.
| id | The EID of the entity. |
| pos | The new position. |
| sector | The new sector. |
| instance | The new instance. |
| force | Applies the entity reposition also on npc. Useful with teleport slide and other operations. |
| iCelHPath* psNPCClient::ShortestPath | ( | NPC * | npc, |
| const csVector3 & | from, | ||
| iSector * | fromSector, | ||
| const csVector3 & | goal, | ||
| iSector * | goalSector | ||
| ) |
| void psNPCClient::Tick | ( | ) |
This does 1 AI calc per Tribe then returns.
| virtual const char* psNPCClient::ToString | ( | ) | [virtual] |
Implements iScriptableVar.
| void psNPCClient::TriggerEvent | ( | Perception * | pcpt, |
| float | maxRange = -1.0, |
||
| csVector3 * | basePos = NULL, |
||
| iSector * | baseSector = NULL, |
||
| bool | sameSector = false |
||
| ) |
Sends a perception to all npcs.
If macRange is greather than 0.0 only npcs within that range of the base position will be triggered.
| pcpt | The perception |
| maxRange | If greater than 0.0 then max range apply |
| basePos | The base position for range checks. |
| baseSector | The base sector for range checks. |
| sameSector | Only trigger if in same sector |
| void psNPCClient::UnattachObject | ( | iObject * | object, |
| gemNPCObject * | 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 object from. |
| gobject | The gem object we want to unattach. |
Update with time from server in order to start timed events.
csArray<gemNPCActor*> psNPCClient::all_gem_actors [protected] |
Definition at line 792 of file npcclient.h.
csArray<gemNPCItem*> psNPCClient::all_gem_items [protected] |
Definition at line 791 of file npcclient.h.
csPDelArray<gemNPCObject> psNPCClient::all_gem_objects [protected] |
Definition at line 790 of file npcclient.h.
csHash<gemNPCObject*, EID> psNPCClient::all_gem_objects_by_eid [protected] |
Definition at line 788 of file npcclient.h.
csHash<gemNPCObject*, PID> psNPCClient::all_gem_objects_by_pid [protected] |
Definition at line 789 of file npcclient.h.
csHash<NPC*,csString> psNPCClient::allReactions [protected] |
Hash of all registered reactions.
Definition at line 796 of file npcclient.h.
csRef<iCollideSystem> psNPCClient::cdsys [protected] |
Definition at line 799 of file npcclient.h.
csRef<iConfigManager > psNPCClient::configmanager [protected] |
Definition at line 771 of file npcclient.h.
psNetConnection* psNPCClient::connection [protected] |
Definition at line 768 of file npcclient.h.
int psNPCClient::current_long_range_perception_index [protected] |
Counters used to distribute load regarding perception generation.
Definition at line 809 of file npcclient.h.
Definition at line 810 of file npcclient.h.
int psNPCClient::current_tribe_home_perception_index [protected] |
Definition at line 811 of file npcclient.h.
psDatabase* psNPCClient::database [protected] |
Definition at line 777 of file npcclient.h.
csRef<iEngine> psNPCClient::engine [protected] |
Definition at line 770 of file npcclient.h.
EventManager* psNPCClient::eventmanager [protected] |
Definition at line 774 of file npcclient.h.
int psNPCClient::gameDay [protected] |
Definition at line 816 of file npcclient.h.
int psNPCClient::gameHour [protected] |
Definition at line 815 of file npcclient.h.
int psNPCClient::gameMinute [protected] |
Definition at line 814 of file npcclient.h.
int psNPCClient::gameMonth [protected] |
Definition at line 817 of file npcclient.h.
csTicks psNPCClient::gameTimeUpdated [protected] |
Definition at line 819 of file npcclient.h.
int psNPCClient::gameYear [protected] |
Definition at line 818 of file npcclient.h.
LocationManager* psNPCClient::locationManager [protected] |
The manager for location.
Definition at line 781 of file npcclient.h.
MathScriptEngine* psNPCClient::mathScriptEngine [protected] |
Definition at line 782 of file npcclient.h.
csRef<MsgHandler> psNPCClient::msghandler [protected] |
Definition at line 772 of file npcclient.h.
csRef<iCelHNavStruct> psNPCClient::navStruct [protected] |
Definition at line 784 of file npcclient.h.
NetworkManager* psNPCClient::network [protected] |
Definition at line 776 of file npcclient.h.
csArray<csString> psNPCClient::notUsedReactions [protected] |
List of not matched reactions.
Definition at line 797 of file npcclient.h.
psNPCClient* psNPCClient::npcclient [static] |
Definition at line 766 of file npcclient.h.
csPDelArray<NPC> psNPCClient::npcs [protected] |
Definition at line 785 of file npcclient.h.
csArray<DeferredNPC> psNPCClient::npcsDeferred [protected] |
Definition at line 786 of file npcclient.h.
csHash<NPCType*, const char*> psNPCClient::npctypes [protected] |
Definition at line 780 of file npcclient.h.
iObjectRegistry* psNPCClient::objreg [protected] |
Definition at line 769 of file npcclient.h.
psPathNetwork* psNPCClient::pathNetwork [protected] |
Definition at line 783 of file npcclient.h.
csHash<psNPCRaceListMessage::NPCRaceInfo_t,csString> psNPCClient::raceInfos [protected] |
Information about all the races.
Definition at line 794 of file npcclient.h.
RecipeManager* psNPCClient::recipemanager [protected] |
Definition at line 775 of file npcclient.h.
ServerConsole* psNPCClient::serverconsole [protected] |
Definition at line 773 of file npcclient.h.
unsigned int psNPCClient::tick_counter [protected] |
Counter used to start events at every nth client tick.
Definition at line 806 of file npcclient.h.
csPDelArray<Tribe> psNPCClient::tribes [protected] |
Definition at line 787 of file npcclient.h.
csRef<iVFS> psNPCClient::vfs [protected] |
Definition at line 778 of file npcclient.h.
psWorld* psNPCClient::world [protected] |
Definition at line 801 of file npcclient.h.
1.7.3