Plumb the path for multiple object deletes

This commit is contained in:
Melanie
2010-10-06 19:59:30 +02:00
parent d45276b3f6
commit abfede7819
6 changed files with 45 additions and 46 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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)

View File

@@ -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);