mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
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
This commit is contained in:
@@ -218,6 +218,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
|
||||
client.OnObjectGroupRequest += HandleObjectGroupUpdate;
|
||||
client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
|
||||
client.OnDirFindQuery += OnDirFindQuery;
|
||||
client.OnRequestAvatarProperties += OnRequestAvatarProperties;
|
||||
@@ -225,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
// Used for Notices and Group Invites/Accept/Reject
|
||||
client.OnInstantMessage += OnInstantMessage;
|
||||
|
||||
// Send client thier groups information.
|
||||
// Send client their groups information.
|
||||
SendAgentGroupDataUpdate(client, client.AgentId);
|
||||
}
|
||||
|
||||
@@ -328,6 +329,30 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
remoteClient.SendGroupNameReply(GroupID, GroupName);
|
||||
}
|
||||
|
||||
private void HandleObjectGroupUpdate(
|
||||
IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
|
||||
{
|
||||
GroupMembershipData gmd = GetMembershipData(GroupID, remoteClient.AgentId);
|
||||
|
||||
if (gmd == null)
|
||||
{
|
||||
// m_log.WarnFormat(
|
||||
// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
|
||||
// remoteClient.Name, GroupID, objectLocalID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
|
||||
if (so != null)
|
||||
{
|
||||
if (so.OwnerID == remoteClient.AgentId)
|
||||
{
|
||||
so.SetGroup(GroupID, remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
Reference in New Issue
Block a user