diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0c373b9..3f630f4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5293,7 +5293,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5293 | public LSL_Integer llGetRegionAgentCount() | 5293 | public LSL_Integer llGetRegionAgentCount() |
5294 | { | 5294 | { |
5295 | m_host.AddScriptLPS(1); | 5295 | m_host.AddScriptLPS(1); |
5296 | return new LSL_Integer(World.GetAvatars().Count); | 5296 | return new LSL_Integer(World.GetRootAgentCount()); |
5297 | } | 5297 | } |
5298 | 5298 | ||
5299 | public LSL_Vector llGetRegionCorner() | 5299 | public LSL_Vector llGetRegionCorner() |
@@ -9096,17 +9096,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9096 | landObject.SetMediaUrl(url); | 9096 | landObject.SetMediaUrl(url); |
9097 | 9097 | ||
9098 | // now send to all (non-child) agents | 9098 | // now send to all (non-child) agents |
9099 | List<ScenePresence> agents = World.GetAvatars(); | 9099 | World.ForEachScenePresence(delegate(ScenePresence sp) |
9100 | foreach (ScenePresence agent in agents) | ||
9101 | { | 9100 | { |
9102 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, | 9101 | if (!sp.IsChildAgent) |
9103 | landData.MediaID, | 9102 | { |
9104 | landData.MediaAutoScale, | 9103 | sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, |
9105 | mediaType, | 9104 | landData.MediaID, |
9106 | description, | 9105 | landData.MediaAutoScale, |
9107 | width, height, | 9106 | mediaType, |
9108 | loop); | 9107 | description, |
9109 | } | 9108 | width, height, |
9109 | loop); | ||
9110 | } | ||
9111 | }); | ||
9110 | } | 9112 | } |
9111 | else if (!presence.IsChildAgent) | 9113 | else if (!presence.IsChildAgent) |
9112 | { | 9114 | { |
@@ -9127,13 +9129,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9127 | if (presence == null) | 9129 | if (presence == null) |
9128 | { | 9130 | { |
9129 | // send to all (non-child) agents | 9131 | // send to all (non-child) agents |
9130 | List<ScenePresence> agents = World.GetAvatars(); | 9132 | World.ForEachScenePresence(delegate(ScenePresence sp) |
9131 | foreach (ScenePresence agent in agents) | ||
9132 | { | 9133 | { |
9133 | agent.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? | 9134 | if (!sp.IsChildAgent) |
9134 | (ParcelMediaCommandEnum)commandToSend, | 9135 | { |
9135 | time); | 9136 | sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? |
9136 | } | 9137 | (ParcelMediaCommandEnum)commandToSend, |
9138 | time); | ||
9139 | } | ||
9140 | }); | ||
9137 | } | 9141 | } |
9138 | else if (!presence.IsChildAgent) | 9142 | else if (!presence.IsChildAgent) |
9139 | { | 9143 | { |