mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Clone cmGetAvatarList into osGetAvatarList for more generic use.
This commit is contained in:
committed by
Melanie
parent
7f349d61cb
commit
b64f42fa41
@@ -2202,5 +2202,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Like osGetAgents but returns enough info for a radar
|
||||
/// </summary>
|
||||
/// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
|
||||
public LSL_List osGetAvatarList()
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
|
||||
|
||||
LSL_List result = new LSL_List();
|
||||
World.ForEachScenePresence(delegate (ScenePresence avatar)
|
||||
{
|
||||
if (avatar != null && avatar.UUID != m_host.OwnerID)
|
||||
{
|
||||
if (avatar.IsChildAgent == false)
|
||||
{
|
||||
if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null)
|
||||
{
|
||||
result.Add(avatar.UUID);
|
||||
result.Add(avatar.PhysicsActor.Position);
|
||||
result.Add(avatar.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user