Add osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) variant.

This will be documented soon.  Options can currently be
  OS_NPC_CREATE_OWNED - creates a 'creator owned' avatar that will only respond to osNpc* functions made by scripts owned by the npc creator
  OS_NPC_NOT_OWNED    - creates an avatar which will respond to any osNpc* functions that a caller has permission to make (through the usual OSSL permission mechanisms).

options is being added to provide better scope for future extensibility without having to add more functions
The original non-options osNpcCreate() function will continue to exist.
iar_mods
Justin Clark-Casey (justincc) 2012-01-12 19:37:30 +00:00
parent d27dd3714f
commit c4972e7734
4 changed files with 15 additions and 0 deletions

View File

@ -2089,6 +2089,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return NpcCreate(firstname, lastname, position, notecard, false);
}
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
{
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
return NpcCreate(firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0);
}
private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned)
{
INPCModule module = World.RequestModuleInterface<INPCModule>();

View File

@ -172,6 +172,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
key osNpcCreate(string user, string name, vector position, string notecard);
key osNpcCreate(string user, string name, vector position, string notecard, int options);
key osNpcCreateOwned(string user, string name, vector position, string notecard);
LSL_Key osNpcSaveAppearance(key npc, string notecard);
void osNpcLoadAppearance(key npc, string notecard);

View File

@ -606,6 +606,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int OS_NPC_SIT_NOW = 0;
public const int OS_NPC_CREATOR_OWNED = 0x1;
public const int OS_NPC_NOT_OWNED = 0x2;
public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";

View File

@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom);
}
public key osNpcCreate(string user, string name, vector position, key cloneFrom, int options)
{
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options);
}
public key osNpcCreateOwned(string user, string name, vector position, key cloneFrom)
{
return m_OSSL_Functions.osNpcCreateOwned(user, name, position, cloneFrom);