Plumb the path for multiple object deletes
parent
d45276b3f6
commit
abfede7819
|
@ -196,13 +196,24 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
// currently calls this with multiple items.
|
||||
UUID ret = UUID.Zero;
|
||||
|
||||
Dictionary<UUID, List<SceneObjectGroup>> deletes =
|
||||
new Dictionary<UUID, List<SceneObjectGroup>>();
|
||||
|
||||
foreach (SceneObjectGroup g in objectGroups)
|
||||
ret = DeleteToInventory(action, folderID, g, remoteClient);
|
||||
{
|
||||
if (!deletes.ContainsKey(g.OwnerID))
|
||||
deletes[g.OwnerID] = new List<SceneObjectGroup>();
|
||||
|
||||
deletes[g.OwnerID].Add(g);
|
||||
}
|
||||
|
||||
foreach (List<SceneObjectGroup> objlist in deletes.Values)
|
||||
ret = DeleteToInventory(action, folderID, objlist, remoteClient);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
|
||||
private UUID DeleteToInventory(DeRezAction action, UUID folderID,
|
||||
SceneObjectGroup objectGroup, IClientAPI remoteClient)
|
||||
{
|
||||
UUID assetID = UUID.Zero;
|
||||
|
@ -314,6 +325,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (remoteClient == null ||
|
||||
objectGroup.OwnerID != remoteClient.AgentId)
|
||||
{
|
||||
// Taking copy of another person's item. Take to
|
||||
// Objects folder.
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Catch all. Use lost & found
|
||||
//
|
||||
|
@ -321,6 +341,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Override and put into where it came from, if it came
|
||||
// from anywhere in inventory
|
||||
|
|
|
@ -1689,37 +1689,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when one or more objects are removed from the environment into inventory.
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="localID"></param>
|
||||
/// <param name="groupID"></param>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="destinationID"></param>
|
||||
public virtual void DeRezObject(IClientAPI remoteClient, List<uint> localIDs,
|
||||
UUID groupID, DeRezAction action, UUID destinationID)
|
||||
{
|
||||
foreach (uint localID in localIDs)
|
||||
{
|
||||
DeRezObject(remoteClient, localID, groupID, action, destinationID);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when an object is removed from the environment into inventory.
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="localID"></param>
|
||||
/// <param name="groupID"></param>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="destinationID"></param>
|
||||
public virtual void DeRezObject(IClientAPI remoteClient, uint localID,
|
||||
UUID groupID, DeRezAction action, UUID destinationID)
|
||||
{
|
||||
DeRezObjects(remoteClient, new List<uint>() { localID }, groupID, action, destinationID);
|
||||
}
|
||||
|
||||
public virtual void DeRezObjects(IClientAPI remoteClient, List<uint> 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<uint> localIDs = new List<uint>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1291,6 +1291,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
ILandObject parcel = m_scene.LandChannel.GetLandObject(
|
||||
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
|
||||
|
||||
List<uint> returns = new List<uint>();
|
||||
|
||||
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)
|
||||
|
|
|
@ -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<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
|
||||
|
|
|
@ -556,7 +556,7 @@ namespace OpenSim.Tests.Common.Setup
|
|||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||
sogd.Enabled = false;
|
||||
|
||||
scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId);
|
||||
scene.DeRezObjects(client, new List<uint>() { part.LocalId }, UUID.Zero, action, destinationId);
|
||||
sogd.InventoryDeQueueAndDelete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue