aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-28 23:16:46 +0100
committerJustin Clark-Casey (justincc)2011-10-28 23:16:46 +0100
commit0fe756e42c23dabf3b754f3675597aaf6fb627c4 (patch)
treeaa9ebe244f7efe03b8e8cbf80a70b6fb34a6dade
parentfetch SOP.RotationOffset once in UpdateRotation() and compare rather than fet... (diff)
parentRemoved use of 'is' operator and casting to find the root ScenePresence in Me... (diff)
downloadopensim-SC_OLD-0fe756e42c23dabf3b754f3675597aaf6fb627c4.zip
opensim-SC_OLD-0fe756e42c23dabf3b754f3675597aaf6fb627c4.tar.gz
opensim-SC_OLD-0fe756e42c23dabf3b754f3675597aaf6fb627c4.tar.bz2
opensim-SC_OLD-0fe756e42c23dabf3b754f3675597aaf6fb627c4.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs57
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs52
-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
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs60
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs53
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs15
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs11
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs24
22 files changed, 171 insertions, 227 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/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/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/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 72b448b..321a705 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -143,24 +143,19 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
143 // Try root avatar only first 143 // Try root avatar only first
144 foreach (Scene scene in m_Scenes) 144 foreach (Scene scene in m_Scenes)
145 { 145 {
146 if (scene.Entities.ContainsKey(toAgentID) && 146// m_log.DebugFormat(
147 scene.Entities[toAgentID] is ScenePresence) 147// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}",
148 { 148// toAgentID.ToString(), scene.RegionInfo.RegionName);
149// m_log.DebugFormat( 149 ScenePresence sp = scene.GetScenePresence(toAgentID);
150// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", 150 if (sp != null && !sp.IsChildAgent)
151// toAgentID.ToString(), scene.RegionInfo.RegionName); 151 {
152 152 // Local message
153 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 153// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
154 if (!user.IsChildAgent) 154 sp.ControllingClient.SendInstantMessage(im);
155 {
156 // Local message
157// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
158 user.ControllingClient.SendInstantMessage(im);
159 155
160 // Message sent 156 // Message sent
161 result(true); 157 result(true);
162 return; 158 return;
163 }
164 } 159 }
165 } 160 }
166 161
@@ -168,16 +163,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
168 foreach (Scene scene in m_Scenes) 163 foreach (Scene scene in m_Scenes)
169 { 164 {
170// m_log.DebugFormat( 165// m_log.DebugFormat(
171// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 166// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}",
172 167// toAgentID, scene.RegionInfo.RegionName);
173 if (scene.Entities.ContainsKey(toAgentID) && 168 ScenePresence sp = scene.GetScenePresence(toAgentID);
174 scene.Entities[toAgentID] is ScenePresence) 169 if (sp != null)
175 { 170 {
176 // Local message 171 // Local message
177 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
178
179// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); 172// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
180 user.ControllingClient.SendInstantMessage(im); 173 sp.ControllingClient.SendInstantMessage(im);
181 174
182 // Message sent 175 // Message sent
183 result(true); 176 result(true);
@@ -231,17 +224,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
231 bool successful = false; 224 bool successful = false;
232 foreach (Scene scene in m_Scenes) 225 foreach (Scene scene in m_Scenes)
233 { 226 {
234 if (scene.Entities.ContainsKey(toAgentID) && 227 ScenePresence sp = scene.GetScenePresence(toAgentID);
235 scene.Entities[toAgentID] is ScenePresence) 228 if(!sp.IsChildAgent)
236 { 229 {
237 ScenePresence user = 230 scene.EventManager.TriggerIncomingInstantMessage(gim);
238 (ScenePresence)scene.Entities[toAgentID]; 231 successful = true;
239
240 if (!user.IsChildAgent)
241 {
242 scene.EventManager.TriggerIncomingInstantMessage(gim);
243 successful = true;
244 }
245 } 232 }
246 } 233 }
247 if (!successful) 234 if (!successful)
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 45b84f4..0dad3c4 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -136,24 +136,19 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
136 // Try root avatar only first 136 // Try root avatar only first
137 foreach (Scene scene in m_Scenes) 137 foreach (Scene scene in m_Scenes)
138 { 138 {
139 if (scene.Entities.ContainsKey(toAgentID) && 139// m_log.DebugFormat(
140 scene.Entities[toAgentID] is ScenePresence) 140// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
141// toAgentID.ToString(), scene.RegionInfo.RegionName);
142 ScenePresence sp = scene.GetScenePresence(toAgentID);
143 if (sp != null && !sp.IsChildAgent)
141 { 144 {
142// m_log.DebugFormat( 145 // Local message
143// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", 146// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
144// toAgentID.ToString(), scene.RegionInfo.RegionName); 147 sp.ControllingClient.SendInstantMessage(im);
145 148
146 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 149 // Message sent
147 if (!user.IsChildAgent) 150 result(true);
148 { 151 return;
149 // Local message
150// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
151 user.ControllingClient.SendInstantMessage(im);
152
153 // Message sent
154 result(true);
155 return;
156 }
157 } 152 }
158 } 153 }
159 154
@@ -162,15 +157,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
162 { 157 {
163// m_log.DebugFormat( 158// m_log.DebugFormat(
164// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 159// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
165 160 ScenePresence sp = scene.GetScenePresence(toAgentID);
166 if (scene.Entities.ContainsKey(toAgentID) && 161 if (sp != null)
167 scene.Entities[toAgentID] is ScenePresence)
168 { 162 {
169 // Local message 163 // Local message
170 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
171
172// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); 164// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
173 user.ControllingClient.SendInstantMessage(im); 165 sp.ControllingClient.SendInstantMessage(im);
174 166
175 // Message sent 167 // Message sent
176 result(true); 168 result(true);
@@ -389,17 +381,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
389 // Trigger the Instant message in the scene. 381 // Trigger the Instant message in the scene.
390 foreach (Scene scene in m_Scenes) 382 foreach (Scene scene in m_Scenes)
391 { 383 {
392 if (scene.Entities.ContainsKey(toAgentID) && 384 ScenePresence sp = scene.GetScenePresence(toAgentID);
393 scene.Entities[toAgentID] is ScenePresence) 385 if (sp != null && !sp.IsChildAgent)
394 { 386 {
395 ScenePresence user = 387 scene.EventManager.TriggerIncomingInstantMessage(gim);
396 (ScenePresence)scene.Entities[toAgentID]; 388 successful = true;
397
398 if (!user.IsChildAgent)
399 {
400 scene.EventManager.TriggerIncomingInstantMessage(gim);
401 successful = true;
402 }
403 } 389 }
404 } 390 }
405 if (!successful) 391 if (!successful)
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);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e43185d..302103a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -893,22 +893,17 @@ namespace OpenSim.Region.Framework.Scenes
893 893
894 try 894 try
895 { 895 {
896 ForEachScenePresence(delegate(ScenePresence agent) 896 ForEachRootScenePresence(delegate(ScenePresence agent)
897 { 897 {
898 // If agent is a root agent. 898 //agent.ControllingClient.new
899 if (!agent.IsChildAgent) 899 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
900 { 900
901 //agent.ControllingClient.new 901 List<ulong> old = new List<ulong>();
902 //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); 902 old.Add(otherRegion.RegionHandle);
903 903 agent.DropOldNeighbours(old);
904 List<ulong> old = new List<ulong>(); 904 if (m_teleportModule != null)
905 old.Add(otherRegion.RegionHandle); 905 m_teleportModule.EnableChildAgent(agent, otherRegion);
906 agent.DropOldNeighbours(old); 906 });
907 if (m_teleportModule != null)
908 m_teleportModule.EnableChildAgent(agent, otherRegion);
909 }
910 }
911 );
912 } 907 }
913 catch (NullReferenceException) 908 catch (NullReferenceException)
914 { 909 {
@@ -1043,16 +1038,11 @@ namespace OpenSim.Region.Framework.Scenes
1043 GridRegion r = new GridRegion(region); 1038 GridRegion r = new GridRegion(region);
1044 try 1039 try
1045 { 1040 {
1046 ForEachScenePresence(delegate(ScenePresence agent) 1041 ForEachRootScenePresence(delegate(ScenePresence agent)
1047 { 1042 {
1048 // If agent is a root agent. 1043 if (m_teleportModule != null)
1049 if (!agent.IsChildAgent) 1044 m_teleportModule.EnableChildAgent(agent, r);
1050 { 1045 });
1051 if (m_teleportModule != null)
1052 m_teleportModule.EnableChildAgent(agent, r);
1053 }
1054 }
1055 );
1056 } 1046 }
1057 catch (NullReferenceException) 1047 catch (NullReferenceException)
1058 { 1048 {
@@ -1456,11 +1446,10 @@ namespace OpenSim.Region.Framework.Scenes
1456 /// <param name="stats">Stats on the Simulator's performance</param> 1446 /// <param name="stats">Stats on the Simulator's performance</param>
1457 private void SendSimStatsPackets(SimStats stats) 1447 private void SendSimStatsPackets(SimStats stats)
1458 { 1448 {
1459 ForEachScenePresence( 1449 ForEachRootScenePresence(
1460 delegate(ScenePresence agent) 1450 delegate(ScenePresence agent)
1461 { 1451 {
1462 if (!agent.IsChildAgent) 1452 agent.ControllingClient.SendSimStats(stats);
1463 agent.ControllingClient.SendSimStats(stats);
1464 } 1453 }
1465 ); 1454 );
1466 } 1455 }
@@ -4290,6 +4279,19 @@ namespace OpenSim.Region.Framework.Scenes
4290 } 4279 }
4291 4280
4292 /// <summary> 4281 /// <summary>
4282 /// Performs action on all ROOT (not child) scene presences.
4283 /// This is just a shortcut function since frequently actions only appy to root SPs
4284 /// </summary>
4285 /// <param name="action"></param>
4286 public void ForEachRootScenePresence(Action<ScenePresence> action)
4287 {
4288 if(m_sceneGraph != null)
4289 {
4290 m_sceneGraph.ForEachRootScenePresence(action);
4291 }
4292 }
4293
4294 /// <summary>
4293 /// Performs action on all scene presences. 4295 /// Performs action on all scene presences.
4294 /// </summary> 4296 /// </summary>
4295 /// <param name="action"></param> 4297 /// <param name="action"></param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index caec704..542bd51 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1190,7 +1190,21 @@ namespace OpenSim.Region.Framework.Scenes
1190 } 1190 }
1191 } 1191 }
1192 } 1192 }
1193 1193
1194 /// <summary>
1195 /// Performs action on all ROOT (not child) scene presences.
1196 /// This is just a shortcut function since frequently actions only appy to root SPs
1197 /// </summary>
1198 /// <param name="action"></param>
1199 public void ForEachRootScenePresence(Action<ScenePresence> action)
1200 {
1201 ForEachScenePresence(delegate(ScenePresence sp)
1202 {
1203 if (!sp.IsChildAgent)
1204 action(sp);
1205 });
1206 }
1207
1194 /// <summary> 1208 /// <summary>
1195 /// Performs action on all scene presences. This can ultimately run the actions in parallel but 1209 /// Performs action on all scene presences. This can ultimately run the actions in parallel but
1196 /// any delegates passed in will need to implement their own locking on data they reference and 1210 /// any delegates passed in will need to implement their own locking on data they reference and
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index a58b87d..3bfd866 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -458,9 +458,9 @@ namespace OpenSim.Region.Framework.Scenes
458 ForEachCurrentScene( 458 ForEachCurrentScene(
459 delegate(Scene scene) 459 delegate(Scene scene)
460 { 460 {
461 scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 461 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
462 { 462 {
463 if (!scenePresence.IsChildAgent && (name == null || scenePresence.Name == name)) 463 if (name == null || scenePresence.Name == name)
464 { 464 {
465 m_log.DebugFormat("Packet debug for {0} {1} set to {2}", 465 m_log.DebugFormat("Packet debug for {0} {1} set to {2}",
466 scenePresence.Firstname, 466 scenePresence.Firstname,
@@ -481,10 +481,9 @@ namespace OpenSim.Region.Framework.Scenes
481 ForEachCurrentScene( 481 ForEachCurrentScene(
482 delegate(Scene scene) 482 delegate(Scene scene)
483 { 483 {
484 scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 484 scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
485 { 485 {
486 if (!scenePresence.IsChildAgent) 486 avatars.Add(scenePresence);
487 avatars.Add(scenePresence);
488 }); 487 });
489 } 488 }
490 ); 489 );
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2ff3fb7..b68cc9f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1454,10 +1454,9 @@ namespace OpenSim.Region.Framework.Scenes
1454 if (volume < 0) 1454 if (volume < 0)
1455 volume = 0; 1455 volume = 0;
1456 1456
1457 m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) 1457 m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
1458 { 1458 {
1459 if (!sp.IsChildAgent) 1459 sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
1460 sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
1461 }); 1460 });
1462 } 1461 }
1463 1462
@@ -2690,10 +2689,8 @@ namespace OpenSim.Region.Framework.Scenes
2690 } 2689 }
2691 } 2690 }
2692 2691
2693 m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) 2692 m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
2694 { 2693 {
2695 if (sp.IsChildAgent)
2696 return;
2697 if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) 2694 if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
2698 sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); 2695 sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2699 }); 2696 });
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 38cdd77..0880e21 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/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
index 0d6313a..e22618d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
@@ -373,13 +373,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
373 scene.GetRootAgentCount(), scene.RegionInfo.RegionName, 373 scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
374 scene.RegionInfo.RegionID, 374 scene.RegionInfo.RegionID,
375 DateTime.UtcNow.ToString("s"))); 375 DateTime.UtcNow.ToString("s")));
376 scene.ForEachScenePresence(delegate(ScenePresence sp) 376 scene.ForEachRootScenePresence(delegate(ScenePresence sp)
377 { 377 {
378 if (!sp.IsChildAgent)
379 {
380 list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID)); 378 list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
381 list.Append("</avatars>"); 379 list.Append("</avatars>");
382 }
383 }); 380 });
384 string payload = list.ToString(); 381 string payload = list.ToString();
385 382
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index a12e6ea..10b83e6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -504,19 +504,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
504 // Try root avatar first 504 // Try root avatar first
505 foreach (Scene scene in m_sceneList) 505 foreach (Scene scene in m_sceneList)
506 { 506 {
507 if (scene.Entities.ContainsKey(agentID) && 507 ScenePresence sp = scene.GetScenePresence(agentID);
508 scene.Entities[agentID] is ScenePresence) 508 if (sp != null)
509 { 509 {
510 ScenePresence user = (ScenePresence)scene.Entities[agentID]; 510 if (!sp.IsChildAgent)
511 if (!user.IsChildAgent)
512 { 511 {
513 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", user.ControllingClient.Name); 512 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name);
514 return user.ControllingClient; 513 return sp.ControllingClient;
515 } 514 }
516 else 515 else
517 { 516 {
518 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", user.ControllingClient.Name); 517 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name);
519 child = user.ControllingClient; 518 child = sp.ControllingClient;
520 } 519 }
521 } 520 }
522 } 521 }
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 630fcab..b2c0f48 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1076,17 +1076,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1076 // Try root avatar first 1076 // Try root avatar first
1077 foreach (Scene scene in m_sceneList) 1077 foreach (Scene scene in m_sceneList)
1078 { 1078 {
1079 if (scene.Entities.ContainsKey(agentID) && 1079 ScenePresence sp = scene.GetScenePresence(agentID);
1080 scene.Entities[agentID] is ScenePresence) 1080 if (sp != null)
1081 { 1081 {
1082 ScenePresence user = (ScenePresence)scene.Entities[agentID]; 1082 if (!sp.IsChildAgent)
1083 if (!user.IsChildAgent)
1084 { 1083 {
1085 return user.ControllingClient; 1084 return sp.ControllingClient;
1086 } 1085 }
1087 else 1086 else
1088 { 1087 {
1089 child = user.ControllingClient; 1088 child = sp.ControllingClient;
1090 } 1089 }
1091 } 1090 }
1092 } 1091 }
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index 4a24c7d..92cbbc6 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -711,10 +711,8 @@ namespace OpenSim.Region.RegionCombinerModule
711 711
712 List<Vector3> CoarseLocations = new List<Vector3>(); 712 List<Vector3> CoarseLocations = new List<Vector3>();
713 List<UUID> AvatarUUIDs = new List<UUID>(); 713 List<UUID> AvatarUUIDs = new List<UUID>();
714 connectiondata.RegionScene.ForEachScenePresence(delegate(ScenePresence sp) 714 connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp)
715 { 715 {
716 if (sp.IsChildAgent)
717 return;
718 if (sp.UUID != presence.UUID) 716 if (sp.UUID != presence.UUID)
719 { 717 {
720 if (sp.ParentID != 0) 718 if (sp.ParentID != 0)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 82701ce..83c3b78 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3723,9 +3723,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3723 m_host.AddScriptLPS(1); 3723 m_host.AddScriptLPS(1);
3724 List<UUID> keytable = new List<UUID>(); 3724 List<UUID> keytable = new List<UUID>();
3725 // parse for sitting avatare-uuids 3725 // parse for sitting avatare-uuids
3726 World.ForEachScenePresence(delegate(ScenePresence presence) 3726 World.ForEachRootScenePresence(delegate(ScenePresence presence)
3727 { 3727 {
3728 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) 3728 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
3729 keytable.Add(presence.UUID); 3729 keytable.Add(presence.UUID);
3730 }); 3730 });
3731 3731
@@ -3785,9 +3785,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3785 m_host.AddScriptLPS(1); 3785 m_host.AddScriptLPS(1);
3786 // parse for sitting avatare-names 3786 // parse for sitting avatare-names
3787 List<String> nametable = new List<String>(); 3787 List<String> nametable = new List<String>();
3788 World.ForEachScenePresence(delegate(ScenePresence presence) 3788 World.ForEachRootScenePresence(delegate(ScenePresence presence)
3789 { 3789 {
3790 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) 3790 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
3791 nametable.Add(presence.ControllingClient.Name); 3791 nametable.Add(presence.ControllingClient.Name);
3792 }); 3792 });
3793 3793
@@ -7568,9 +7568,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7568 { 7568 {
7569 m_host.AddScriptLPS(1); 7569 m_host.AddScriptLPS(1);
7570 int avatarCount = 0; 7570 int avatarCount = 0;
7571 World.ForEachScenePresence(delegate(ScenePresence presence) 7571 World.ForEachRootScenePresence(delegate(ScenePresence presence)
7572 { 7572 {
7573 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) 7573 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
7574 avatarCount++; 7574 avatarCount++;
7575 }); 7575 });
7576 7576
@@ -9336,9 +9336,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9336 landObject.SetMediaUrl(url); 9336 landObject.SetMediaUrl(url);
9337 9337
9338 // now send to all (non-child) agents in the parcel 9338 // now send to all (non-child) agents in the parcel
9339 World.ForEachScenePresence(delegate(ScenePresence sp) 9339 World.ForEachRootScenePresence(delegate(ScenePresence sp)
9340 { 9340 {
9341 if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) 9341 if (sp.currentParcelUUID == landData.GlobalID)
9342 { 9342 {
9343 sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, 9343 sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
9344 landData.MediaID, 9344 landData.MediaID,
@@ -9369,9 +9369,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9369 if (presence == null) 9369 if (presence == null)
9370 { 9370 {
9371 // send to all (non-child) agents in the parcel 9371 // send to all (non-child) agents in the parcel
9372 World.ForEachScenePresence(delegate(ScenePresence sp) 9372 World.ForEachRootScenePresence(delegate(ScenePresence sp)
9373 { 9373 {
9374 if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) 9374 if (sp.currentParcelUUID == landData.GlobalID)
9375 { 9375 {
9376 sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? 9376 sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
9377 (ParcelMediaCommandEnum)commandToSend, 9377 (ParcelMediaCommandEnum)commandToSend,
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