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/Region/OptionalModules | |
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 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 27 |
1 files changed, 26 insertions, 1 deletions
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); |