OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Properties | List of all members
OpenSim.Region.OptionalModules.World.NPC.NPCModule Class Reference
Inheritance diagram for OpenSim.Region.OptionalModules.World.NPC.NPCModule:
Inheritance graph
[legend]
Collaboration diagram for OpenSim.Region.OptionalModules.World.NPC.NPCModule:
Collaboration graph
[legend]

Public Member Functions

void Initialise (IConfigSource source)
 This is called to initialize the region module. For shared modules, this is called exactly once, after creating the single (shared) instance. For non-shared modules, this is called once on each instance, after the instace for the region has been created. More...
 
void AddRegion (Scene scene)
 This is called whenever a Scene is added. For shared modules, this can happen several times. For non-shared modules, this happens exactly once, after Initialise has been called. More...
 
void RegionLoaded (Scene scene)
 This will be called once for every scene loaded. In a shared module this will be multiple times in one instance, while a nonshared module instance will only be called once. This method is called after AddRegion has been called in all modules for that scene, providing an opportunity to request another module's interface, or hook an event from another module. More...
 
void PostInitialise ()
 This is called exactly once after all the shared region-modules have been instanciated and IRegionModuleBase.Initialised. More...
 
void RemoveRegion (Scene scene)
 This is called whenever a Scene is removed. For shared modules, this can happen several times. For non-shared modules, this happens exactly once, if the scene this instance is associated with is removed. More...
 
void Close ()
 This is the inverse to Initialise. After a Close(), this instance won't be usable anymore. More...
 
bool IsNPC (UUID agentId, Scene scene)
 Check if the agent is an NPC. More...
 
bool SetNPCAppearance (UUID agentId, AvatarAppearance appearance, Scene scene)
 Set the appearance for an NPC. More...
 
UUID CreateNPC (string firstname, string lastname, Vector3 position, UUID owner, bool senseAsAgent, Scene scene, AvatarAppearance appearance)
 Create an NPC More...
 
UUID CreateNPC (string firstname, string lastname, Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene, AvatarAppearance appearance)
 Create an NPC with a user-supplied agentID More...
 
bool MoveToTarget (UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running)
 Move an NPC to a target over time. More...
 
bool StopMoveToTarget (UUID agentID, Scene scene)
 Stop the NPC's current movement. More...
 
bool Say (UUID agentID, Scene scene, string text)
 Get the NPC to say something. More...
 
bool Say (UUID agentID, Scene scene, string text, int channel)
 Get the NPC to say something. More...
 
bool Shout (UUID agentID, Scene scene, string text, int channel)
 Get the NPC to shout something. More...
 
bool Sit (UUID agentID, UUID partID, Scene scene)
 Sit the NPC. More...
 
bool Whisper (UUID agentID, Scene scene, string text, int channel)
 Get the NPC to whisper something. More...
 
bool Stand (UUID agentID, Scene scene)
 Stand a sitting NPC. More...
 
bool Touch (UUID agentID, UUID objectID)
 Get the NPC to touch an object. More...
 
UUID GetOwner (UUID agentID)
 Get the owner of a NPC More...
 
INPC GetNPC (UUID agentID, Scene scene)
 Get the NPC. More...
 
bool DeleteNPC (UUID agentID, Scene scene)
 Delete an NPC. More...
 
bool CheckPermissions (UUID npcID, UUID callerID)
 Check if the caller has permission to manipulate the given NPC. More...
 

Properties

NPCOptionsFlags NPCOptionFlags [get]
 
bool Enabled [get, set]
 
string Name [get]
 
Type ReplaceableInterface [get]
 
- Properties inherited from OpenSim.Region.Framework.Interfaces.INPCModule
NPCOptionsFlags NPCOptionFlags [get]
 
- Properties inherited from OpenSim.Region.Framework.Interfaces.IRegionModuleBase
string Name [get]
 
Type ReplaceableInterface [get]
 If this returns non-null, it is the type of an interface that this module intends to register. This will cause the loader to defer loading of this module until all other modules have been loaded. If no other module has registered the interface by then, this module will be activated, else it will remain inactive, letting the other module take over. This should return non-null ONLY in modules that are intended to be easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party provided modules. More...
 

Detailed Description

Definition at line 47 of file NPCModule.cs.

Member Function Documentation

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.AddRegion ( Scene  scene)
inline

