* Refactor: Fold sog.DeleteParts() functionality into existing sog.DeleteGroup()

0.6.0-stable
Justin Clarke Casey 2008-06-21 20:12:01 +00:00
parent b290ce405f
commit e19a76377c
2 changed files with 9 additions and 22 deletions

View File

@ -1670,7 +1670,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="group"></param>
public void DeleteSceneObject(SceneObjectGroup group)
{
SceneObjectPart rootPart = (group).GetChildPart(group.UUID);
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
if (rootPart.PhysActor != null)
{
@ -1685,7 +1685,6 @@ namespace OpenSim.Region.Environment.Scenes
}
group.DeleteGroup();
group.DeleteParts();
}
/// <summary>

View File

@ -931,12 +931,14 @@ namespace OpenSim.Region.Environment.Scenes
// code needs a redesign.
m_isDeleted = true;
DetachFromBackup(this);
DetachFromBackup(this);
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.StopScripts();
List<ScenePresence> avatars = Scene.GetScenePresences();
for (int i = 0; i < avatars.Count; i++)
{
@ -948,6 +950,9 @@ namespace OpenSim.Region.Environment.Scenes
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
}
m_rootPart = null;
m_parts.Clear();
}
}
@ -968,23 +973,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
/// Delete all the parts in this group.
/// </summary>
public void DeleteParts()
{
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.StopScripts();
}
m_rootPart = null;
m_parts.Clear();
}
}
public void AddScriptLPS(int count)
{
if (scriptScore + count >= float.MaxValue - count)
@ -1793,11 +1781,11 @@ namespace OpenSim.Region.Environment.Scenes
m_scene.UnlinkSceneObject(objectGroup.UUID, true);
// TODO Deleting the parts may cause problems later on if they have already
// TODO Deleting the original group object may cause problems later on if they have already
// made it into the update queue. However, sending out updates for those parts is now
// spurious, so it would be good not to send them at some point.
// The traffic caused is always going to be pretty minor, so it's not high priority
//objectGroup.DeleteParts();
//objectGroup.DeleteGroup();
ScheduleGroupForFullUpdate();
}