From 1b7405dca1080505fda532070e5a05420fdbb91d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 8 Oct 2008 17:36:17 +0000 Subject: * 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. --- .../Environment/Scenes/Scene.PacketHandlers.cs | 47 +++++++++------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 38f4029..b60efdc 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// + /// Handle the deselection of a prim from the client. /// /// /// @@ -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 -- cgit v1.1