aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs2
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs2
6 files changed, 45 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 42e3359..9ccf5a0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -196,13 +196,24 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
196 // currently calls this with multiple items. 196 // currently calls this with multiple items.
197 UUID ret = UUID.Zero; 197 UUID ret = UUID.Zero;
198 198
199 Dictionary<UUID, List<SceneObjectGroup>> deletes =
200 new Dictionary<UUID, List<SceneObjectGroup>>();
201
199 foreach (SceneObjectGroup g in objectGroups) 202 foreach (SceneObjectGroup g in objectGroups)
200 ret = DeleteToInventory(action, folderID, g, remoteClient); 203 {
204 if (!deletes.ContainsKey(g.OwnerID))
205 deletes[g.OwnerID] = new List<SceneObjectGroup>();
206
207 deletes[g.OwnerID].Add(g);
208 }
209
210 foreach (List<SceneObjectGroup> objlist in deletes.Values)
211 ret = DeleteToInventory(action, folderID, objlist, remoteClient);
201 212
202 return ret; 213 return ret;
203 } 214 }
204 215
205 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 216 private UUID DeleteToInventory(DeRezAction action, UUID folderID,
206 SceneObjectGroup objectGroup, IClientAPI remoteClient) 217 SceneObjectGroup objectGroup, IClientAPI remoteClient)
207 { 218 {
208 UUID assetID = UUID.Zero; 219 UUID assetID = UUID.Zero;
@@ -320,10 +331,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
320 } 331 }
321 else 332 else
322 { 333 {
323 // Catch all. Use lost & found 334 if (remoteClient == null ||
324 // 335 objectGroup.OwnerID != remoteClient.AgentId)
336 {
337 // Taking copy of another person's item. Take to
338 // Objects folder.
339 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
340 }
341 else
342 {
343 // Catch all. Use lost & found
344 //
325 345
326 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 346 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
347 }
327 } 348 }
328 } 349 }
329 350
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 9a33993..8b5316a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1688,37 +1688,6 @@ namespace OpenSim.Region.Framework.Scenes
1688 } 1688 }
1689 } 1689 }
1690 1690
1691 /// <summary>
1692 /// Called when one or more objects are removed from the environment into inventory.
1693 /// </summary>
1694 /// <param name="remoteClient"></param>
1695 /// <param name="localID"></param>
1696 /// <param name="groupID"></param>
1697 /// <param name="action"></param>
1698 /// <param name="destinationID"></param>
1699 public virtual void DeRezObject(IClientAPI remoteClient, List<uint> localIDs,
1700 UUID groupID, DeRezAction action, UUID destinationID)
1701 {
1702 foreach (uint localID in localIDs)
1703 {
1704 DeRezObject(remoteClient, localID, groupID, action, destinationID);
1705 }
1706 }
1707
1708 /// <summary>
1709 /// Called when an object is removed from the environment into inventory.
1710 /// </summary>
1711 /// <param name="remoteClient"></param>
1712 /// <param name="localID"></param>
1713 /// <param name="groupID"></param>
1714 /// <param name="action"></param>
1715 /// <param name="destinationID"></param>
1716 public virtual void DeRezObject(IClientAPI remoteClient, uint localID,
1717 UUID groupID, DeRezAction action, UUID destinationID)
1718 {
1719 DeRezObjects(remoteClient, new List<uint>() { localID }, groupID, action, destinationID);
1720 }
1721
1722 public virtual void DeRezObjects(IClientAPI remoteClient, List<uint> localIDs, 1691 public virtual void DeRezObjects(IClientAPI remoteClient, List<uint> localIDs,
1723 UUID groupID, DeRezAction action, UUID destinationID) 1692 UUID groupID, DeRezAction action, UUID destinationID)
1724 { 1693 {
@@ -2003,14 +1972,19 @@ namespace OpenSim.Region.Framework.Scenes
2003 return group; 1972 return group;
2004 } 1973 }
2005 1974
2006 public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) 1975 public virtual bool returnObjects(SceneObjectGroup[] returnobjects,
1976 UUID AgentId)
2007 { 1977 {
1978 List<uint> localIDs = new List<uint>();
1979
2008 foreach (SceneObjectGroup grp in returnobjects) 1980 foreach (SceneObjectGroup grp in returnobjects)
2009 { 1981 {
2010 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); 1982 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition,
2011 DeRezObject(null, grp.RootPart.LocalId, 1983 "parcel owner return");
2012 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); 1984 localIDs.Add(grp.RootPart.LocalId);
2013 } 1985 }
1986 DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return,
1987 UUID.Zero);
2014 1988
2015 return true; 1989 return true;
2016 } 1990 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e835281..bcc439c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2823,7 +2823,7 @@ namespace OpenSim.Region.Framework.Scenes
2823 client.OnGrabUpdate += m_sceneGraph.MoveObject; 2823 client.OnGrabUpdate += m_sceneGraph.MoveObject;
2824 client.OnSpinStart += m_sceneGraph.SpinStart; 2824 client.OnSpinStart += m_sceneGraph.SpinStart;
2825 client.OnSpinUpdate += m_sceneGraph.SpinObject; 2825 client.OnSpinUpdate += m_sceneGraph.SpinObject;
2826 client.OnDeRezObject += DeRezObject; 2826 client.OnDeRezObject += DeRezObjects;
2827 2827
2828 client.OnObjectName += m_sceneGraph.PrimName; 2828 client.OnObjectName += m_sceneGraph.PrimName;
2829 client.OnObjectClickAction += m_sceneGraph.PrimClickAction; 2829 client.OnObjectClickAction += m_sceneGraph.PrimClickAction;
@@ -2953,7 +2953,7 @@ namespace OpenSim.Region.Framework.Scenes
2953 client.OnGrabUpdate -= m_sceneGraph.MoveObject; 2953 client.OnGrabUpdate -= m_sceneGraph.MoveObject;
2954 client.OnSpinStart -= m_sceneGraph.SpinStart; 2954 client.OnSpinStart -= m_sceneGraph.SpinStart;
2955 client.OnSpinUpdate -= m_sceneGraph.SpinObject; 2955 client.OnSpinUpdate -= m_sceneGraph.SpinObject;
2956 client.OnDeRezObject -= DeRezObject; 2956 client.OnDeRezObject -= DeRezObjects;
2957 client.OnObjectName -= m_sceneGraph.PrimName; 2957 client.OnObjectName -= m_sceneGraph.PrimName;
2958 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction; 2958 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
2959 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; 2959 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a00a7c4..a6d89cf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1569,6 +1569,8 @@ namespace OpenSim.Region.Framework.Scenes
1569 ILandObject parcel = m_scene.LandChannel.GetLandObject( 1569 ILandObject parcel = m_scene.LandChannel.GetLandObject(
1570 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); 1570 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
1571 1571
1572 List<uint> returns = new List<uint>();
1573
1572 if (parcel != null && parcel.LandData != null && 1574 if (parcel != null && parcel.LandData != null &&
1573 parcel.LandData.OtherCleanTime != 0) 1575 parcel.LandData.OtherCleanTime != 0)
1574 { 1576 {
@@ -1582,13 +1584,15 @@ namespace OpenSim.Region.Framework.Scenes
1582 DetachFromBackup(); 1584 DetachFromBackup();
1583 m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); 1585 m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
1584 m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return"); 1586 m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return");
1585 m_scene.DeRezObject(null, RootPart.LocalId, 1587 returns.Add(RootPart.LocalId);
1586 RootPart.GroupID, DeRezAction.Return, UUID.Zero);
1587 1588
1588 return; 1589 return;
1589 } 1590 }
1590 } 1591 }
1591 } 1592 }
1593
1594 m_scene.DeRezObjects(null, returns, UUID.Zero,
1595 DeRezAction.Return, UUID.Zero);
1592 } 1596 }
1593 1597
1594 if (HasGroupChanged) 1598 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
142 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); 142 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
143 143
144 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); 144 IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId);
145 scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); 145 scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
146 146
147 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 147 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
148 148
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index fc9db03..9d7733e 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -556,7 +556,7 @@ namespace OpenSim.Tests.Common.Setup
556 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 556 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
557 sogd.Enabled = false; 557 sogd.Enabled = false;
558 558
559 scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId); 559 scene.DeRezObjects(client, new List<uint>() { part.LocalId }, UUID.Zero, action, destinationId);
560 sogd.InventoryDeQueueAndDelete(); 560 sogd.InventoryDeQueueAndDelete();
561 } 561 }
562 } 562 }