diff options
author | Michael Cortez | 2009-09-16 16:51:22 -0700 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-09-18 20:54:03 +0100 |
commit | 4eb07232e0e8ff36388c21c3b5522b81ee8ef156 (patch) | |
tree | 4f2078a1b2026eda59bff424bd6d4f8aa41417d0 | |
parent | Add a little debugging for filtered groups lists based on requester (diff) | |
download | opensim-SC_OLD-4eb07232e0e8ff36388c21c3b5522b81ee8ef156.zip opensim-SC_OLD-4eb07232e0e8ff36388c21c3b5522b81ee8ef156.tar.gz opensim-SC_OLD-4eb07232e0e8ff36388c21c3b5522b81ee8ef156.tar.bz2 opensim-SC_OLD-4eb07232e0e8ff36388c21c3b5522b81ee8ef156.tar.xz |
Group Membership information is sent out from two different locations, refactored out the filtered membership list code and used it in both locations.
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 9d56ba8..d5cbfd4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -281,7 +281,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
281 | 281 | ||
282 | private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) | 282 | private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) |
283 | { | 283 | { |
284 | GroupMembershipData[] avatarGroups = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), avatarID).ToArray(); | 284 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); |
285 | |||
286 | //GroupMembershipData[] avatarGroups = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), avatarID).ToArray(); | ||
287 | GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID); | ||
285 | remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups); | 288 | remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups); |
286 | } | 289 | } |
287 | 290 | ||
@@ -1287,10 +1290,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1287 | // to the core Groups Stub | 1290 | // to the core Groups Stub |
1288 | remoteClient.SendGroupMembership(new GroupMembershipData[0]); | 1291 | remoteClient.SendGroupMembership(new GroupMembershipData[0]); |
1289 | 1292 | ||
1290 | List<GroupMembershipData> membershipData = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(remoteClient), dataForAgentID); | 1293 | GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, dataForAgentID); |
1294 | SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray); | ||
1295 | remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray); | ||
1296 | |||
1297 | } | ||
1298 | |||
1299 | /// <summary> | ||
1300 | /// Get a list of groups memberships for the agent that are marked "ListInProfile" | ||
1301 | /// </summary> | ||
1302 | /// <param name="dataForAgentID"></param> | ||
1303 | /// <returns></returns> | ||
1304 | private GroupMembershipData[] GetProfileListedGroupMemberships(IClientAPI requestingClient, UUID dataForAgentID) | ||
1305 | { | ||
1306 | List<GroupMembershipData> membershipData = m_groupData.GetAgentGroupMemberships(GetClientGroupRequestID(requestingClient), dataForAgentID); | ||
1291 | GroupMembershipData[] membershipArray; | 1307 | GroupMembershipData[] membershipArray; |
1292 | 1308 | ||
1293 | if (remoteClient.AgentId != dataForAgentID) | 1309 | if (requestingClient.AgentId != dataForAgentID) |
1294 | { | 1310 | { |
1295 | Predicate<GroupMembershipData> showInProfile = delegate(GroupMembershipData membership) | 1311 | Predicate<GroupMembershipData> showInProfile = delegate(GroupMembershipData membership) |
1296 | { | 1312 | { |
@@ -1298,22 +1314,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1298 | }; | 1314 | }; |
1299 | 1315 | ||
1300 | membershipArray = membershipData.FindAll(showInProfile).ToArray(); | 1316 | membershipArray = membershipData.FindAll(showInProfile).ToArray(); |
1301 | } else { | 1317 | } |
1318 | else | ||
1319 | { | ||
1302 | membershipArray = membershipData.ToArray(); | 1320 | membershipArray = membershipData.ToArray(); |
1303 | } | 1321 | } |
1304 | 1322 | ||
1305 | if (m_debugEnabled) | 1323 | if (m_debugEnabled) |
1306 | { | 1324 | { |
1307 | m_log.InfoFormat("[GROUPS]: Sending group membership information for {0} to {1}", dataForAgentID, remoteClient.AgentId); | 1325 | m_log.InfoFormat("[GROUPS]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId); |
1308 | foreach (GroupMembershipData membership in membershipArray) | 1326 | foreach (GroupMembershipData membership in membershipArray) |
1309 | { | 1327 | { |
1310 | m_log.InfoFormat("[GROUPS]: {0} :: {1} - {2}", dataForAgentID, membership.GroupName, membership.GroupTitle); | 1328 | m_log.InfoFormat("[GROUPS]: {0} :: {1} - {2}", dataForAgentID, membership.GroupName, membership.GroupTitle); |
1311 | } | 1329 | } |
1312 | } | 1330 | } |
1313 | 1331 | ||
1314 | SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray); | 1332 | return membershipArray; |
1315 | remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray); | ||
1316 | |||
1317 | } | 1333 | } |
1318 | 1334 | ||
1319 | private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle) | 1335 | private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle) |