From f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 25 Mar 2010 22:47:52 +0000 Subject: add get group by name method to IGroupsModule --- .../Avatar/XmlRpcGroups/GroupsModule.cs | 36 ++++++++++++++++------ .../XmlRpcGroupsServicesConnectorModule.cs | 1 - 2 files changed, 27 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 68e6497..93c2d09 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -328,17 +328,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } */ - void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) { if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) { - if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); + if (m_debugEnabled) + m_log.DebugFormat( + "[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", + System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); // TODO: This currently ignores pretty much all the query flags including Mature and sort order - remoteClient.SendDirGroupsReply(queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); - } - + remoteClient.SendDirGroupsReply( + queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); + } } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) @@ -652,7 +654,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups List data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); return data; - } public List GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) @@ -662,8 +663,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups List data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); return data; - - } public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) @@ -746,7 +745,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return UUID.Zero; } // is there is a money module present ? - IMoneyModule money=remoteClient.Scene.RequestModuleInterface(); + IMoneyModule money = remoteClient.Scene.RequestModuleInterface(); if (money != null) { // do the transaction, that is if the agent has got sufficient funds @@ -766,6 +765,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return groupID; } + public DirGroupsReplyData? GetGroup(string name) + { + if (m_debugEnabled) + m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); + + List groups = m_groupData.FindGroups(null, name); + + DirGroupsReplyData? foundGroup = null; + + foreach (DirGroupsReplyData group in groups) + { + // We must have an exact match - I believe FindGroups will return partial matches + if (group.groupName == name) + foundGroup = group; + } + + return foundGroup; + } + public GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID groupID) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 964d0bb..2115376 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -470,7 +470,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); } - public List FindGroups(GroupRequestID requestID, string search) { Hashtable param = new Hashtable(); -- cgit v1.1