From 860b2a502f797e5822c6705d4639f370f3ac5861 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 16 Sep 2010 17:30:46 -0700 Subject: Changed SceneObjectGroup to store parts with the fast and thread-safe MapAndArray collection --- .../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 10 +++------- .../Framework/InventoryAccess/InventoryAccessModule.cs | 8 ++------ .../Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 6 +----- .../Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 7 +------ OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | 6 +----- 5 files changed, 8 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1ebac42..cb39e46 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -567,13 +567,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments so.RootPart.AttachedAvatar = avatar.UUID; //Anakin Lohner bug #3839 - lock (so.Children) - { - foreach (SceneObjectPart p in so.Children.Values) - { - p.AttachedAvatar = avatar.UUID; - } - } + SceneObjectPart[] parts = so.Parts; + for (int i = 0; i < parts.Length; i++) + parts[i].AttachedAvatar = avatar.UUID; if (so.RootPart.PhysActor != null) { diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4c4eeff..c1d6cd3 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -594,10 +594,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess rootPart.Name = item.Name; rootPart.Description = item.Description; - List partList = null; - lock (group.Children) - partList = new List(group.Children.Values); - group.SetGroup(remoteClient.ActiveGroupId, remoteClient); if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) { @@ -607,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (m_Scene.Permissions.PropagatePermissions()) { - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in group.Parts) { part.EveryoneMask = item.EveryOnePermissions; part.NextOwnerMask = item.NextPermissions; @@ -618,7 +614,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in group.Parts) { if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 1fba6c2..6b538f6 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -243,11 +243,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // to the same scene (when this is possible). sceneObject.ResetIDs(); - List partList = null; - lock (sceneObject.Children) - partList = new List(sceneObject.Children.Values); - - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in sceneObject.Parts) { if (!ResolveUserUuid(part.CreatorID)) part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index db50339..d91c36c 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -128,14 +128,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell group.SetOwnerId(remoteClient.AgentId); group.SetRootPartOwner(part, remoteClient.AgentId, remoteClient.ActiveGroupId); - List partList = null; - - lock (group.Children) - partList = new List(group.Children.Values); - if (m_scene.Permissions.PropagatePermissions()) { - foreach (SceneObjectPart child in partList) + foreach (SceneObjectPart child in group.Parts) { child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); child.TriggerScriptChangedEvent(Changed.OWNER); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 1bd1371..c83ac85 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -229,11 +229,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Color mapdotspot = Color.Gray; // Default color when prim color is white // Loop over prim in group - List partList = null; - lock (mapdot.Children) - partList = new List(mapdot.Children.Values); - - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in mapdot.Parts) { if (part == null) continue; -- cgit v1.1