This is called whenever a Scene is added. For shared modules, this can happen several times. For non-shared modules, this happens exactly once, after Initialise has been called.

Parameters
sceneA Scene

Implements OpenSim.Region.Framework.Interfaces.IRegionModuleBase.

Definition at line 84 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.CheckPermissions ( UUID  npcID,
UUID  callerID 
)
inline

Check if the caller has permission to manipulate the given NPC.

A caller has permission if

  • An NPC exists with the given npcID.
  • The caller UUID given is UUID.Zero.
  • The avatar is unowned (owner is UUID.Zero).
  • The avatar is owned and the owner and callerID match.
  • The avatar is owned and the callerID matches its agentID.
Parameters
av
callerID
Returns
true if they do, false if they don't.
Parameters
npcID
callerID
Returns
true if they do, false if they don't or if there's no NPC with the given ID.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 447 of file NPCModule.cs.

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.Close ( )
inline

This is the inverse to Initialise. After a Close(), this instance won't be usable anymore.

Implements OpenSim.Region.Framework.Interfaces.IRegionModuleBase.

Definition at line 103 of file NPCModule.cs.

UUID OpenSim.Region.OptionalModules.World.NPC.NPCModule.CreateNPC ( string  firstname,
string  lastname,
Vector3  position,
UUID  owner,
bool  senseAsAgent,
Scene  scene,
AvatarAppearance  appearance 
)
inline

Create an NPC

Parameters
firstname
lastname
position
senseAsAgentMake the NPC show up as an agent on LSL sensors. The default is that they show up as the NPC type instead, but this is currently an OpenSim-only extension.
scene
appearanceThe avatar appearance to use for the new NPC.
Returns
The UUID of the ScenePresence created. UUID.Zero if there was a failure.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 159 of file NPCModule.cs.

UUID OpenSim.Region.OptionalModules.World.NPC.NPCModule.CreateNPC ( string  firstname,
string  lastname,
Vector3  position,
UUID  agentID,
UUID  owner,
bool  senseAsAgent,
Scene  scene,
AvatarAppearance  appearance 
)
inline

Create an NPC with a user-supplied agentID

Parameters
firstname
lastname
position
agentID

The desired agent ID

Parameters
owner
senseAsAgentMake the NPC show up as an agent on LSL sensors. The default is that they show up as the NPC type instead, but this is currently an OpenSim-only extension.
scene
appearanceThe avatar appearance to use for the new NPC.
Returns
The UUID of the ScenePresence created. UUID.Zero if there was a failure.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 166 of file NPCModule.cs.

Here is the call graph for this function:

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.DeleteNPC ( UUID  agentID,
Scene  scene 
)
inline

Delete an NPC.

Parameters
agentIDThe UUID of the NPC
scene
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 413 of file NPCModule.cs.

INPC OpenSim.Region.OptionalModules.World.NPC.NPCModule.GetNPC ( UUID  agentID,
Scene  scene 
)
inline

Get the NPC.

This is not currently complete - manipulation of NPCs still occurs through the region interface.

Parameters
agentID
scene
Returns
The NPC. null if it does not exist.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 402 of file NPCModule.cs.

UUID OpenSim.Region.OptionalModules.World.NPC.NPCModule.GetOwner ( UUID  agentID)
inline

Get the owner of a NPC

Parameters
agentIDThe UUID of the NPC
Returns
UUID of owner if the NPC exists, UUID.Zero if there was no such agent, the agent is unowned or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 390 of file NPCModule.cs.

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.Initialise ( IConfigSource  source)
inline

This is called to initialize the region module. For shared modules, this is called exactly once, after creating the single (shared) instance. For non-shared modules, this is called once on each instance, after the instace for the region has been created.

Parameters
sourceA IConfigSource

Implements OpenSim.Region.Framework.Interfaces.IRegionModuleBase.

Definition at line 62 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.IsNPC ( UUID  agentID,
Scene  scene 
)
inline

Check if the agent is an NPC.

Parameters
agentID
scene
Returns
True if the agent is an NPC in the given scene. False otherwise.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 114 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.MoveToTarget ( UUID  agentID,
Scene  scene,
Vector3  pos,
bool  noFly,
bool  landAtTarget,
bool  running 
)
inline

Move an NPC to a target over time.

