byte[] HandleGetMembership(Dictionary <string, object> request) { Dictionary <string, object> result = new Dictionary <string, object>(); if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("AgentID")) { NullResult(result, "Bad network data"); } else { string agentID = request["AgentID"].ToString(); UUID groupID = UUID.Zero; if (request.ContainsKey("GroupID")) { groupID = new UUID(request["GroupID"].ToString()); } string requestingAgentID = request["RequestingAgentID"].ToString(); bool all = request.ContainsKey("ALL"); if (!all) { ExtendedGroupMembershipData membership = null; if (groupID == UUID.Zero) { membership = m_GroupsService.GetAgentActiveMembership(requestingAgentID, agentID); } else { membership = m_GroupsService.GetAgentGroupMembership(requestingAgentID, agentID, groupID); } if (membership == null) { NullResult(result, "No such membership"); } else { result["RESULT"] = GroupsDataUtils.GroupMembershipData(membership); } } else { List <GroupMembershipData> memberships = m_GroupsService.GetAgentGroupMemberships(requestingAgentID, agentID); if (memberships == null || (memberships != null && memberships.Count == 0)) { NullResult(result, "No memberships"); } else { Dictionary <string, object> dict = new Dictionary <string, object>(); int i = 0; foreach (GroupMembershipData m in memberships) { dict["m-" + i++] = GroupsDataUtils.GroupMembershipData((ExtendedGroupMembershipData)m); } result["RESULT"] = dict; } } } string xmlString = ServerUtils.BuildXmlResponse(result); //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); return(Util.UTF8NoBomEncoding.GetBytes(xmlString)); }
public List <GroupMembershipData> GetAgentGroupMemberships(string RequestingAgentID, string AgentID) { return(m_GroupsService.GetAgentGroupMemberships(RequestingAgentID, AgentID)); }