diff options
author | Diva Canto | 2011-12-20 09:53:05 -0800 |
---|---|---|
committer | Diva Canto | 2011-12-20 09:53:05 -0800 |
commit | dd69c9fd202e7cd7a52f08ab40939348a0b86ef7 (patch) | |
tree | ecaf1a5e5628cc4ded2d281cd47af78c9e5033f4 /OpenSim/Region/Framework | |
parent | Fixed bug of avie going under the terrain when crossing regions in certain di... (diff) | |
parent | Move HandleObjectGroupUpdate() from GroupsModule to Scene.PacketHandlers.cs a... (diff) | |
download | opensim-SC-dd69c9fd202e7cd7a52f08ab40939348a0b86ef7.zip opensim-SC-dd69c9fd202e7cd7a52f08ab40939348a0b86ef7.tar.gz opensim-SC-dd69c9fd202e7cd7a52f08ab40939348a0b86ef7.tar.bz2 opensim-SC-dd69c9fd202e7cd7a52f08ab40939348a0b86ef7.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 246 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 13 |
8 files changed, 163 insertions, 194 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs index 26bc922..8670229 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs | |||
@@ -31,9 +31,10 @@ using OpenSim.Framework; | |||
31 | 31 | ||
32 | namespace OpenSim.Region.Framework.Interfaces | 32 | namespace OpenSim.Region.Framework.Interfaces |
33 | { | 33 | { |
34 | public delegate void ReportOutputAction(string format, params object[] args); | ||
35 | |||
34 | public interface IAvatarFactoryModule | 36 | public interface IAvatarFactoryModule |
35 | { | 37 | { |
36 | |||
37 | void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); | 38 | void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); |
38 | 39 | ||
39 | /// <summary> | 40 | /// <summary> |
@@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces | |||
63 | bool ValidateBakedTextureCache(IScenePresence sp); | 64 | bool ValidateBakedTextureCache(IScenePresence sp); |
64 | void QueueAppearanceSend(UUID agentid); | 65 | void QueueAppearanceSend(UUID agentid); |
65 | void QueueAppearanceSave(UUID agentid); | 66 | void QueueAppearanceSave(UUID agentid); |
67 | |||
68 | /// <summary> | ||
69 | /// Get a report about the current state of a scene presence's baked appearance textures. | ||
70 | /// </summary> | ||
71 | /// <param name="sp"></param> | ||
72 | /// <param name="reportOutputAction"></param> | ||
73 | /// <returns></returns> | ||
74 | void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction); | ||
66 | } | 75 | } |
67 | } \ No newline at end of file | 76 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 4a4d98f..4f71915 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -1564,6 +1564,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1564 | 1564 | ||
1565 | public void TriggerRequestChangeWaterHeight(float height) | 1565 | public void TriggerRequestChangeWaterHeight(float height) |
1566 | { | 1566 | { |
1567 | if (height < 0) | ||
1568 | { | ||
1569 | // ignore negative water height | ||
1570 | return; | ||
1571 | } | ||
1572 | |||
1567 | RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; | 1573 | RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; |
1568 | if (handlerRequestChangeWaterHeight != null) | 1574 | if (handlerRequestChangeWaterHeight != null) |
1569 | { | 1575 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 6ba74c7..3355ebe 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -116,66 +116,78 @@ namespace OpenSim.Region.Framework.Scenes | |||
116 | /// <param name="remoteClient"></param> | 116 | /// <param name="remoteClient"></param> |
117 | public void RequestPrim(uint primLocalID, IClientAPI remoteClient) | 117 | public void RequestPrim(uint primLocalID, IClientAPI remoteClient) |
118 | { | 118 | { |
119 | EntityBase[] entityList = GetEntities(); | 119 | SceneObjectGroup sog = GetGroupByPrim(primLocalID); |
120 | foreach (EntityBase ent in entityList) | 120 | |
121 | if (sog != null) | ||
122 | sog.SendFullUpdateToClient(remoteClient); | ||
123 | } | ||
124 | |||
125 | /// <summary> | ||
126 | /// Invoked when the client selects a prim. | ||
127 | /// </summary> | ||
128 | /// <param name="primLocalID"></param> | ||
129 | /// <param name="remoteClient"></param> | ||
130 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) | ||
131 | { | ||
132 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | ||
133 | |||
134 | if (null == part) | ||
135 | return; | ||
136 | |||
137 | if (part.IsRoot) | ||
121 | { | 138 | { |
122 | if (ent is SceneObjectGroup) | 139 | SceneObjectGroup sog = part.ParentGroup; |
140 | sog.SendPropertiesToClient(remoteClient); | ||
141 | sog.IsSelected = true; | ||
142 | |||
143 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | ||
144 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) | ||
145 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) | ||
123 | { | 146 | { |
124 | if (((SceneObjectGroup)ent).LocalId == primLocalID) | 147 | EventManager.TriggerParcelPrimCountTainted(); |
125 | { | ||
126 | ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); | ||
127 | return; | ||
128 | } | ||
129 | } | 148 | } |
130 | } | 149 | } |
150 | else | ||
151 | { | ||
152 | part.SendPropertiesToClient(remoteClient); | ||
153 | } | ||
131 | } | 154 | } |
132 | 155 | ||
133 | /// <summary> | 156 | /// <summary> |
134 | /// Invoked when the client selects a prim. | 157 | /// Handle the update of an object's user group. |
135 | /// </summary> | 158 | /// </summary> |
136 | /// <param name="primLocalID"></param> | ||
137 | /// <param name="remoteClient"></param> | 159 | /// <param name="remoteClient"></param> |
138 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) | 160 | /// <param name="groupID"></param> |
161 | /// <param name="objectLocalID"></param> | ||
162 | /// <param name="Garbage"></param> | ||
163 | private void HandleObjectGroupUpdate( | ||
164 | IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage) | ||
139 | { | 165 | { |
140 | EntityBase[] entityList = GetEntities(); | 166 | if (m_groupsModule == null) |
141 | foreach (EntityBase ent in entityList) | 167 | return; |
168 | |||
169 | // XXX: Might be better to get rid of this special casing and have GetMembershipData return something | ||
170 | // reasonable for a UUID.Zero group. | ||
171 | if (groupID != UUID.Zero) | ||
142 | { | 172 | { |
143 | if (ent is SceneObjectGroup) | 173 | GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId); |
174 | |||
175 | if (gmd == null) | ||
144 | { | 176 | { |
145 | if (((SceneObjectGroup) ent).LocalId == primLocalID) | 177 | // m_log.WarnFormat( |
146 | { | 178 | // "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group", |
147 | ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient); | 179 | // remoteClient.Name, GroupID, objectLocalID); |
148 | ((SceneObjectGroup) ent).IsSelected = true; | 180 | |
149 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 181 | return; |
150 | if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) | 182 | } |
151 | || Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)) | 183 | } |
152 | { | 184 | |
153 | EventManager.TriggerParcelPrimCountTainted(); | 185 | SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID); |
154 | } | 186 | if (so != null) |
155 | break; | 187 | { |
156 | } | 188 | if (so.OwnerID == remoteClient.AgentId) |
157 | else | 189 | { |
158 | { | 190 | so.SetGroup(groupID, remoteClient); |
159 | // We also need to check the children of this prim as they | ||
160 | // can be selected as well and send property information | ||
161 | bool foundPrim = false; | ||
162 | |||
163 | SceneObjectGroup sog = ent as SceneObjectGroup; | ||
164 | |||
165 | SceneObjectPart[] partList = sog.Parts; | ||
166 | foreach (SceneObjectPart part in partList) | ||
167 | { | ||
168 | if (part.LocalId == primLocalID) | ||
169 | { | ||
170 | part.SendPropertiesToClient(remoteClient); | ||
171 | foundPrim = true; | ||
172 | break; | ||
173 | } | ||
174 | } | ||
175 | |||
176 | if (foundPrim) | ||
177 | break; | ||
178 | } | ||
179 | } | 191 | } |
180 | } | 192 | } |
181 | } | 193 | } |
@@ -250,121 +262,81 @@ namespace OpenSim.Region.Framework.Scenes | |||
250 | 262 | ||
251 | public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) | 263 | public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) |
252 | { | 264 | { |
253 | EntityBase[] EntityList = GetEntities(); | 265 | SceneObjectPart part = GetSceneObjectPart(localID); |
266 | |||
267 | if (part == null) | ||
268 | return; | ||
269 | |||
270 | SceneObjectGroup obj = part.ParentGroup; | ||
254 | 271 | ||
255 | SurfaceTouchEventArgs surfaceArg = null; | 272 | SurfaceTouchEventArgs surfaceArg = null; |
256 | if (surfaceArgs != null && surfaceArgs.Count > 0) | 273 | if (surfaceArgs != null && surfaceArgs.Count > 0) |
257 | surfaceArg = surfaceArgs[0]; | 274 | surfaceArg = surfaceArgs[0]; |
258 | 275 | ||
259 | foreach (EntityBase ent in EntityList) | 276 | // Currently only grab/touch for the single prim |
277 | // the client handles rez correctly | ||
278 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | ||
279 | |||
280 | // If the touched prim handles touches, deliver it | ||
281 | // If not, deliver to root prim | ||
282 | if ((part.ScriptEvents & scriptEvents.touch_start) != 0) | ||
283 | EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | ||
284 | |||
285 | // Deliver to the root prim if the touched prim doesn't handle touches | ||
286 | // or if we're meant to pass on touches anyway. Don't send to root prim | ||
287 | // if prim touched is the root prim as we just did it | ||
288 | if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || | ||
289 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) | ||
260 | { | 290 | { |
261 | if (ent is SceneObjectGroup) | 291 | EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); |
262 | { | ||
263 | SceneObjectGroup obj = ent as SceneObjectGroup; | ||
264 | if (obj != null) | ||
265 | { | ||
266 | // Is this prim part of the group | ||
267 | if (obj.HasChildPrim(localID)) | ||
268 | { | ||
269 | // Currently only grab/touch for the single prim | ||
270 | // the client handles rez correctly | ||
271 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | ||
272 | |||
273 | SceneObjectPart part = obj.GetChildPart(localID); | ||
274 | |||
275 | // If the touched prim handles touches, deliver it | ||
276 | // If not, deliver to root prim | ||
277 | if ((part.ScriptEvents & scriptEvents.touch_start) != 0) | ||
278 | EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | ||
279 | // Deliver to the root prim if the touched prim doesn't handle touches | ||
280 | // or if we're meant to pass on touches anyway. Don't send to root prim | ||
281 | // if prim touched is the root prim as we just did it | ||
282 | if (((part.ScriptEvents & scriptEvents.touch_start) == 0) || | ||
283 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) | ||
284 | { | ||
285 | EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); | ||
286 | } | ||
287 | |||
288 | return; | ||
289 | } | ||
290 | } | ||
291 | } | ||
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
295 | public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) | 295 | public virtual void ProcessObjectGrabUpdate( |
296 | UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) | ||
296 | { | 297 | { |
297 | EntityBase[] EntityList = GetEntities(); | 298 | SceneObjectPart part = GetSceneObjectPart(objectID); |
299 | if (part == null) | ||
300 | return; | ||
301 | |||
302 | SceneObjectGroup obj = part.ParentGroup; | ||
298 | 303 | ||
299 | SurfaceTouchEventArgs surfaceArg = null; | 304 | SurfaceTouchEventArgs surfaceArg = null; |
300 | if (surfaceArgs != null && surfaceArgs.Count > 0) | 305 | if (surfaceArgs != null && surfaceArgs.Count > 0) |
301 | surfaceArg = surfaceArgs[0]; | 306 | surfaceArg = surfaceArgs[0]; |
302 | 307 | ||
303 | foreach (EntityBase ent in EntityList) | 308 | // If the touched prim handles touches, deliver it |
309 | // If not, deliver to root prim | ||
310 | if ((part.ScriptEvents & scriptEvents.touch) != 0) | ||
311 | EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | ||
312 | // Deliver to the root prim if the touched prim doesn't handle touches | ||
313 | // or if we're meant to pass on touches anyway. Don't send to root prim | ||
314 | // if prim touched is the root prim as we just did it | ||
315 | if (((part.ScriptEvents & scriptEvents.touch) == 0) || | ||
316 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) | ||
304 | { | 317 | { |
305 | if (ent is SceneObjectGroup) | 318 | EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); |
306 | { | ||
307 | SceneObjectGroup obj = ent as SceneObjectGroup; | ||
308 | if (obj != null) | ||
309 | { | ||
310 | // Is this prim part of the group | ||
311 | if (obj.HasChildPrim(objectID)) | ||
312 | { | ||
313 | SceneObjectPart part = obj.GetChildPart(objectID); | ||
314 | |||
315 | // If the touched prim handles touches, deliver it | ||
316 | // If not, deliver to root prim | ||
317 | if ((part.ScriptEvents & scriptEvents.touch) != 0) | ||
318 | EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); | ||
319 | // Deliver to the root prim if the touched prim doesn't handle touches | ||
320 | // or if we're meant to pass on touches anyway. Don't send to root prim | ||
321 | // if prim touched is the root prim as we just did it | ||
322 | if (((part.ScriptEvents & scriptEvents.touch) == 0) || | ||
323 | (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) | ||
324 | { | ||
325 | EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); | ||
326 | } | ||
327 | |||
328 | return; | ||
329 | } | ||
330 | } | ||
331 | } | ||
332 | } | 319 | } |
333 | } | 320 | } |
334 | 321 | ||
335 | public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) | 322 | public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) |
336 | { | 323 | { |
337 | EntityBase[] EntityList = GetEntities(); | 324 | SceneObjectPart part = GetSceneObjectPart(localID); |
325 | if (part == null) | ||
326 | return; | ||
327 | |||
328 | SceneObjectGroup obj = part.ParentGroup; | ||
338 | 329 | ||
339 | SurfaceTouchEventArgs surfaceArg = null; | 330 | SurfaceTouchEventArgs surfaceArg = null; |
340 | if (surfaceArgs != null && surfaceArgs.Count > 0) | 331 | if (surfaceArgs != null && surfaceArgs.Count > 0) |
341 | surfaceArg = surfaceArgs[0]; | 332 | surfaceArg = surfaceArgs[0]; |
342 | 333 | ||
343 | foreach (EntityBase ent in EntityList) | 334 | // If the touched prim handles touches, deliver it |
344 | { | 335 | // If not, deliver to root prim |
345 | if (ent is SceneObjectGroup) | 336 | if ((part.ScriptEvents & scriptEvents.touch_end) != 0) |
346 | { | 337 | EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); |
347 | SceneObjectGroup obj = ent as SceneObjectGroup; | 338 | else |
348 | 339 | EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); | |
349 | // Is this prim part of the group | ||
350 | if (obj.HasChildPrim(localID)) | ||
351 | { | ||
352 | SceneObjectPart part=obj.GetChildPart(localID); | ||
353 | if (part != null) | ||
354 | { | ||
355 | // If the touched prim handles touches, deliver it | ||
356 | // If not, deliver to root prim | ||
357 | if ((part.ScriptEvents & scriptEvents.touch_end) != 0) | ||
358 | EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); | ||
359 | else | ||
360 | EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); | ||
361 | |||
362 | return; | ||
363 | } | ||
364 | return; | ||
365 | } | ||
366 | } | ||
367 | } | ||
368 | } | 340 | } |
369 | 341 | ||
370 | public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) | 342 | public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b43b227..6666328 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | protected IDialogModule m_dialogModule; | 139 | protected IDialogModule m_dialogModule; |
140 | protected IEntityTransferModule m_teleportModule; | 140 | protected IEntityTransferModule m_teleportModule; |
141 | protected ICapabilitiesModule m_capsModule; | 141 | protected ICapabilitiesModule m_capsModule; |
142 | protected IGroupsModule m_groupsModule; | ||
142 | 143 | ||
143 | /// <summary> | 144 | /// <summary> |
144 | /// Current scene frame number | 145 | /// Current scene frame number |
@@ -1164,6 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1164 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 1165 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
1165 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); | 1166 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); |
1166 | m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); | 1167 | m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); |
1168 | m_groupsModule = RequestModuleInterface<IGroupsModule>(); | ||
1167 | } | 1169 | } |
1168 | 1170 | ||
1169 | #endregion | 1171 | #endregion |
@@ -2733,6 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2733 | client.OnObjectDescription += m_sceneGraph.PrimDescription; | 2735 | client.OnObjectDescription += m_sceneGraph.PrimDescription; |
2734 | client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; | 2736 | client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; |
2735 | client.OnObjectOwner += ObjectOwner; | 2737 | client.OnObjectOwner += ObjectOwner; |
2738 | client.OnObjectGroupRequest += HandleObjectGroupUpdate; | ||
2736 | } | 2739 | } |
2737 | 2740 | ||
2738 | public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) | 2741 | public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) |
@@ -2776,7 +2779,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2776 | 2779 | ||
2777 | public virtual void SubscribeToClientParcelEvents(IClientAPI client) | 2780 | public virtual void SubscribeToClientParcelEvents(IClientAPI client) |
2778 | { | 2781 | { |
2779 | client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate; | ||
2780 | client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; | 2782 | client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; |
2781 | client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; | 2783 | client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; |
2782 | client.OnParcelBuy += ProcessParcelBuy; | 2784 | client.OnParcelBuy += ProcessParcelBuy; |
@@ -2903,7 +2905,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2903 | 2905 | ||
2904 | public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) | 2906 | public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) |
2905 | { | 2907 | { |
2906 | client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate; | ||
2907 | client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; | 2908 | client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; |
2908 | client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; | 2909 | client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; |
2909 | client.OnParcelBuy -= ProcessParcelBuy; | 2910 | client.OnParcelBuy -= ProcessParcelBuy; |
@@ -3522,15 +3523,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3522 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); | 3523 | m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); |
3523 | } | 3524 | } |
3524 | 3525 | ||
3525 | IGroupsModule groupsModule = | ||
3526 | RequestModuleInterface<IGroupsModule>(); | ||
3527 | |||
3528 | List<UUID> agentGroups = new List<UUID>(); | 3526 | List<UUID> agentGroups = new List<UUID>(); |
3529 | 3527 | ||
3530 | if (groupsModule != null) | 3528 | if (m_groupsModule != null) |
3531 | { | 3529 | { |
3532 | GroupMembershipData[] GroupMembership = | 3530 | GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); |
3533 | groupsModule.GetMembershipData(agent.AgentID); | ||
3534 | 3531 | ||
3535 | if (GroupMembership != null) | 3532 | if (GroupMembership != null) |
3536 | { | 3533 | { |
@@ -4287,7 +4284,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4287 | /// Get a scene object group that contains the prim with the given local id | 4284 | /// Get a scene object group that contains the prim with the given local id |
4288 | /// </summary> | 4285 | /// </summary> |
4289 | /// <param name="localID"></param> | 4286 | /// <param name="localID"></param> |
4290 | /// <returns>null if no scene object group containing that prim is found</returns> | 4287 | /// <returns>null if no scene object group containing that prim is found</returns> |
4291 | public SceneObjectGroup GetGroupByPrim(uint localID) | 4288 | public SceneObjectGroup GetGroupByPrim(uint localID) |
4292 | { | 4289 | { |
4293 | return m_sceneGraph.GetGroupByPrim(localID); | 4290 | return m_sceneGraph.GetGroupByPrim(localID); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index af95c28..a3e4b46 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -575,20 +575,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
575 | } | 575 | } |
576 | } | 576 | } |
577 | 577 | ||
578 | protected internal void HandleObjectGroupUpdate( | ||
579 | IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) | ||
580 | { | ||
581 | if (!remoteClient.IsGroupMember(GroupID)) | ||
582 | return; | ||
583 | |||
584 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); | ||
585 | if (group != null) | ||
586 | { | ||
587 | if (group.OwnerID == remoteClient.AgentId) | ||
588 | group.SetGroup(GroupID, remoteClient); | ||
589 | } | ||
590 | } | ||
591 | |||
592 | protected internal ScenePresence CreateAndAddChildScenePresence( | 578 | protected internal ScenePresence CreateAndAddChildScenePresence( |
593 | IClientAPI client, AvatarAppearance appearance, PresenceType type) | 579 | IClientAPI client, AvatarAppearance appearance, PresenceType type) |
594 | { | 580 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f9e0b83..abea788 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1373,19 +1373,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
1373 | 1373 | ||
1374 | #endregion | 1374 | #endregion |
1375 | 1375 | ||
1376 | // Send the parts of this SOG to a single client | 1376 | /// <summary> |
1377 | // Used when the client initially connects and when client sends RequestPrim packet | 1377 | /// Send the parts of this SOG to a single client |
1378 | /// </summary> | ||
1379 | /// <remarks> | ||
1380 | /// Used when the client initially connects and when client sends RequestPrim packet | ||
1381 | /// </remarks> | ||
1382 | /// <param name="remoteClient"></param> | ||
1378 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 1383 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
1379 | { | 1384 | { |
1380 | RootPart.SendFullUpdate( | 1385 | RootPart.SendFullUpdate(remoteClient); |
1381 | remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); | ||
1382 | 1386 | ||
1383 | SceneObjectPart[] parts = m_parts.GetArray(); | 1387 | SceneObjectPart[] parts = m_parts.GetArray(); |
1384 | for (int i = 0; i < parts.Length; i++) | 1388 | for (int i = 0; i < parts.Length; i++) |
1385 | { | 1389 | { |
1386 | SceneObjectPart part = parts[i]; | 1390 | SceneObjectPart part = parts[i]; |
1387 | if (part != RootPart) | 1391 | if (part != RootPart) |
1388 | part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); | 1392 | part.SendFullUpdate(remoteClient); |
1389 | } | 1393 | } |
1390 | } | 1394 | } |
1391 | 1395 | ||
@@ -1679,10 +1683,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1679 | 1683 | ||
1680 | /// <summary> | 1684 | /// <summary> |
1681 | /// Reset the UUIDs for all the prims that make up this group. | 1685 | /// Reset the UUIDs for all the prims that make up this group. |
1682 | /// | 1686 | /// </summary> |
1687 | /// <remarks> | ||
1683 | /// This is called by methods which want to add a new group to an existing scene, in order | 1688 | /// This is called by methods which want to add a new group to an existing scene, in order |
1684 | /// to ensure that there are no clashes with groups already present. | 1689 | /// to ensure that there are no clashes with groups already present. |
1685 | /// </summary> | 1690 | /// </remarks> |
1686 | public void ResetIDs() | 1691 | public void ResetIDs() |
1687 | { | 1692 | { |
1688 | lock (m_parts.SyncRoot) | 1693 | lock (m_parts.SyncRoot) |
@@ -3206,6 +3211,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3206 | part.Inventory.ChangeInventoryGroup(GroupID); | 3211 | part.Inventory.ChangeInventoryGroup(GroupID); |
3207 | } | 3212 | } |
3208 | 3213 | ||
3214 | HasGroupChanged = true; | ||
3215 | |||
3209 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled | 3216 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled |
3210 | // for the same object with very different properties. The caller must schedule the update. | 3217 | // for the same object with very different properties. The caller must schedule the update. |
3211 | //ScheduleGroupForFullUpdate(); | 3218 | //ScheduleGroupForFullUpdate(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f5a00d7..b29ecc6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2836,8 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2836 | /// Send a full update to the client for the given part | 2836 | /// Send a full update to the client for the given part |
2837 | /// </summary> | 2837 | /// </summary> |
2838 | /// <param name="remoteClient"></param> | 2838 | /// <param name="remoteClient"></param> |
2839 | /// <param name="clientFlags"></param> | 2839 | protected internal void SendFullUpdate(IClientAPI remoteClient) |
2840 | protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) | ||
2841 | { | 2840 | { |
2842 | if (ParentGroup == null) | 2841 | if (ParentGroup == null) |
2843 | return; | 2842 | return; |
@@ -2849,16 +2848,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2849 | { | 2848 | { |
2850 | if (ParentGroup.IsAttachment) | 2849 | if (ParentGroup.IsAttachment) |
2851 | { | 2850 | { |
2852 | SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); | 2851 | SendFullUpdateToClient(remoteClient, AttachedPos); |
2853 | } | 2852 | } |
2854 | else | 2853 | else |
2855 | { | 2854 | { |
2856 | SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); | 2855 | SendFullUpdateToClient(remoteClient, AbsolutePosition); |
2857 | } | 2856 | } |
2858 | } | 2857 | } |
2859 | else | 2858 | else |
2860 | { | 2859 | { |
2861 | SendFullUpdateToClient(remoteClient, clientFlags); | 2860 | SendFullUpdateToClient(remoteClient); |
2862 | } | 2861 | } |
2863 | } | 2862 | } |
2864 | 2863 | ||
@@ -2872,7 +2871,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2872 | 2871 | ||
2873 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 2872 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2874 | { | 2873 | { |
2875 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); | 2874 | SendFullUpdate(avatar.ControllingClient); |
2876 | }); | 2875 | }); |
2877 | } | 2876 | } |
2878 | 2877 | ||
@@ -2880,12 +2879,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2880 | /// Sends a full update to the client | 2879 | /// Sends a full update to the client |
2881 | /// </summary> | 2880 | /// </summary> |
2882 | /// <param name="remoteClient"></param> | 2881 | /// <param name="remoteClient"></param> |
2883 | /// <param name="clientFlags"></param> | 2882 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
2884 | public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags) | ||
2885 | { | 2883 | { |
2886 | Vector3 lPos; | 2884 | SendFullUpdateToClient(remoteClient, OffsetPosition); |
2887 | lPos = OffsetPosition; | ||
2888 | SendFullUpdateToClient(remoteClient, lPos, clientflags); | ||
2889 | } | 2885 | } |
2890 | 2886 | ||
2891 | /// <summary> | 2887 | /// <summary> |
@@ -2893,8 +2889,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2893 | /// </summary> | 2889 | /// </summary> |
2894 | /// <param name="remoteClient"></param> | 2890 | /// <param name="remoteClient"></param> |
2895 | /// <param name="lPos"></param> | 2891 | /// <param name="lPos"></param> |
2896 | /// <param name="clientFlags"></param> | 2892 | public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos) |
2897 | public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags) | ||
2898 | { | 2893 | { |
2899 | if (ParentGroup == null) | 2894 | if (ParentGroup == null) |
2900 | return; | 2895 | return; |
@@ -2911,15 +2906,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2911 | (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) | 2906 | (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) |
2912 | return; | 2907 | return; |
2913 | 2908 | ||
2914 | clientFlags &= ~(uint) PrimFlags.CreateSelected; | ||
2915 | |||
2916 | if (remoteClient.AgentId == OwnerID) | 2909 | if (remoteClient.AgentId == OwnerID) |
2917 | { | 2910 | { |
2918 | if ((Flags & PrimFlags.CreateSelected) != 0) | 2911 | if ((Flags & PrimFlags.CreateSelected) != 0) |
2919 | { | ||
2920 | clientFlags |= (uint) PrimFlags.CreateSelected; | ||
2921 | Flags &= ~PrimFlags.CreateSelected; | 2912 | Flags &= ~PrimFlags.CreateSelected; |
2922 | } | ||
2923 | } | 2913 | } |
2924 | //bool isattachment = IsAttachment; | 2914 | //bool isattachment = IsAttachment; |
2925 | //if (LocalId != ParentGroup.RootPart.LocalId) | 2915 | //if (LocalId != ParentGroup.RootPart.LocalId) |
@@ -3354,6 +3344,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3354 | 3344 | ||
3355 | public void SetGroup(UUID groupID, IClientAPI client) | 3345 | public void SetGroup(UUID groupID, IClientAPI client) |
3356 | { | 3346 | { |
3347 | // Scene.AddNewPrims() calls with client == null so can't use this. | ||
3348 | // m_log.DebugFormat( | ||
3349 | // "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}", | ||
3350 | // Name, groupID, OwnerID); | ||
3351 | |||
3357 | GroupID = groupID; | 3352 | GroupID = groupID; |
3358 | if (client != null) | 3353 | if (client != null) |
3359 | SendPropertiesToClient(client); | 3354 | SendPropertiesToClient(client); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b16eaba..36d8c0b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -784,7 +784,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
784 | public void RegisterToEvents() | 784 | public void RegisterToEvents() |
785 | { | 785 | { |
786 | ControllingClient.OnCompleteMovementToRegion += CompleteMovement; | 786 | ControllingClient.OnCompleteMovementToRegion += CompleteMovement; |
787 | //ControllingClient.OnCompleteMovementToRegion += SendInitialData; | ||
788 | ControllingClient.OnAgentUpdate += HandleAgentUpdate; | 787 | ControllingClient.OnAgentUpdate += HandleAgentUpdate; |
789 | ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; | 788 | ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; |
790 | ControllingClient.OnAgentSit += HandleAgentSit; | 789 | ControllingClient.OnAgentSit += HandleAgentSit; |
@@ -832,11 +831,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
832 | 831 | ||
833 | #endregion | 832 | #endregion |
834 | 833 | ||
835 | public uint GenerateClientFlags(UUID ObjectID) | ||
836 | { | ||
837 | return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID); | ||
838 | } | ||
839 | |||
840 | #region Status Methods | 834 | #region Status Methods |
841 | 835 | ||
842 | /// <summary> | 836 | /// <summary> |
@@ -2538,7 +2532,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2538 | // again here... this comes after the cached appearance check because the avatars | 2532 | // again here... this comes after the cached appearance check because the avatars |
2539 | // appearance goes into the avatar update packet | 2533 | // appearance goes into the avatar update packet |
2540 | SendAvatarDataToAllAgents(); | 2534 | SendAvatarDataToAllAgents(); |
2541 | SendAppearanceToAgent(this); | 2535 | |
2536 | // Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do | ||
2537 | // this. | ||
2538 | // SendAppearanceToAgent(this); | ||
2542 | 2539 | ||
2543 | // If we are using the the cached appearance then send it out to everyone | 2540 | // If we are using the the cached appearance then send it out to everyone |
2544 | if (cachedappearance) | 2541 | if (cachedappearance) |
@@ -2673,7 +2670,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2673 | public void SendAppearanceToAgent(ScenePresence avatar) | 2670 | public void SendAppearanceToAgent(ScenePresence avatar) |
2674 | { | 2671 | { |
2675 | // m_log.DebugFormat( | 2672 | // m_log.DebugFormat( |
2676 | // "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); | 2673 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); |
2677 | 2674 | ||
2678 | avatar.ControllingClient.SendAppearance( | 2675 | avatar.ControllingClient.SendAppearance( |
2679 | UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); | 2676 | UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); |