Parameters
agentIDThe UUID of the NPC
scene
pos
noFlyIf true, then the avatar will attempt to walk to the location even if it's up in the air. This is to allow walking on prims.
landAtTargetIf true and the avatar is flying when it reaches the target, land.

name="running"> If true, NPC moves with running speed.

Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 241 of file NPCModule.cs.

Here is the call graph for this function:

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.PostInitialise ( )
inline

This is called exactly once after all the shared region-modules have been instanciated and IRegionModuleBase.Initialised.

Implements OpenSim.Region.Framework.Interfaces.ISharedRegionModule.

Definition at line 94 of file NPCModule.cs.

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.RegionLoaded ( Scene  scene)
inline

This will be called once for every scene loaded. In a shared module this will be multiple times in one instance, while a nonshared module instance will only be called once. This method is called after AddRegion has been called in all modules for that scene, providing an opportunity to request another module's interface, or hook an event from another module.

Parameters
sceneA Scene

Implements OpenSim.Region.Framework.Interfaces.IRegionModuleBase.

Definition at line 90 of file NPCModule.cs.

void OpenSim.Region.OptionalModules.World.NPC.NPCModule.RemoveRegion ( Scene  scene)
inline

This is called whenever a Scene is removed. For shared modules, this can happen several times. For non-shared modules, this happens exactly once, if the scene this instance is associated with is removed.

Parameters
sceneA Scene

Implements OpenSim.Region.Framework.Interfaces.IRegionModuleBase.

Definition at line 98 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Say ( UUID  agentID,
Scene  scene,
string  text 
)
inline

Get the NPC to say something.

Parameters
agentIDThe UUID of the NPC
scene
text
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 290 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Say ( UUID  agentID,
Scene  scene,
string  text,
int  channel 
)
inline

Get the NPC to say something.

Parameters
agentIDThe UUID of the NPC
scene
text
channel
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 295 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.SetNPCAppearance ( UUID  agentID,
AvatarAppearance  appearance,
Scene  scene 
)
inline

Set the appearance for an NPC.

Parameters
agentID
appearance
scene
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 127 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Shout ( UUID  agentID,
Scene  scene,
string  text,
int  channel 
)
inline

Get the NPC to shout something.

Parameters
agentIDThe UUID of the NPC
scene
text
channel
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 310 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Sit ( UUID  agentID,
UUID  partID,
Scene  scene 
)
inline

Sit the NPC.

Parameters
agentID
partID
scene
Returns
true if the sit succeeded, false if not

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 325 of file NPCModule.cs.

Here is the call graph for this function:

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Stand ( UUID  agentID,
Scene  scene 
)
inline

Stand a sitting NPC.

Parameters
agentID
scene
Returns
true if the stand succeeded, false if not

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 360 of file NPCModule.cs.

Here is the call graph for this function:

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.StopMoveToTarget ( UUID  agentID,
Scene  scene 
)
inline

Stop the NPC's current movement.

Parameters
agentIDThe UUID of the NPC
scene
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 270 of file NPCModule.cs.

Here is the call graph for this function:

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Touch ( UUID  agentID,
UUID  partID 
)
inline

Get the NPC to touch an object.

Parameters
agentID
partID
Returns
true if the touch is actually attempted, false if not.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 379 of file NPCModule.cs.

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Whisper ( UUID  agentID,
Scene  scene,
string  text,
int  channel 
)
inline

Get the NPC to whisper something.

Parameters
agentIDThe UUID of the NPC
scene
text
channel
Returns
True if the operation succeeded, false if there was no such agent or the agent was not an NPC.

Implements OpenSim.Region.Framework.Interfaces.INPCModule.

Definition at line 344 of file NPCModule.cs.

Property Documentation

bool OpenSim.Region.OptionalModules.World.NPC.NPCModule.Enabled
getset

Definition at line 60 of file NPCModule.cs.

string OpenSim.Region.OptionalModules.World.NPC.NPCModule.Name
get

Definition at line 108 of file NPCModule.cs.

NPCOptionsFlags OpenSim.Region.OptionalModules.World.NPC.NPCModule.NPCOptionFlags
get

Definition at line 58 of file NPCModule.cs.

Type OpenSim.Region.OptionalModules.World.NPC.NPCModule.ReplaceableInterface
get

Definition at line 112 of file NPCModule.cs.


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