aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDan Lake2011-10-27 00:42:21 -0700
committerDan Lake2011-10-27 00:42:21 -0700
commitb98613091cd6dc2f914fb5ab38ca33cdff21fc24 (patch)
tree42be01a68146870ddcd64e842a13f2fbb46b4738 /OpenSim/Region/CoreModules
parentFor now, comment out error message on new script engine console commands. (diff)
downloadopensim-SC-b98613091cd6dc2f914fb5ab38ca33cdff21fc24.zip
opensim-SC-b98613091cd6dc2f914fb5ab38ca33cdff21fc24.tar.gz
opensim-SC-b98613091cd6dc2f914fb5ab38ca33cdff21fc24.tar.bz2
opensim-SC-b98613091cd6dc2f914fb5ab38ca33cdff21fc24.tar.xz
Added new ForEachRootScenePresence to Scene since almost every delegate passed to ForEachScenePresence checks for !IsChildAgent first. It consolidates child and root handling for coming refactors.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs4
8 files changed, 17 insertions, 36 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 4359c01..2cd71c4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -279,12 +279,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
279 279
280 HashSet<UUID> receiverIDs = new HashSet<UUID>(); 280 HashSet<UUID> receiverIDs = new HashSet<UUID>();
281 281
282 ((Scene)c.Scene).ForEachScenePresence( 282 ((Scene)c.Scene).ForEachRootScenePresence(
283 delegate(ScenePresence presence) 283 delegate(ScenePresence presence)
284 { 284 {
285 // ignore chat from child agents
286 if (presence.IsChildAgent) return;
287
288 IClientAPI client = presence.ControllingClient; 285 IClientAPI client = presence.ControllingClient;
289 286
290 // don't forward SayOwner chat from objects to 287 // don't forward SayOwner chat from objects to
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 5ec64d5..562c3b1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -140,10 +140,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
140 // This is a bit crude. It seems the client will be null before it actually stops the thread 140 // This is a bit crude. It seems the client will be null before it actually stops the thread
141 // The thread will kill itself eventually :/ 141 // The thread will kill itself eventually :/
142 // Is there another way to make sure *all* clients get this 'inter region' message? 142 // Is there another way to make sure *all* clients get this 'inter region' message?
143 m_scene.ForEachScenePresence( 143 m_scene.ForEachRootScenePresence(
144 delegate(ScenePresence p) 144 delegate(ScenePresence p)
145 { 145 {
146 if (p.UUID != godID && !p.IsChildAgent) 146 if (p.UUID != godID)
147 { 147 {
148 // Possibly this should really be p.Close() though that method doesn't send a close 148 // Possibly this should really be p.Close() though that method doesn't send a close
149 // to the client 149 // to the client
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index c199a77..5427b68 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -658,17 +658,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
658 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) 658 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
659 return; 659 return;
660 660
661 Scene.ForEachScenePresence(delegate(ScenePresence sp) 661 Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
662 { 662 {
663 if (sp.UUID != senderID) 663 if (sp.UUID != senderID)
664 { 664 {
665 ScenePresence p = Scene.GetScenePresence(sp.UUID);
666 // make sure they are still there, we could be working down a long list 665 // make sure they are still there, we could be working down a long list
667 // Also make sure they are actually in the region 666 // Also make sure they are actually in the region
668 if (p != null && !p.IsChildAgent) 667 ScenePresence p;
669 { 668 if(Scene.TryGetScenePresence(sp.UUID, out p))
670 Scene.TeleportClientHome(p.UUID, p.ControllingClient); 669 Scene.TeleportClientHome(p.UUID, p.ControllingClient);
671 }
672 } 670 }
673 }); 671 });
674 } 672 }
@@ -929,10 +927,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
929 927
930 public void sendRegionInfoPacketToAll() 928 public void sendRegionInfoPacketToAll()
931 { 929 {
932 Scene.ForEachScenePresence(delegate(ScenePresence sp) 930 Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
933 { 931 {
934 if (!sp.IsChildAgent) 932 HandleRegionInfoRequest(sp.ControllingClient);
935 HandleRegionInfoRequest(sp.ControllingClient);
936 }); 933 });
937 } 934 }
938 935
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 8c40171..0da0de3 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -476,11 +476,8 @@ namespace OpenSim.Region.CoreModules.World.Land
476 476
477 public void SendLandUpdateToAvatarsOverMe(bool snap_selection) 477 public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
478 { 478 {
479 m_scene.ForEachScenePresence(delegate(ScenePresence avatar) 479 m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
480 { 480 {
481 if (avatar.IsChildAgent)
482 return;
483
484 ILandObject over = null; 481 ILandObject over = null;
485 try 482 try
486 { 483 {
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index 22ffcd6..93b1005 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -70,11 +70,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
70 70
71 SceneObjectGroup grp = part.ParentGroup; 71 SceneObjectGroup grp = part.ParentGroup;
72 72
73 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 73 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
74 { 74 {
75 if (sp.IsChildAgent)
76 return;
77
78 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 75 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
79 if (dis > 100.0) // Max audio distance 76 if (dis > 100.0) // Max audio distance
80 return; 77 return;
@@ -122,11 +119,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
122 } 119 }
123 } 120 }
124 121
125 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 122 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
126 { 123 {
127 if (sp.IsChildAgent)
128 return;
129
130 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 124 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
131 if (dis > 100.0) // Max audio distance 125 if (dis > 100.0) // Max audio distance
132 return; 126 return;
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index 4e14c73..d2c1289 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -488,12 +488,9 @@ namespace OpenSim.Region.CoreModules
488 488
489 private void SunUpdateToAllClients() 489 private void SunUpdateToAllClients()
490 { 490 {
491 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 491 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
492 { 492 {
493 if (!sp.IsChildAgent)
494 {
495 SunToClient(sp.ControllingClient); 493 SunToClient(sp.ControllingClient);
496 }
497 }); 494 });
498 } 495 }
499 496
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index 6bac555..bea5db1 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -435,10 +435,9 @@ namespace OpenSim.Region.CoreModules
435 m_frameLastUpdateClientArray = m_frame; 435 m_frameLastUpdateClientArray = m_frame;
436 } 436 }
437 437
438 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 438 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
439 { 439 {
440 if (!sp.IsChildAgent) 440 sp.ControllingClient.SendWindData(windSpeeds);
441 sp.ControllingClient.SendWindData(windSpeeds);
442 }); 441 });
443 } 442 }
444 } 443 }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 857079c..509c0d8 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -401,10 +401,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
401 } 401 }
402 else 402 else
403 { 403 {
404 m_scene.ForEachScenePresence(delegate(ScenePresence sp) 404 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
405 { 405 {
406 // Don't send a green dot for yourself 406 // Don't send a green dot for yourself
407 if (!sp.IsChildAgent && sp.UUID != remoteClient.AgentId) 407 if (sp.UUID != remoteClient.AgentId)
408 { 408 {
409 mapitem = new mapItemReply(); 409 mapitem = new mapItemReply();
410 mapitem.x = (uint)(xstart + sp.AbsolutePosition.X); 410 mapitem.x = (uint)(xstart + sp.AbsolutePosition.X);