Eliminate gretuitious KillObject packets. KillObject is sent to the
viewer for the root part only.
Also prevents the full update on deselect that makes a deleted object
reappear and stay visible until the background deleter got around to it.
We still send 2 KillObject packets for the root prim, that could be 
avoided only at a cost in reliability. One packet seems an acceptable
price to pay for consistency.
0.6.0-stable
Melanie Thielker 2008-09-03 19:28:46 +00:00
parent ef27c8817f
commit eee9c114cb
2 changed files with 26 additions and 2 deletions

View File

@ -2496,6 +2496,15 @@ namespace OpenSim.Region.Environment.Scenes
public void SendKillObject(uint localID)
{
SceneObjectPart part = GetSceneObjectPart(localID);
if (part != null) // It is a prim
{
if (part.ParentGroup != null && part.ParentGroup.RootPart != null) // Valid
{
if (part.ParentGroup.RootPart != part) // Child part
return;
}
}
Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
}

View File

@ -105,6 +105,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>();
private bool m_deleted = false;
protected ulong m_regionHandle;
protected SceneObjectPart m_rootPart;
// private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
@ -948,7 +949,8 @@ namespace OpenSim.Region.Environment.Scenes
avatars[i].StandUp();
}
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
if (m_rootPart != null && part == m_rootPart)
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
}
@ -959,6 +961,8 @@ namespace OpenSim.Region.Environment.Scenes
public void FakeDeleteGroup()
{
m_deleted = true;
foreach (SceneObjectPart part in m_parts.Values)
{
List<ScenePresence> avatars = Scene.GetScenePresences();
@ -969,7 +973,8 @@ namespace OpenSim.Region.Environment.Scenes
avatars[i].StandUp();
}
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
if (m_rootPart != null && part == m_rootPart)
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
}
}
@ -1543,6 +1548,16 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void ScheduleGroupForFullUpdate()
{
// If we wre in the delete queue, this will be set
// A full update now would make the prim reappear
// after KillObject was sent via FakeDeleteGroup
// causing flickering and delays in deletion.
// This leads to users clicking delete multiple times
// which can crash the session. So, avoid it.
//
if (m_deleted)
return;
checkAtTargets();
lock (m_parts)
{