Merge branch 'master' into careminster

avinationmerge
Melanie 2011-12-19 23:16:20 +00:00
commit 2b4ebe657c
3 changed files with 44 additions and 36 deletions

View File

@ -153,6 +153,45 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
/// <summary>
/// Handle the update of an object's user group.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="groupID"></param>
/// <param name="objectLocalID"></param>
/// <param name="Garbage"></param>
private void HandleObjectGroupUpdate(
IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage)
{
if (m_groupsModule == null)
return;
// XXX: Might be better to get rid of this special casing and have GetMembershipData return something
// reasonable for a UUID.Zero group.
if (groupID != UUID.Zero)
{
GroupMembershipData gmd = m_groupsModule.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);
}
}
}
/// <summary> /// <summary>
/// Handle the deselection of a prim from the client. /// Handle the deselection of a prim from the client.
/// </summary> /// </summary>

View File

@ -142,6 +142,7 @@ namespace OpenSim.Region.Framework.Scenes
protected IDialogModule m_dialogModule; protected IDialogModule m_dialogModule;
protected IEntityTransferModule m_teleportModule; protected IEntityTransferModule m_teleportModule;
protected ICapabilitiesModule m_capsModule; protected ICapabilitiesModule m_capsModule;
protected IGroupsModule m_groupsModule;
/// <summary> /// <summary>
/// Current scene frame number /// Current scene frame number
@ -1206,6 +1207,7 @@ namespace OpenSim.Region.Framework.Scenes
m_dialogModule = RequestModuleInterface<IDialogModule>(); m_dialogModule = RequestModuleInterface<IDialogModule>();
m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
m_groupsModule = RequestModuleInterface<IGroupsModule>();
} }
#endregion #endregion
@ -2856,6 +2858,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDescription += m_sceneGraph.PrimDescription;
client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
client.OnObjectOwner += ObjectOwner; client.OnObjectOwner += ObjectOwner;
client.OnObjectGroupRequest += HandleObjectGroupUpdate;
} }
public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) public virtual void SubscribeToClientPrimRezEvents(IClientAPI client)
@ -3675,15 +3678,11 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
} }
IGroupsModule groupsModule =
RequestModuleInterface<IGroupsModule>();
List<UUID> agentGroups = new List<UUID>(); List<UUID> agentGroups = new List<UUID>();
if (groupsModule != null) if (m_groupsModule != null)
{ {
GroupMembershipData[] GroupMembership = GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
groupsModule.GetMembershipData(agent.AgentID);
if (GroupMembership != null) if (GroupMembership != null)
{ {

View File

@ -218,7 +218,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
client.OnObjectGroupRequest += HandleObjectGroupUpdate;
client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
client.OnDirFindQuery += OnDirFindQuery; client.OnDirFindQuery += OnDirFindQuery;
client.OnRequestAvatarProperties += OnRequestAvatarProperties; client.OnRequestAvatarProperties += OnRequestAvatarProperties;
@ -329,35 +328,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
remoteClient.SendGroupNameReply(GroupID, GroupName); remoteClient.SendGroupNameReply(GroupID, GroupName);
} }
private void HandleObjectGroupUpdate(
IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
{
// XXX: Might be better to get rid of this special casing and have GetMembershipData return something
// reasonable for a UUID.Zero group.
if (GroupID != UUID.Zero)
{
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) private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
{ {
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);