From c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Nov 2011 20:38:07 +0000 Subject: Convert SendKillObject to take a list of uint rather than sending one packet per prim. More to come as we change to make use of this. --- OpenSim/Region/Framework/Scenes/Scene.cs | 32 +++++++++------------- .../Framework/Scenes/SceneCommunicationService.cs | 4 --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- 3 files changed, 14 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5465ca4..3b90c16 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3102,7 +3102,7 @@ namespace OpenSim.Region.Framework.Scenes delegate(IClientAPI client) { //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway - try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } + try { client.SendKillObject(avatar.RegionHandle, new List { avatar.LocalId }); } catch (NullReferenceException) { } }); @@ -3161,28 +3161,24 @@ namespace OpenSim.Region.Framework.Scenes #region Entities - public void SendKillObject(uint localID) + public void SendKillObject(List localIDs) { - SceneObjectPart part = GetSceneObjectPart(localID); - UUID attachedAvatar = UUID.Zero; + List deleteIDs = new List(); - if (part != null) // It is a prim + foreach (uint localID in localIDs) { - if (!part.ParentGroup.IsDeleted) // Valid + SceneObjectPart part = GetSceneObjectPart(localID); + if (part != null) // It is a prim { - if (part.ParentGroup.RootPart != part) // Child part - return; - - if (part.ParentGroup.IsAttachment && part.ParentGroup.AttachmentPoint >= 31 && part.ParentGroup.AttachmentPoint <= 38) - attachedAvatar = part.ParentGroup.AttachedAvatar; + if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid + { + if (part.ParentGroup.RootPart != part) // Child part + continue; + } } + deleteIDs.Add(localID); } - - ForEachClient(delegate(IClientAPI client) - { - if (attachedAvatar == UUID.Zero || attachedAvatar == client.AgentId) - client.SendKillObject(m_regionHandle, localID); - }); + ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, deleteIDs); }); } #endregion @@ -3200,7 +3196,6 @@ namespace OpenSim.Region.Framework.Scenes //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; - m_sceneGridService.KiPrimitive += SendKillObject; m_sceneGridService.OnGetLandData += GetLandData; } @@ -3209,7 +3204,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void UnRegisterRegionWithComms() { - m_sceneGridService.KiPrimitive -= SendKillObject; m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 7cffa70..eccce89 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -44,8 +44,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.Framework.Scenes { - public delegate void KiPrimitiveDelegate(uint localID); - public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List regionlst); /// @@ -113,8 +111,6 @@ namespace OpenSim.Region.Framework.Scenes // private LogOffUser handlerLogOffUser = null; // private GetLandData handlerGetLandData = null; // OnGetLandData - public KiPrimitiveDelegate KiPrimitive; - public SceneCommunicationService() { } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3f4e112..339cf0f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1162,7 +1162,7 @@ namespace OpenSim.Region.Framework.Scenes { if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || (AttachmentPoint < 31) || (AttachmentPoint > 38)) - avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); + avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId }); } } }); -- cgit v1.1 From 559e6e52f537c1f897ab166ce2e7790631fb82e3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Nov 2011 20:43:49 +0000 Subject: Make the AsyncSceneObjectDeleter send a list of kills. This will make large marquee-selected deletions of single prims or small link sets nearly instantaneous --- OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 0ac3899..5dfd3e0 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -104,8 +104,14 @@ namespace OpenSim.Region.Framework.Scenes // better than losing the object for now. if (permissionToDelete) { + List killIDs = new List(); + foreach (SceneObjectGroup g in objectGroups) - g.DeleteGroupFromScene(false); + { killIDs.Add(g.LocalId); + g.DeleteGroupFromScene(true); + } + + m_scene.SendKillObject(killIDs); } } -- cgit v1.1