From abfede7819e470c4a9d135b529c40d19fb94dca5 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 6 Oct 2010 19:59:30 +0200
Subject: Plumb the path for multiple object deletes
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 44 +++++-----------------
OpenSim/Region/Framework/Scenes/Scene.cs | 4 +-
.../Region/Framework/Scenes/SceneObjectGroup.cs | 8 +++-
.../Scenes/Tests/SceneObjectBasicTests.cs | 2 +-
4 files changed, 18 insertions(+), 40 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1bf6b87..4cc797b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1689,37 +1689,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- ///
- /// Called when one or more objects are removed from the environment into inventory.
- ///
- ///
- ///
- ///
- ///
- ///
- public virtual void DeRezObject(IClientAPI remoteClient, List localIDs,
- UUID groupID, DeRezAction action, UUID destinationID)
- {
- foreach (uint localID in localIDs)
- {
- DeRezObject(remoteClient, localID, groupID, action, destinationID);
- }
- }
-
- ///
- /// Called when an object is removed from the environment into inventory.
- ///
- ///
- ///
- ///
- ///
- ///
- public virtual void DeRezObject(IClientAPI remoteClient, uint localID,
- UUID groupID, DeRezAction action, UUID destinationID)
- {
- DeRezObjects(remoteClient, new List() { localID }, groupID, action, destinationID);
- }
-
public virtual void DeRezObjects(IClientAPI remoteClient, List localIDs,
UUID groupID, DeRezAction action, UUID destinationID)
{
@@ -1990,14 +1959,19 @@ namespace OpenSim.Region.Framework.Scenes
return group;
}
- public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId)
+ public virtual bool returnObjects(SceneObjectGroup[] returnobjects,
+ UUID AgentId)
{
+ List localIDs = new List();
+
foreach (SceneObjectGroup grp in returnobjects)
{
- AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
- DeRezObject(null, grp.RootPart.LocalId,
- grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
+ AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition,
+ "parcel owner return");
+ localIDs.Add(grp.RootPart.LocalId);
}
+ DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return,
+ UUID.Zero);
return true;
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fe0ab5b..0cfc235 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2735,7 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabUpdate += m_sceneGraph.MoveObject;
client.OnSpinStart += m_sceneGraph.SpinStart;
client.OnSpinUpdate += m_sceneGraph.SpinObject;
- client.OnDeRezObject += DeRezObject;
+ client.OnDeRezObject += DeRezObjects;
client.OnObjectName += m_sceneGraph.PrimName;
client.OnObjectClickAction += m_sceneGraph.PrimClickAction;
@@ -2864,7 +2864,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabUpdate -= m_sceneGraph.MoveObject;
client.OnSpinStart -= m_sceneGraph.SpinStart;
client.OnSpinUpdate -= m_sceneGraph.SpinObject;
- client.OnDeRezObject -= DeRezObject;
+ client.OnDeRezObject -= DeRezObjects;
client.OnObjectName -= m_sceneGraph.PrimName;
client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5513584..f7a304f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1291,6 +1291,8 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
+ List returns = new List();
+
if (parcel != null && parcel.LandData != null &&
parcel.LandData.OtherCleanTime != 0)
{
@@ -1304,13 +1306,15 @@ namespace OpenSim.Region.Framework.Scenes
DetachFromBackup();
m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return");
- m_scene.DeRezObject(null, RootPart.LocalId,
- RootPart.GroupID, DeRezAction.Return, UUID.Zero);
+ returns.Add(RootPart.LocalId);
return;
}
}
}
+
+ m_scene.DeRezObjects(null, returns, UUID.Zero,
+ DeRezAction.Return, UUID.Zero);
}
if (HasGroupChanged)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 5616a4e..4969b09 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
- scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero);
+ scene.DeRezObjects(client, new System.Collections.Generic.List() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
--
cgit v1.1