mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
add osGetNPCList()
This commit is contained in:
@@ -3835,6 +3835,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
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>
|
||||
/// Convert a unix time to a llGetTimestamp() like string
|
||||
/// </summary>
|
||||
|
||||
@@ -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);
|
||||
|
||||
LSL_List osGetAvatarList();
|
||||
LSL_List osGetNPCList();
|
||||
|
||||
LSL_String osUnixTimeToTimestamp(long time);
|
||||
|
||||
|
||||
@@ -1041,6 +1041,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return m_OSSL_Functions.osGetAvatarList();
|
||||
}
|
||||
|
||||
public LSL_List osGetNPCList()
|
||||
{
|
||||
return m_OSSL_Functions.osGetNPCList();
|
||||
}
|
||||
|
||||
public LSL_String osUnixTimeToTimestamp(long time)
|
||||
{
|
||||
return m_OSSL_Functions.osUnixTimeToTimestamp(time);
|
||||
|
||||
Reference in New Issue
Block a user