diff options
author | Melanie | 2011-10-27 18:14:38 +0100 |
---|---|---|
committer | Melanie | 2011-10-27 18:14:38 +0100 |
commit | b975cbcbed71b12898052395fbc83a5880273190 (patch) | |
tree | f149288740af5227a865783a51f566bef537721e | |
parent | Merge branch 'master' into bigmerge (diff) | |
parent | Removed use of 'is' operator and casting to find the root ScenePresence in Me... (diff) | |
download | opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.zip opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.gz opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.bz2 opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.xz |
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
27 files changed, 209 insertions, 218 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index de08f90..0e82859 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -1976,8 +1976,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1976 | SendBulkUpdateInventoryItem((InventoryItemBase)node); | 1976 | SendBulkUpdateInventoryItem((InventoryItemBase)node); |
1977 | else if (node is InventoryFolderBase) | 1977 | else if (node is InventoryFolderBase) |
1978 | SendBulkUpdateInventoryFolder((InventoryFolderBase)node); | 1978 | SendBulkUpdateInventoryFolder((InventoryFolderBase)node); |
1979 | else if (node != null) | ||
1980 | m_log.ErrorFormat("[CLIENT]: {0} sent unknown inventory node named {1}", Name, node.Name); | ||
1979 | else | 1981 | else |
1980 | m_log.ErrorFormat("[CLIENT]: Client for {0} sent unknown inventory node named {1}", Name, node.Name); | 1982 | m_log.ErrorFormat("[CLIENT]: {0} sent null inventory node", Name); |
1981 | } | 1983 | } |
1982 | 1984 | ||
1983 | protected void SendBulkUpdateInventoryItem(InventoryItemBase item) | 1985 | protected void SendBulkUpdateInventoryItem(InventoryItemBase item) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 35a3f43..b16ca53 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -306,13 +306,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
306 | 306 | ||
307 | if (c.Scene != null) | 307 | if (c.Scene != null) |
308 | { | 308 | { |
309 | ((Scene)c.Scene).ForEachScenePresence | 309 | ((Scene)c.Scene).ForEachRootScenePresence |
310 | ( | 310 | ( |
311 | delegate(ScenePresence presence) | 311 | delegate(ScenePresence presence) |
312 | { | 312 | { |
313 | // ignore chat from child agents | ||
314 | if (presence.IsChildAgent) return; | ||
315 | |||
316 | IClientAPI client = presence.ControllingClient; | 313 | IClientAPI client = presence.ControllingClient; |
317 | 314 | ||
318 | // don't forward SayOwner chat from objects to | 315 | // 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 80957b4..00556c4 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 a83b3df..f73f9c1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
221 | } | 221 | } |
222 | else if (agentID == ALL_AGENTS) | 222 | else if (agentID == ALL_AGENTS) |
223 | { | 223 | { |
224 | m_scene.ForEachScenePresence( | 224 | m_scene.ForEachRootScenePresence( |
225 | delegate(ScenePresence p) | 225 | delegate(ScenePresence p) |
226 | { | 226 | { |
227 | if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID))) | 227 | if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID))) |
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 ff74354..712632b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -140,8 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
140 | // Try root avatar only first | 140 | // Try root avatar only first |
141 | foreach (Scene scene in m_Scenes) | 141 | foreach (Scene scene in m_Scenes) |
142 | { | 142 | { |
143 | if (scene.Entities.ContainsKey(toAgentID) && | 143 | // m_log.DebugFormat( |
144 | scene.Entities[toAgentID] is ScenePresence) | 144 | // "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", |
145 | // toAgentID.ToString(), scene.RegionInfo.RegionName); | ||
146 | ScenePresence sp = scene.GetScenePresence(toAgentID); | ||
147 | if (sp != null && !sp.IsChildAgent) | ||
145 | { | 148 | { |
146 | // m_log.DebugFormat( | 149 | // m_log.DebugFormat( |
147 | // "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", | 150 | // "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", |
@@ -165,9 +168,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
165 | { | 168 | { |
166 | // m_log.DebugFormat( | 169 | // m_log.DebugFormat( |
167 | // "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); | 170 | // "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); |
168 | 171 | ScenePresence sp = scene.GetScenePresence(toAgentID); | |
169 | if (scene.Entities.ContainsKey(toAgentID) && | 172 | if (sp != null) |
170 | scene.Entities[toAgentID] is ScenePresence) | ||
171 | { | 173 | { |
172 | // Local message | 174 | // Local message |
173 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; | 175 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; |
@@ -405,17 +407,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
405 | // Trigger the Instant message in the scene. | 407 | // Trigger the Instant message in the scene. |
406 | foreach (Scene scene in m_Scenes) | 408 | foreach (Scene scene in m_Scenes) |
407 | { | 409 | { |
408 | if (scene.Entities.ContainsKey(toAgentID) && | 410 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
409 | scene.Entities[toAgentID] is ScenePresence) | 411 | if (sp != null && !sp.IsChildAgent) |
410 | { | 412 | { |
411 | ScenePresence user = | 413 | scene.EventManager.TriggerIncomingInstantMessage(gim); |
412 | (ScenePresence)scene.Entities[toAgentID]; | 414 | successful = true; |
413 | |||
414 | if (!user.IsChildAgent) | ||
415 | { | ||
416 | scene.EventManager.TriggerIncomingInstantMessage(gim); | ||
417 | successful = true; | ||
418 | } | ||
419 | } | 415 | } |
420 | } | 416 | } |
421 | if (!successful) | 417 | if (!successful) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 120fd43..b33342f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -277,19 +277,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
277 | { | 277 | { |
278 | if (m_TransferModule != null) | 278 | if (m_TransferModule != null) |
279 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { | 279 | m_TransferModule.SendInstantMessage(im, delegate(bool success) { |
280 | // Send BulkUpdateInventory | ||
281 | IInventoryService invService = scene.InventoryService; | ||
282 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip | ||
283 | 280 | ||
284 | InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); | 281 | // justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011 |
285 | folder = invService.GetFolder(folder); | 282 | // and is apparently supposed to fix bulk inventory updates after accepting items. But |
286 | 283 | // instead it appears to cause two copies of an accepted folder for the receiving user in | |
287 | ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); | 284 | // at least some cases. Folder/item update is already done when the offer is made (see code above) |
288 | 285 | ||
289 | // If the user has left the scene by the time the message comes back then we can't send | 286 | // // Send BulkUpdateInventory |
290 | // them the update. | 287 | // IInventoryService invService = scene.InventoryService; |
291 | if (fromUser != null) | 288 | // UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip |
292 | fromUser.ControllingClient.SendBulkUpdateInventory(folder); | 289 | // |
290 | // InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); | ||
291 | // folder = invService.GetFolder(folder); | ||
292 | // | ||
293 | // ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID)); | ||
294 | // | ||
295 | // // If the user has left the scene by the time the message comes back then we can't send | ||
296 | // // them the update. | ||
297 | // if (fromUser != null) | ||
298 | // fromUser.ControllingClient.SendBulkUpdateInventory(folder); | ||
293 | }); | 299 | }); |
294 | } | 300 | } |
295 | } | 301 | } |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 321f6b6..1471bc9 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -678,11 +678,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
678 | if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) | 678 | if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) |
679 | return; | 679 | return; |
680 | 680 | ||
681 | Scene.ForEachScenePresence(delegate(ScenePresence sp) | 681 | Scene.ForEachRootScenePresence(delegate(ScenePresence p) |
682 | { | 682 | { |
683 | if (sp.UUID != senderID) | 683 | if (p.UUID != senderID) |
684 | { | 684 | { |
685 | ScenePresence p = Scene.GetScenePresence(sp.UUID); | ||
686 | // make sure they are still there, we could be working down a long list | 685 | // make sure they are still there, we could be working down a long list |
687 | // Also make sure they are actually in the region | 686 | // Also make sure they are actually in the region |
688 | if (p != null && !p.IsChildAgent) | 687 | if (p != null && !p.IsChildAgent) |
@@ -953,10 +952,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
953 | 952 | ||
954 | public void sendRegionInfoPacketToAll() | 953 | public void sendRegionInfoPacketToAll() |
955 | { | 954 | { |
956 | Scene.ForEachScenePresence(delegate(ScenePresence sp) | 955 | Scene.ForEachRootScenePresence(delegate(ScenePresence sp) |
957 | { | 956 | { |
958 | if (!sp.IsChildAgent) | 957 | HandleRegionInfoRequest(sp.ControllingClient); |
959 | HandleRegionInfoRequest(sp.ControllingClient); | ||
960 | }); | 958 | }); |
961 | } | 959 | } |
962 | 960 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 950dff7..4f10fbf 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -533,11 +533,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
533 | 533 | ||
534 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) | 534 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) |
535 | { | 535 | { |
536 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | 536 | m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar) |
537 | { | 537 | { |
538 | if (avatar.IsChildAgent) | ||
539 | return; | ||
540 | |||
541 | ILandObject over = null; | 538 | ILandObject over = null; |
542 | try | 539 | try |
543 | { | 540 | { |
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 21e3ecb..0fb346a 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 b2f5279..0cb6681 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -920,22 +920,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
920 | 920 | ||
921 | try | 921 | try |
922 | { | 922 | { |
923 | ForEachScenePresence(delegate(ScenePresence agent) | 923 | ForEachRootScenePresence(delegate(ScenePresence agent) |
924 | { | 924 | { |
925 | // If agent is a root agent. | 925 | //agent.ControllingClient.new |
926 | if (!agent.IsChildAgent) | 926 | //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); |
927 | { | 927 | |
928 | //agent.ControllingClient.new | 928 | List<ulong> old = new List<ulong>(); |
929 | //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); | 929 | old.Add(otherRegion.RegionHandle); |
930 | 930 | agent.DropOldNeighbours(old); | |
931 | List<ulong> old = new List<ulong>(); | 931 | if (m_teleportModule != null) |
932 | old.Add(otherRegion.RegionHandle); | 932 | m_teleportModule.EnableChildAgent(agent, otherRegion); |
933 | agent.DropOldNeighbours(old); | 933 | }); |
934 | if (m_teleportModule != null) | ||
935 | m_teleportModule.EnableChildAgent(agent, otherRegion); | ||
936 | } | ||
937 | } | ||
938 | ); | ||
939 | } | 934 | } |
940 | catch (NullReferenceException) | 935 | catch (NullReferenceException) |
941 | { | 936 | { |
@@ -1070,16 +1065,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1070 | GridRegion r = new GridRegion(region); | 1065 | GridRegion r = new GridRegion(region); |
1071 | try | 1066 | try |
1072 | { | 1067 | { |
1073 | ForEachScenePresence(delegate(ScenePresence agent) | 1068 | ForEachRootScenePresence(delegate(ScenePresence agent) |
1074 | { | 1069 | { |
1075 | // If agent is a root agent. | 1070 | if (m_teleportModule != null) |
1076 | if (!agent.IsChildAgent) | 1071 | m_teleportModule.EnableChildAgent(agent, r); |
1077 | { | 1072 | }); |
1078 | if (m_teleportModule != null) | ||
1079 | m_teleportModule.EnableChildAgent(agent, r); | ||
1080 | } | ||
1081 | } | ||
1082 | ); | ||
1083 | } | 1073 | } |
1084 | catch (NullReferenceException) | 1074 | catch (NullReferenceException) |
1085 | { | 1075 | { |
@@ -1493,11 +1483,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1493 | /// <param name="stats">Stats on the Simulator's performance</param> | 1483 | /// <param name="stats">Stats on the Simulator's performance</param> |
1494 | private void SendSimStatsPackets(SimStats stats) | 1484 | private void SendSimStatsPackets(SimStats stats) |
1495 | { | 1485 | { |
1496 | ForEachScenePresence( | 1486 | ForEachRootScenePresence( |
1497 | delegate(ScenePresence agent) | 1487 | delegate(ScenePresence agent) |
1498 | { | 1488 | { |
1499 | if (!agent.IsChildAgent) | 1489 | agent.ControllingClient.SendSimStats(stats); |
1500 | agent.ControllingClient.SendSimStats(stats); | ||
1501 | } | 1490 | } |
1502 | ); | 1491 | ); |
1503 | } | 1492 | } |
@@ -4463,6 +4452,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
4463 | } | 4452 | } |
4464 | 4453 | ||
4465 | /// <summary> | 4454 | /// <summary> |
4455 | /// Performs action on all ROOT (not child) scene presences. | ||
4456 | /// This is just a shortcut function since frequently actions only appy to root SPs | ||
4457 | /// </summary> | ||
4458 | /// <param name="action"></param> | ||
4459 | public void ForEachRootScenePresence(Action<ScenePresence> action) | ||
4460 | { | ||
4461 | if(m_sceneGraph != null) | ||
4462 | { | ||
4463 | m_sceneGraph.ForEachRootScenePresence(action); | ||
4464 | } | ||
4465 | } | ||
4466 | |||
4467 | /// <summary> | ||
4466 | /// Performs action on all scene presences. | 4468 | /// Performs action on all scene presences. |
4467 | /// </summary> | 4469 | /// </summary> |
4468 | /// <param name="action"></param> | 4470 | /// <param name="action"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 13668ab..a4080ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1265,7 +1265,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1265 | } | 1265 | } |
1266 | } | 1266 | } |
1267 | } | 1267 | } |
1268 | 1268 | ||
1269 | /// <summary> | ||
1270 | /// Performs action on all ROOT (not child) scene presences. | ||
1271 | /// This is just a shortcut function since frequently actions only appy to root SPs | ||
1272 | /// </summary> | ||
1273 | /// <param name="action"></param> | ||
1274 | public void ForEachRootScenePresence(Action<ScenePresence> action) | ||
1275 | { | ||
1276 | ForEachScenePresence(delegate(ScenePresence sp) | ||
1277 | { | ||
1278 | if (!sp.IsChildAgent) | ||
1279 | action(sp); | ||
1280 | }); | ||
1281 | } | ||
1282 | |||
1269 | /// <summary> | 1283 | /// <summary> |
1270 | /// Performs action on all scene presences. This can ultimately run the actions in parallel but | 1284 | /// Performs action on all scene presences. This can ultimately run the actions in parallel but |
1271 | /// any delegates passed in will need to implement their own locking on data they reference and | 1285 | /// 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 6e20d14..0a8edf9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1493,10 +1493,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1493 | if (volume < 0) | 1493 | if (volume < 0) |
1494 | volume = 0; | 1494 | volume = 0; |
1495 | 1495 | ||
1496 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) | 1496 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) |
1497 | { | 1497 | { |
1498 | if (!sp.IsChildAgent) | 1498 | sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); |
1499 | sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); | ||
1500 | }); | 1499 | }); |
1501 | } | 1500 | } |
1502 | 1501 | ||
@@ -2136,6 +2135,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2136 | 2135 | ||
2137 | public void PhysicsCollision(EventArgs e) | 2136 | public void PhysicsCollision(EventArgs e) |
2138 | { | 2137 | { |
2138 | // m_log.DebugFormat("Invoking PhysicsCollision on {0} {1} {2}", Name, LocalId, UUID); | ||
2139 | |||
2139 | // single threaded here | 2140 | // single threaded here |
2140 | 2141 | ||
2141 | CollisionEventUpdate a = (CollisionEventUpdate)e; | 2142 | CollisionEventUpdate a = (CollisionEventUpdate)e; |
@@ -2729,10 +2730,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2729 | TaskInventory.LockItemsForRead(false); | 2730 | TaskInventory.LockItemsForRead(false); |
2730 | } | 2731 | } |
2731 | 2732 | ||
2732 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) | 2733 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) |
2733 | { | 2734 | { |
2734 | if (sp.IsChildAgent) | ||
2735 | return; | ||
2736 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) | 2735 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) |
2737 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | 2736 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); |
2738 | }); | 2737 | }); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0f13050..35870c5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2950,19 +2950,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2950 | public void SendOtherAgentsAvatarDataToMe() | 2950 | public void SendOtherAgentsAvatarDataToMe() |
2951 | { | 2951 | { |
2952 | int count = 0; | 2952 | int count = 0; |
2953 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2953 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) |
2954 | { | 2954 | { |
2955 | // only send information about root agents | 2955 | // only send information about other root agents |
2956 | if (scenePresence.IsChildAgent) | 2956 | if (scenePresence.UUID == UUID) |
2957 | return; | 2957 | return; |
2958 | |||
2959 | // only send information about other root agents | ||
2960 | if (scenePresence.UUID == UUID) | ||
2961 | return; | ||
2962 | 2958 | ||
2963 | scenePresence.SendAvatarDataToAgent(this); | 2959 | scenePresence.SendAvatarDataToAgent(this); |
2964 | count++; | 2960 | count++; |
2965 | }); | 2961 | }); |
2966 | 2962 | ||
2967 | m_scene.StatsReporter.AddAgentUpdates(count); | 2963 | m_scene.StatsReporter.AddAgentUpdates(count); |
2968 | } | 2964 | } |
@@ -2996,13 +2992,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2996 | 2992 | ||
2997 | int count = 0; | 2993 | int count = 0; |
2998 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2994 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2999 | { | 2995 | { |
3000 | if (scenePresence.UUID == UUID) | 2996 | // only send information to other root agents |
3001 | return; | 2997 | if (scenePresence.UUID == UUID) |
2998 | return; | ||
3002 | 2999 | ||
3003 | SendAppearanceToAgent(scenePresence); | 3000 | SendAppearanceToAgent(scenePresence); |
3004 | count++; | 3001 | count++; |
3005 | }); | 3002 | }); |
3006 | 3003 | ||
3007 | m_scene.StatsReporter.AddAgentUpdates(count); | 3004 | m_scene.StatsReporter.AddAgentUpdates(count); |
3008 | } | 3005 | } |
@@ -3016,19 +3013,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3016 | //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); | 3013 | //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); |
3017 | 3014 | ||
3018 | int count = 0; | 3015 | int count = 0; |
3019 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 3016 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) |
3020 | { | 3017 | { |
3021 | // only send information about root agents | 3018 | // only send information about other root agents |
3022 | if (scenePresence.IsChildAgent) | 3019 | if (scenePresence.UUID == UUID) |
3023 | return; | 3020 | return; |
3024 | |||
3025 | // only send information about other root agents | ||
3026 | if (scenePresence.UUID == UUID) | ||
3027 | return; | ||
3028 | 3021 | ||
3029 | scenePresence.SendAppearanceToAgent(this); | 3022 | scenePresence.SendAppearanceToAgent(this); |
3030 | count++; | 3023 | count++; |
3031 | }); | 3024 | }); |
3032 | 3025 | ||
3033 | m_scene.StatsReporter.AddAgentUpdates(count); | 3026 | m_scene.StatsReporter.AddAgentUpdates(count); |
3034 | } | 3027 | } |
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/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 362f997..49f60f8 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -76,6 +76,8 @@ namespace OpenSim.Region.Physics.Manager | |||
76 | /// </summary> | 76 | /// </summary> |
77 | public int Count { get { return m_objCollisionList.Count; } } | 77 | public int Count { get { return m_objCollisionList.Count; } } |
78 | 78 | ||
79 | public bool CollisionsOnPreviousFrame { get; private set; } | ||
80 | |||
79 | public Dictionary<uint, ContactPoint> m_objCollisionList; | 81 | public Dictionary<uint, ContactPoint> m_objCollisionList; |
80 | 82 | ||
81 | public CollisionEventUpdate(Dictionary<uint, ContactPoint> objCollisionList) | 83 | public CollisionEventUpdate(Dictionary<uint, ContactPoint> objCollisionList) |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 3a17511..6e34811 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -193,6 +193,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
193 | private int m_eventsubscription; | 193 | private int m_eventsubscription; |
194 | private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); | 194 | private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); |
195 | 195 | ||
196 | /// <summary> | ||
197 | /// Signal whether there were collisions on the previous frame, so we know if we need to send the | ||
198 | /// empty CollisionEventsThisFrame to the prim so that it can detect the end of a collision. | ||
199 | /// </summary> | ||
200 | /// <remarks> | ||
201 | /// This is probably a temporary measure, pending storing this information consistently in CollisionEventUpdate itself. | ||
202 | /// </remarks> | ||
203 | private bool m_collisionsOnPreviousFrame; | ||
204 | |||
196 | private IntPtr m_linkJoint = IntPtr.Zero; | 205 | private IntPtr m_linkJoint = IntPtr.Zero; |
197 | 206 | ||
198 | internal volatile bool childPrim; | 207 | internal volatile bool childPrim; |
@@ -3025,8 +3034,20 @@ Console.WriteLine(" JointCreateFixed"); | |||
3025 | 3034 | ||
3026 | public void SendCollisions() | 3035 | public void SendCollisions() |
3027 | { | 3036 | { |
3028 | if (CollisionEventsThisFrame.Count > 0) | 3037 | if (m_collisionsOnPreviousFrame || CollisionEventsThisFrame.Count > 0) |
3038 | { | ||
3029 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 3039 | base.SendCollisionUpdate(CollisionEventsThisFrame); |
3040 | |||
3041 | if (CollisionEventsThisFrame.Count > 0) | ||
3042 | { | ||
3043 | m_collisionsOnPreviousFrame = true; | ||
3044 | CollisionEventsThisFrame.Clear(); | ||
3045 | } | ||
3046 | else | ||
3047 | { | ||
3048 | m_collisionsOnPreviousFrame = false; | ||
3049 | } | ||
3050 | } | ||
3030 | } | 3051 | } |
3031 | 3052 | ||
3032 | public override bool SubscribedEvents() | 3053 | public override bool SubscribedEvents() |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 3edc3a2..1413535 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -629,10 +629,8 @@ namespace OpenSim.Region.RegionCombinerModule | |||
629 | 629 | ||
630 | List<Vector3> CoarseLocations = new List<Vector3>(); | 630 | List<Vector3> CoarseLocations = new List<Vector3>(); |
631 | List<UUID> AvatarUUIDs = new List<UUID>(); | 631 | List<UUID> AvatarUUIDs = new List<UUID>(); |
632 | connectiondata.RegionScene.ForEachScenePresence(delegate(ScenePresence sp) | 632 | connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) |
633 | { | 633 | { |
634 | if (sp.IsChildAgent) | ||
635 | return; | ||
636 | if (sp.UUID != presence.UUID) | 634 | if (sp.UUID != presence.UUID) |
637 | { | 635 | { |
638 | if (sp.ParentID != 0) | 636 | 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 e53fd5d..ebe276b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4124,9 +4124,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4124 | m_host.AddScriptLPS(1); | 4124 | m_host.AddScriptLPS(1); |
4125 | List<UUID> keytable = new List<UUID>(); | 4125 | List<UUID> keytable = new List<UUID>(); |
4126 | // parse for sitting avatare-uuids | 4126 | // parse for sitting avatare-uuids |
4127 | World.ForEachScenePresence(delegate(ScenePresence presence) | 4127 | World.ForEachRootScenePresence(delegate(ScenePresence presence) |
4128 | { | 4128 | { |
4129 | if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) | 4129 | if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) |
4130 | keytable.Add(presence.UUID); | 4130 | keytable.Add(presence.UUID); |
4131 | }); | 4131 | }); |
4132 | 4132 | ||
@@ -4199,9 +4199,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4199 | m_host.AddScriptLPS(1); | 4199 | m_host.AddScriptLPS(1); |
4200 | // parse for sitting avatare-names | 4200 | // parse for sitting avatare-names |
4201 | List<String> nametable = new List<String>(); | 4201 | List<String> nametable = new List<String>(); |
4202 | World.ForEachScenePresence(delegate(ScenePresence presence) | 4202 | World.ForEachRootScenePresence(delegate(ScenePresence presence) |
4203 | { | 4203 | { |
4204 | if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) | 4204 | if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) |
4205 | nametable.Add(presence.ControllingClient.Name); | 4205 | nametable.Add(presence.ControllingClient.Name); |
4206 | }); | 4206 | }); |
4207 | 4207 | ||
@@ -9933,9 +9933,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9933 | landObject.SetMediaUrl(url); | 9933 | landObject.SetMediaUrl(url); |
9934 | 9934 | ||
9935 | // now send to all (non-child) agents in the parcel | 9935 | // now send to all (non-child) agents in the parcel |
9936 | World.ForEachScenePresence(delegate(ScenePresence sp) | 9936 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
9937 | { | 9937 | { |
9938 | if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) | 9938 | if (sp.currentParcelUUID == landData.GlobalID) |
9939 | { | 9939 | { |
9940 | sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, | 9940 | sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, |
9941 | landData.MediaID, | 9941 | landData.MediaID, |
@@ -9966,9 +9966,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9966 | if (presence == null) | 9966 | if (presence == null) |
9967 | { | 9967 | { |
9968 | // send to all (non-child) agents in the parcel | 9968 | // send to all (non-child) agents in the parcel |
9969 | World.ForEachScenePresence(delegate(ScenePresence sp) | 9969 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
9970 | { | 9970 | { |
9971 | if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) | 9971 | if (sp.currentParcelUUID == landData.GlobalID) |
9972 | { | 9972 | { |
9973 | sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? | 9973 | sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? |
9974 | (ParcelMediaCommandEnum)commandToSend, | 9974 | (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 ab0eec9..dc22017 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -882,10 +882,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
882 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); | 882 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); |
883 | 883 | ||
884 | LSL_List result = new LSL_List(); | 884 | LSL_List result = new LSL_List(); |
885 | World.ForEachScenePresence(delegate(ScenePresence sp) | 885 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
886 | { | 886 | { |
887 | if (!sp.IsChildAgent) | 887 | result.Add(new LSL_String(sp.Name)); |
888 | result.Add(new LSL_String(sp.Name)); | ||
889 | }); | 888 | }); |
890 | return result; | 889 | return result; |
891 | } | 890 | } |
@@ -2590,11 +2589,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2590 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 2589 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2591 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 2590 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
2592 | { | 2591 | { |
2593 | World.ForEachScenePresence(delegate(ScenePresence sp) | 2592 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
2594 | { | 2593 | { |
2595 | if (!sp.IsChildAgent && | 2594 | if (sp.Firstname == FirstName && sp.Lastname == SurName) |
2596 | sp.Firstname == FirstName && | ||
2597 | sp.Lastname == SurName) | ||
2598 | { | 2595 | { |
2599 | // kick client... | 2596 | // kick client... |
2600 | if (alert != null) | 2597 | if (alert != null) |
@@ -2726,17 +2723,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2726 | CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); | 2723 | CheckThreatLevel(ThreatLevel.None, "osGetAvatarList"); |
2727 | 2724 | ||
2728 | LSL_List result = new LSL_List(); | 2725 | LSL_List result = new LSL_List(); |
2729 | World.ForEachScenePresence(delegate (ScenePresence avatar) | 2726 | World.ForEachRootScenePresence(delegate (ScenePresence avatar) |
2730 | { | 2727 | { |
2731 | if (avatar != null && avatar.UUID != m_host.OwnerID) | 2728 | if (avatar != null && avatar.UUID != m_host.OwnerID) |
2732 | { | 2729 | { |
2733 | if (avatar.IsChildAgent == false) | 2730 | result.Add(new LSL_String(avatar.UUID.ToString())); |
2734 | { | 2731 | OpenMetaverse.Vector3 ap = avatar.AbsolutePosition; |
2735 | result.Add(new LSL_String(avatar.UUID.ToString())); | 2732 | result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z)); |
2736 | OpenMetaverse.Vector3 ap = avatar.AbsolutePosition; | 2733 | result.Add(new LSL_String(avatar.Name)); |
2737 | result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z)); | ||
2738 | result.Add(new LSL_String(avatar.Name)); | ||
2739 | } | ||
2740 | } | 2734 | } |
2741 | }); | 2735 | }); |
2742 | 2736 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 3ebeb75..402377d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -442,7 +442,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
442 | IScriptInstance instance = GetInstance(itemId); | 442 | IScriptInstance instance = GetInstance(itemId); |
443 | if (instance == null) | 443 | if (instance == null) |
444 | { | 444 | { |
445 | MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId); | 445 | // Commented out for now since this will cause false reports on simulators with more than |
446 | // one scene where the current command line set region is 'root' (which causes commands to | ||
447 | // go to both regions... (sigh) | ||
448 | // MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId); | ||
446 | return; | 449 | return; |
447 | } | 450 | } |
448 | else | 451 | else |