aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDan Lake2011-10-27 01:25:12 -0700
committerDan Lake2011-10-27 01:25:12 -0700
commit06577d7299f38c342c9b241c691e647e5329837e (patch)
treee288b6229d18163507bf9ee6c8aaa23a7568b962
parentAdded new ForEachRootScenePresence to Scene since almost every delegate passe... (diff)
downloadopensim-SC-06577d7299f38c342c9b241c691e647e5329837e.zip
opensim-SC-06577d7299f38c342c9b241c691e647e5329837e.tar.gz
opensim-SC-06577d7299f38c342c9b241c691e647e5329837e.tar.bz2
opensim-SC-06577d7299f38c342c9b241c691e647e5329837e.tar.xz
Continuation of previous checkin. Found more places where ForEachScenePresence can be changed to ForEachRootScenePresence.
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs53
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs24
4 files changed, 39 insertions, 57 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
index d2a0860..3ce446b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -98,10 +98,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
98 98
99 public void SendGeneralAlert(string message) 99 public void SendGeneralAlert(string message)
100 { 100 {
101 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 101 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
102 { 102 {
103 if (!presence.IsChildAgent) 103 presence.ControllingClient.SendAlertMessage(message);
104 presence.ControllingClient.SendAlertMessage(message);
105 }); 104 });
106 } 105 }
107 106
@@ -163,10 +162,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
163 public void SendNotificationToUsersInRegion( 162 public void SendNotificationToUsersInRegion(
164 UUID fromAvatarID, string fromAvatarName, string message) 163 UUID fromAvatarID, string fromAvatarName, string message)
165 { 164 {
166 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 165 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
167 { 166 {
168 if (!presence.IsChildAgent) 167 presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
169 presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
170 }); 168 });
171 } 169 }
172 170
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index c8ecc9b..3a4f52e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1440,10 +1440,9 @@ namespace OpenSim.Region.Framework.Scenes
1440 if (volume < 0) 1440 if (volume < 0)
1441 volume = 0; 1441 volume = 0;
1442 1442
1443 m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) 1443 m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
1444 { 1444 {
1445 if (!sp.IsChildAgent) 1445 sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
1446 sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
1447 }); 1446 });
1448 } 1447 }
1449 1448
@@ -2676,10 +2675,8 @@ namespace OpenSim.Region.Framework.Scenes
2676 } 2675 }
2677 } 2676 }
2678 2677
2679 m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) 2678 m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
2680 { 2679 {
2681 if (sp.IsChildAgent)
2682 return;
2683 if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) 2680 if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
2684 sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); 2681 sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2685 }); 2682 });
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ee6c708..3834b79 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2598,19 +2598,15 @@ namespace OpenSim.Region.Framework.Scenes
2598 public void SendOtherAgentsAvatarDataToMe() 2598 public void SendOtherAgentsAvatarDataToMe()
2599 { 2599 {
2600 int count = 0; 2600 int count = 0;
2601 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2601 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
2602 { 2602 {
2603 // only send information about root agents 2603 // only send information about other root agents
2604 if (scenePresence.IsChildAgent) 2604 if (scenePresence.UUID == UUID)
2605 return; 2605 return;
2606
2607 // only send information about other root agents
2608 if (scenePresence.UUID == UUID)
2609 return;
2610 2606
2611 scenePresence.SendAvatarDataToAgent(this); 2607 scenePresence.SendAvatarDataToAgent(this);
2612 count++; 2608 count++;
2613 }); 2609 });
2614 2610
2615 m_scene.StatsReporter.AddAgentUpdates(count); 2611 m_scene.StatsReporter.AddAgentUpdates(count);
2616 } 2612 }
@@ -2644,13 +2640,14 @@ namespace OpenSim.Region.Framework.Scenes
2644 2640
2645 int count = 0; 2641 int count = 0;
2646 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2642 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2647 { 2643 {
2648 if (scenePresence.UUID == UUID) 2644 // only send information to other root agents
2649 return; 2645 if (scenePresence.UUID == UUID)
2646 return;
2650 2647
2651 SendAppearanceToAgent(scenePresence); 2648 SendAppearanceToAgent(scenePresence);
2652 count++; 2649 count++;
2653 }); 2650 });
2654 2651
2655 m_scene.StatsReporter.AddAgentUpdates(count); 2652 m_scene.StatsReporter.AddAgentUpdates(count);
2656 } 2653 }
@@ -2664,19 +2661,15 @@ namespace OpenSim.Region.Framework.Scenes
2664 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); 2661 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID);
2665 2662
2666 int count = 0; 2663 int count = 0;
2667 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2664 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
2668 { 2665 {
2669 // only send information about root agents 2666 // only send information about other root agents
2670 if (scenePresence.IsChildAgent) 2667 if (scenePresence.UUID == UUID)
2671 return; 2668 return;
2672
2673 // only send information about other root agents
2674 if (scenePresence.UUID == UUID)
2675 return;
2676 2669
2677 scenePresence.SendAppearanceToAgent(this); 2670 scenePresence.SendAppearanceToAgent(this);
2678 count++; 2671 count++;
2679 }); 2672 });
2680 2673
2681 m_scene.StatsReporter.AddAgentUpdates(count); 2674 m_scene.StatsReporter.AddAgentUpdates(count);
2682 } 2675 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3cfc3c9..654f168 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -873,10 +873,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
873 CheckThreatLevel(ThreatLevel.None, "osGetAgents"); 873 CheckThreatLevel(ThreatLevel.None, "osGetAgents");
874 874
875 LSL_List result = new LSL_List(); 875 LSL_List result = new LSL_List();
876 World.ForEachScenePresence(delegate(ScenePresence sp) 876 World.ForEachRootScenePresence(delegate(ScenePresence sp)
877 { 877 {
878 if (!sp.IsChildAgent) 878 result.Add(new LSL_String(sp.Name));
879 result.Add(new LSL_String(sp.Name));
880 }); 879 });
881 return result; 880 return result;
882 } 881 }
@@ -2582,11 +2581,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2582 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 2581 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
2583 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 2582 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
2584 { 2583 {
2585 World.ForEachScenePresence(delegate(ScenePresence sp) 2584 World.ForEachRootScenePresence(delegate(ScenePresence sp)
2586 { 2585 {
2587 if (!sp.IsChildAgent && 2586 if (sp.Firstname == FirstName && sp.Lastname == SurName)
2588 sp.Firstname == FirstName &&
2589 sp.Lastname == SurName)
2590 { 2587 {
2591 // kick client... 2588 // kick client...
2592 if (alert != null) 2589 if (alert != null)
@@ -2718,17 +2715,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2718 CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); 2715 CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
2719 2716
2720 LSL_List result = new LSL_List(); 2717 LSL_List result = new LSL_List();
2721 World.ForEachScenePresence(delegate (ScenePresence avatar) 2718 World.ForEachRootScenePresence(delegate (ScenePresence avatar)
2722 { 2719 {
2723 if (avatar != null && avatar.UUID != m_host.OwnerID) 2720 if (avatar != null && avatar.UUID != m_host.OwnerID)
2724 { 2721 {
2725 if (avatar.IsChildAgent == false) 2722 result.Add(new LSL_String(avatar.UUID.ToString()));
2726 { 2723 OpenMetaverse.Vector3 ap = avatar.AbsolutePosition;
2727 result.Add(new LSL_String(avatar.UUID.ToString())); 2724 result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
2728 OpenMetaverse.Vector3 ap = avatar.AbsolutePosition; 2725 result.Add(new LSL_String(avatar.Name));
2729 result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
2730 result.Add(new LSL_String(avatar.Name));
2731 }
2732 } 2726 }
2733 }); 2727 });
2734 2728