* On deselection of objects, stop every object id passed triggering an update for the entire group

* This was not a problem with objects consisting of less than 30 prims, since the extra schedules would be ignored
* However, above approximately 30 prims extra schedules would actually occur.
* For instance, a 140 prim object would end up triggering approximately 2500 ObjectUpdates to every avatar in range rather than 140
* Hopefully, this change will improve client responsiveness on deselect and was one of the reasons that the AgentThrottle restriction started causing problems yesterday.
0.6.0-stable
Justin Clarke Casey 2008-10-08 17:36:17 +00:00
parent ac443559d1
commit 1b7405dca1
1 changed files with 20 additions and 27 deletions

View File

@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes
}
/// <summary>
///
/// Handle the deselection of a prim from the client.
/// </summary>
/// <param name="primLocalID"></param>
/// <param name="remoteClient"></param>
@ -150,36 +150,29 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart part = GetSceneObjectPart(primLocalID);
if (part == null)
return;
// The prim is in the process of being deleted.
if (null == part.ParentGroup.RootPart)
return;
// A deselect packet contains all the local prims being deselected. However, since selection is still
// group based we only want the root prim to trigger a full update - otherwise on objects with many prims
// we end up sending many duplicate ObjectUpdates
if (part.ParentGroup.RootPart.LocalId != part.LocalId)
return;
bool isAttachment = false;
// If the parent group is null, we are in an inconsistent state
// try to recover gracefully by doing all that can be done on
// a lone prim
// This is wrong, wrong, wrong. Selection should not be
// handled by group, but by prim. Legacy cruft.
// TODO: Make selection flagging per prim!
//
if (part.ParentGroup == null)
{
if (part.IsAttachment)
isAttachment = true;
else
part.ScheduleFullUpdate();
}
part.ParentGroup.IsSelected = false;
if (part.ParentGroup.RootPart.IsAttachment)
isAttachment = true;
else
{
part.ParentGroup.IsSelected = false;
// This is wrong, wrong, wrong. Selection should not be
// handled by group, but by prim. Legacy cruft.
// TODO: Make selection flagging per prim!
//
if (part.ParentGroup.RootPart != null)
{
if (part.ParentGroup.RootPart.IsAttachment)
isAttachment = true;
else
part.ParentGroup.ScheduleGroupForFullUpdate();
}
}
part.ParentGroup.ScheduleGroupForFullUpdate();
// If it's not an attachment, and we are allowed to move it,
// then we might have done so. If we moved across a parcel