diff options
author | Justin Clark-Casey (justincc) | 2011-12-17 02:23:24 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-17 02:23:24 +0000 |
commit | f9137c923bcdc952efe37c7dd328c2d0d8323317 (patch) | |
tree | 333e2dab2e1c56e1bc7f0a8315c6655582479203 /OpenSim | |
parent | Add Garmin Kawaguichi to CONTRIBUTORS.txt (diff) | |
download | opensim-SC-f9137c923bcdc952efe37c7dd328c2d0d8323317.zip opensim-SC-f9137c923bcdc952efe37c7dd328c2d0d8323317.tar.gz opensim-SC-f9137c923bcdc952efe37c7dd328c2d0d8323317.tar.bz2 opensim-SC-f9137c923bcdc952efe37c7dd328c2d0d8323317.tar.xz |
Fix bug where objects could not be set to a new group if the group had been created in that client session, or if no other action has been performed on the object.
There were two problems here:
1) On object group update, we looked for the group is the IClientAPI group cache rather than in the groups service. This fails to groups created newly in that session
2) On object group update, we weren't setting the HasGroupChanged flag. This meant that the change was not persisted unless some other action set this flag.
This commit fixes these issues and hopefully addresses http://opensimulator.org/mantis/view.php?id=5588
This commit also moves HandleObjectGroupUpdate() to the GroupsModule from the Scene.PacketHandlers.cs file
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/ISceneEntity.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/ISceneObject.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 27 |
8 files changed, 50 insertions, 21 deletions
diff --git a/OpenSim/Framework/ISceneEntity.cs b/OpenSim/Framework/ISceneEntity.cs index c0ea302..a9f21d2 100644 --- a/OpenSim/Framework/ISceneEntity.cs +++ b/OpenSim/Framework/ISceneEntity.cs | |||
@@ -34,6 +34,7 @@ namespace OpenSim.Framework | |||
34 | string Name { get; set; } | 34 | string Name { get; set; } |
35 | UUID UUID { get; } | 35 | UUID UUID { get; } |
36 | uint LocalId { get; } | 36 | uint LocalId { get; } |
37 | |||
37 | Vector3 AbsolutePosition { get; } | 38 | Vector3 AbsolutePosition { get; } |
38 | } | 39 | } |
39 | } | 40 | } |
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs index 18631f1..afac9b8 100644 --- a/OpenSim/Framework/ISceneObject.cs +++ b/OpenSim/Framework/ISceneObject.cs | |||
@@ -33,6 +33,12 @@ namespace OpenSim.Framework | |||
33 | public interface ISceneObject | 33 | public interface ISceneObject |
34 | { | 34 | { |
35 | UUID UUID { get; } | 35 | UUID UUID { get; } |
36 | |||
37 | /// <summary> | ||
38 | /// The owner of this object. | ||
39 | /// </summary> | ||
40 | UUID OwnerID { get; set; } | ||
41 | |||
36 | ISceneObject CloneForNewScene(); | 42 | ISceneObject CloneForNewScene(); |
37 | string ToXml2(); | 43 | string ToXml2(); |
38 | string ExtraToXmlString(); | 44 | string ExtraToXmlString(); |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 7760382..cdecd2f 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -384,9 +384,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
384 | if (m_debugPermissions) | 384 | if (m_debugPermissions) |
385 | m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); | 385 | m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); |
386 | } | 386 | } |
387 | 387 | ||
388 | // Checks if the given group is active and if the user is a group member | 388 | /// <summary> |
389 | // with the powers requested (powers = 0 for no powers check) | 389 | /// Checks if the given group is active and if the user is a group member |
390 | /// with the powers requested (powers = 0 for no powers check) | ||
391 | /// </summary> | ||
392 | /// <param name="groupID"></param> | ||
393 | /// <param name="userID"></param> | ||
394 | /// <param name="powers"></param> | ||
395 | /// <returns></returns> | ||
390 | protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) | 396 | protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) |
391 | { | 397 | { |
392 | if (null == m_groupsModule) | 398 | if (null == m_groupsModule) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b43b227..4914d65 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2776,7 +2776,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2776 | 2776 | ||
2777 | public virtual void SubscribeToClientParcelEvents(IClientAPI client) | 2777 | public virtual void SubscribeToClientParcelEvents(IClientAPI client) |
2778 | { | 2778 | { |
2779 | client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate; | ||
2780 | client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; | 2779 | client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; |
2781 | client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; | 2780 | client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; |
2782 | client.OnParcelBuy += ProcessParcelBuy; | 2781 | client.OnParcelBuy += ProcessParcelBuy; |
@@ -2903,7 +2902,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2903 | 2902 | ||
2904 | public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) | 2903 | public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) |
2905 | { | 2904 | { |
2906 | client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate; | ||
2907 | client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; | 2905 | client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; |
2908 | client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; | 2906 | client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; |
2909 | client.OnParcelBuy -= ProcessParcelBuy; | 2907 | client.OnParcelBuy -= ProcessParcelBuy; |
@@ -4287,7 +4285,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4287 | /// Get a scene object group that contains the prim with the given local id | 4285 | /// Get a scene object group that contains the prim with the given local id |
4288 | /// </summary> | 4286 | /// </summary> |
4289 | /// <param name="localID"></param> | 4287 | /// <param name="localID"></param> |
4290 | /// <returns>null if no scene object group containing that prim is found</returns> | 4288 | /// <returns>null if no scene object group containing that prim is found</returns> |
4291 | public SceneObjectGroup GetGroupByPrim(uint localID) | 4289 | public SceneObjectGroup GetGroupByPrim(uint localID) |
4292 | { | 4290 | { |
4293 | return m_sceneGraph.GetGroupByPrim(localID); | 4291 | 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 7bf8c34..abea788 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3211,6 +3211,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3211 | part.Inventory.ChangeInventoryGroup(GroupID); | 3211 | part.Inventory.ChangeInventoryGroup(GroupID); |
3212 | } | 3212 | } |
3213 | 3213 | ||
3214 | HasGroupChanged = true; | ||
3215 | |||
3214 | // 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 |
3215 | // 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. |
3216 | //ScheduleGroupForFullUpdate(); | 3218 | //ScheduleGroupForFullUpdate(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 598b310..b29ecc6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3344,6 +3344,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3344 | 3344 | ||
3345 | public void SetGroup(UUID groupID, IClientAPI client) | 3345 | public void SetGroup(UUID groupID, IClientAPI client) |
3346 | { | 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 | |||
3347 | GroupID = groupID; | 3352 | GroupID = groupID; |
3348 | if (client != null) | 3353 | if (client != null) |
3349 | SendPropertiesToClient(client); | 3354 | SendPropertiesToClient(client); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 8baeaa4..9969a15 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -218,6 +218,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
218 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 218 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
219 | 219 | ||
220 | client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; | 220 | client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; |
221 | client.OnObjectGroupRequest += HandleObjectGroupUpdate; | ||
221 | client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; | 222 | client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; |
222 | client.OnDirFindQuery += OnDirFindQuery; | 223 | client.OnDirFindQuery += OnDirFindQuery; |
223 | client.OnRequestAvatarProperties += OnRequestAvatarProperties; | 224 | client.OnRequestAvatarProperties += OnRequestAvatarProperties; |
@@ -225,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
225 | // Used for Notices and Group Invites/Accept/Reject | 226 | // Used for Notices and Group Invites/Accept/Reject |
226 | client.OnInstantMessage += OnInstantMessage; | 227 | client.OnInstantMessage += OnInstantMessage; |
227 | 228 | ||
228 | // Send client thier groups information. | 229 | // Send client their groups information. |
229 | SendAgentGroupDataUpdate(client, client.AgentId); | 230 | SendAgentGroupDataUpdate(client, client.AgentId); |
230 | } | 231 | } |
231 | 232 | ||
@@ -328,6 +329,30 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
328 | remoteClient.SendGroupNameReply(GroupID, GroupName); | 329 | remoteClient.SendGroupNameReply(GroupID, GroupName); |
329 | } | 330 | } |
330 | 331 | ||
332 | private void HandleObjectGroupUpdate( | ||
333 | IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) | ||
334 | { | ||
335 | GroupMembershipData gmd = GetMembershipData(GroupID, remoteClient.AgentId); | ||
336 | |||
337 | if (gmd == null) | ||
338 | { | ||
339 | // m_log.WarnFormat( | ||
340 | // "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group", | ||
341 | // remoteClient.Name, GroupID, objectLocalID); | ||
342 | |||
343 | return; | ||
344 | } | ||
345 | |||
346 | SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID); | ||
347 | if (so != null) | ||
348 | { | ||
349 | if (so.OwnerID == remoteClient.AgentId) | ||
350 | { | ||
351 | so.SetGroup(GroupID, remoteClient); | ||
352 | } | ||
353 | } | ||
354 | } | ||
355 | |||
331 | private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) | 356 | private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) |
332 | { | 357 | { |
333 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 358 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |