add osGetNPCList()

0.9.0-post-fixes
UbitUmarov 2017-06-26 20:42:49 +01:00
parent b59ce7c968
commit e53f439981
4 changed files with 26 additions and 0 deletions

View File

@ -3835,6 +3835,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result; return result;
} }
public LSL_List osGetNPCList()
{
CheckThreatLevel(ThreatLevel.None, "osGetNPCList");
m_host.AddScriptLPS(1);
LSL_List result = new LSL_List();
World.ForEachRootScenePresence(delegate (ScenePresence avatar)
{
if (avatar != null && avatar.IsNPC)
{
result.Add(new LSL_String(avatar.UUID.ToString()));
result.Add(new LSL_Vector(avatar.AbsolutePosition));
result.Add(new LSL_String(avatar.Name));
}
});
return result;
}
/// <summary> /// <summary>
/// Convert a unix time to a llGetTimestamp() like string /// Convert a unix time to a llGetTimestamp() like string
/// </summary> /// </summary>

View File

@ -395,6 +395,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb); void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb);
LSL_List osGetAvatarList(); LSL_List osGetAvatarList();
LSL_List osGetNPCList();
LSL_String osUnixTimeToTimestamp(long time); LSL_String osUnixTimeToTimestamp(long time);

View File

@ -1041,6 +1041,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetAvatarList(); return m_OSSL_Functions.osGetAvatarList();
} }
public LSL_List osGetNPCList()
{
return m_OSSL_Functions.osGetNPCList();
}
public LSL_String osUnixTimeToTimestamp(long time) public LSL_String osUnixTimeToTimestamp(long time)
{ {
return m_OSSL_Functions.osUnixTimeToTimestamp(time); return m_OSSL_Functions.osUnixTimeToTimestamp(time);

View File

@ -97,6 +97,7 @@
; Allow_osGetInventoryDesc = true ; no level check ; Allow_osGetInventoryDesc = true ; no level check
; Allow_osGetLinkNumber = true ; no level check ; Allow_osGetLinkNumber = true ; no level check
; Allow_osGetMapTexture = true ; no level check ; Allow_osGetMapTexture = true ; no level check
Allow_osGetNPCList = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
; Allow_osGetRegionSize = true ; no level check ; Allow_osGetRegionSize = true ; no level check
Allow_osGetRezzingObject = true Allow_osGetRezzingObject = true
; Allow_osGetSunParam = true ; no level check ; Allow_osGetSunParam = true ; no level check