aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-17 22:38:52 +0000
committerMelanie Thielker2008-08-17 22:38:52 +0000
commit35dde94f01ae8af6fbac4b48445c672a866b846b (patch)
tree3a2dd05ee325b1eb1678ad4bfb49c2d0ec193b0a /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parentMantis#1974. Thank you BlueWall for a patch that: (diff)
downloadopensim-SC-35dde94f01ae8af6fbac4b48445c672a866b846b.zip
opensim-SC-35dde94f01ae8af6fbac4b48445c672a866b846b.tar.gz
opensim-SC-35dde94f01ae8af6fbac4b48445c672a866b846b.tar.bz2
opensim-SC-35dde94f01ae8af6fbac4b48445c672a866b846b.tar.xz
Change the deselect processing to prevent gratuituous full update
when an attachment is deselected.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs56
1 files changed, 42 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index db05430..bdfe664 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -147,25 +147,53 @@ namespace OpenSim.Region.Environment.Scenes
147 /// <param name="remoteClient"></param> 147 /// <param name="remoteClient"></param>
148 public void DeselectPrim(uint primLocalID, IClientAPI remoteClient) 148 public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
149 { 149 {
150 List<EntityBase> EntityList = GetEntities(); 150 SceneObjectPart part = GetSceneObjectPart(primLocalID);
151 if(part == null)
152 return;
151 153
152 foreach (EntityBase ent in EntityList) 154 bool isAttachment = false;
155
156 // If the parent group is null, we are in an inconsistent state
157 // try to recover gracefully by doing all that can be done on
158 // a lone prim
159 //
160 if (part.ParentGroup == null)
153 { 161 {
154 if (ent is SceneObjectGroup) 162 if(part.IsAttachment)
163 isAttachment = true;
164 else
165 part.ScheduleFullUpdate();
166 }
167 else
168 {
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)
155 { 176 {
156 if (((SceneObjectGroup) ent).LocalId == primLocalID) 177 if (part.ParentGroup.RootPart.IsAttachment)
157 { 178 isAttachment = true;
158 ((SceneObjectGroup) ent).IsSelected = false; 179 else
159 ((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(); 180 part.ParentGroup.ScheduleGroupForFullUpdate();
160 if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
161 || ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
162 {
163 EventManager.TriggerParcelPrimCountTainted();
164 break;
165 }
166 }
167 } 181 }
168 } 182 }
183
184 // 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
186 // boundary, we will need to recount prims on the parcels.
187 // For attachments, that makes no sense.
188 //
189 if (!isAttachment)
190 {
191 if (ExternalChecks.ExternalChecksCanEditObject(
192 part.UUID, remoteClient.AgentId)
193 || ExternalChecks.ExternalChecksCanMoveObject(
194 part.UUID, remoteClient.AgentId))
195 EventManager.TriggerParcelPrimCountTainted();
196 }
169 } 197 }
170 198
171 public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, 199 public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount,