diff options
author | Justin Clarke Casey | 2008-10-08 17:36:17 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-08 17:36:17 +0000 |
commit | 1b7405dca1080505fda532070e5a05420fdbb91d (patch) | |
tree | 0660b2c6bee678992a876ced73a8f290127057aa /OpenSim/Region/Environment | |
parent | Mantis#2354. Thank you kindly, Tglion for a patch that: (diff) | |
download | opensim-SC-1b7405dca1080505fda532070e5a05420fdbb91d.zip opensim-SC-1b7405dca1080505fda532070e5a05420fdbb91d.tar.gz opensim-SC-1b7405dca1080505fda532070e5a05420fdbb91d.tar.bz2 opensim-SC-1b7405dca1080505fda532070e5a05420fdbb91d.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 47 |
1 files 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 | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /// <summary> | 143 | /// <summary> |
144 | /// | 144 | /// Handle the deselection of a prim from the client. |
145 | /// </summary> | 145 | /// </summary> |
146 | /// <param name="primLocalID"></param> | 146 | /// <param name="primLocalID"></param> |
147 | /// <param name="remoteClient"></param> | 147 | /// <param name="remoteClient"></param> |
@@ -150,36 +150,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
150 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 150 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
151 | if (part == null) | 151 | if (part == null) |
152 | return; | 152 | return; |
153 | |||
154 | // The prim is in the process of being deleted. | ||
155 | if (null == part.ParentGroup.RootPart) | ||
156 | return; | ||
157 | |||
158 | // A deselect packet contains all the local prims being deselected. However, since selection is still | ||
159 | // group based we only want the root prim to trigger a full update - otherwise on objects with many prims | ||
160 | // we end up sending many duplicate ObjectUpdates | ||
161 | if (part.ParentGroup.RootPart.LocalId != part.LocalId) | ||
162 | return; | ||
153 | 163 | ||
154 | bool isAttachment = false; | 164 | bool isAttachment = false; |
155 | 165 | ||
156 | // If the parent group is null, we are in an inconsistent state | 166 | // This is wrong, wrong, wrong. Selection should not be |
157 | // try to recover gracefully by doing all that can be done on | 167 | // handled by group, but by prim. Legacy cruft. |
158 | // a lone prim | 168 | // TODO: Make selection flagging per prim! |
159 | // | 169 | // |
160 | if (part.ParentGroup == null) | 170 | part.ParentGroup.IsSelected = false; |
161 | { | 171 | |
162 | if (part.IsAttachment) | 172 | if (part.ParentGroup.RootPart.IsAttachment) |
163 | isAttachment = true; | 173 | isAttachment = true; |
164 | else | ||
165 | part.ScheduleFullUpdate(); | ||
166 | } | ||
167 | else | 174 | else |
168 | { | 175 | part.ParentGroup.ScheduleGroupForFullUpdate(); |
169 | part.ParentGroup.IsSelected = false; | ||
170 | |||
171 | // This is wrong, wrong, wrong. Selection should not be | ||
172 | // handled by group, but by prim. Legacy cruft. | ||
173 | // TODO: Make selection flagging per prim! | ||
174 | // | ||
175 | if (part.ParentGroup.RootPart != null) | ||
176 | { | ||
177 | if (part.ParentGroup.RootPart.IsAttachment) | ||
178 | isAttachment = true; | ||
179 | else | ||
180 | part.ParentGroup.ScheduleGroupForFullUpdate(); | ||
181 | } | ||
182 | } | ||
183 | 176 | ||
184 | // If it's not an attachment, and we are allowed to move it, | 177 | // If it's not an attachment, and we are allowed to move it, |
185 | // then we might have done so. If we moved across a parcel | 178 | // then we might have done so. If we moved across a parcel |