diff options
author | Melanie Thielker | 2010-06-11 17:04:54 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-06-11 17:04:54 +0200 |
commit | b3cf5ccf6d7fcfa2cb4a1405962b8fba73ae0119 (patch) | |
tree | ad84273af9732e0f2ca8e4ad4d9b648e90f3c8e8 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC_OLD-b3cf5ccf6d7fcfa2cb4a1405962b8fba73ae0119.zip opensim-SC_OLD-b3cf5ccf6d7fcfa2cb4a1405962b8fba73ae0119.tar.gz opensim-SC_OLD-b3cf5ccf6d7fcfa2cb4a1405962b8fba73ae0119.tar.bz2 opensim-SC_OLD-b3cf5ccf6d7fcfa2cb4a1405962b8fba73ae0119.tar.xz |
Clone cmGetAvatarList into osGetAvatarList for more generic use.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f2a2f32..0e86c86 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2206,5 +2206,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2206 | 2206 | ||
2207 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules); | 2207 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules); |
2208 | } | 2208 | } |
2209 | |||
2210 | /// <summary> | ||
2211 | /// Like osGetAgents but returns enough info for a radar | ||
2212 | /// </summary> | ||
2213 | /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns> | ||
2214 | public LSL_List osGetAvatarList() | ||
2215 | { | ||
2216 | CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); | ||
2217 | |||
2218 | LSL_List result = new LSL_List(); | ||
2219 | World.ForEachScenePresence(delegate (ScenePresence avatar) | ||
2220 | { | ||
2221 | if (avatar != null && avatar.UUID != m_host.OwnerID) | ||
2222 | { | ||
2223 | if (avatar.IsChildAgent == false) | ||
2224 | { | ||
2225 | if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null) | ||
2226 | { | ||
2227 | result.Add(avatar.UUID); | ||
2228 | result.Add(avatar.PhysicsActor.Position); | ||
2229 | result.Add(avatar.Name); | ||
2230 | } | ||
2231 | } | ||
2232 | } | ||
2233 | }); | ||
2234 | return result; | ||
2235 | } | ||
2209 | } | 2236 | } |
2210 | } | 2237 | } |