aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs20
1 files changed, 7 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6f16ff3..766f6d3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -912,14 +912,11 @@ namespace OpenSim.Region.Framework.Scenes
912 912
913 m_isChildAgent = false; 913 m_isChildAgent = false;
914 914
915 ScenePresence[] animAgents = m_scene.GetScenePresences(); 915 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
916 for (int i = 0; i < animAgents.Length; i++)
917 { 916 {
918 ScenePresence presence = animAgents[i];
919
920 if (presence != this) 917 if (presence != this)
921 presence.Animator.SendAnimPackToClient(ControllingClient); 918 presence.Animator.SendAnimPackToClient(ControllingClient);
922 } 919 });
923 920
924 m_scene.EventManager.TriggerOnMakeRootAgent(this); 921 m_scene.EventManager.TriggerOnMakeRootAgent(this);
925 } 922 }
@@ -2469,13 +2466,10 @@ namespace OpenSim.Region.Framework.Scenes
2469 public void SendInitialFullUpdateToAllClients() 2466 public void SendInitialFullUpdateToAllClients()
2470 { 2467 {
2471 m_perfMonMS = Util.EnvironmentTickCount(); 2468 m_perfMonMS = Util.EnvironmentTickCount();
2472 2469 int avUpdates = 0;
2473 ScenePresence[] avatars = m_scene.GetScenePresences(); 2470 m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
2474
2475 for (int i = 0; i < avatars.Length; i++)
2476 { 2471 {
2477 ScenePresence avatar = avatars[i]; 2472 ++avUpdates;
2478
2479 // only send if this is the root (children are only "listening posts" in a foreign region) 2473 // only send if this is the root (children are only "listening posts" in a foreign region)
2480 if (!IsChildAgent) 2474 if (!IsChildAgent)
2481 { 2475 {
@@ -2491,9 +2485,9 @@ namespace OpenSim.Region.Framework.Scenes
2491 avatar.Animator.SendAnimPackToClient(ControllingClient); 2485 avatar.Animator.SendAnimPackToClient(ControllingClient);
2492 } 2486 }
2493 } 2487 }
2494 } 2488 });
2495 2489
2496 m_scene.StatsReporter.AddAgentUpdates(avatars.Length); 2490 m_scene.StatsReporter.AddAgentUpdates(avUpdates);
2497 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2491 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2498 2492
2499 //Animator.SendAnimPack(); 2493 //Animator.SendAnimPack();