diff options
author | Justin Clark-Casey (justincc) | 2010-03-25 22:47:52 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-25 22:47:52 +0000 |
commit | f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6 (patch) | |
tree | 117733099286964cf0ae32ecb17b721f62d243d6 /OpenSim | |
parent | fix unit tests broken by commit dcf18689b9ab29d4ceb2348bb56fc1f77a7a8912 (diff) | |
download | opensim-SC-f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6.zip opensim-SC-f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6.tar.gz opensim-SC-f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6.tar.bz2 opensim-SC-f0703cad2ce6894ef2ccbf6a9c3cc93fe3c960b6.tar.xz |
add get group by name method to IGroupsModule
Diffstat (limited to '')
3 files changed, 53 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 8980b2d..368f2cd 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs | |||
@@ -37,6 +37,30 @@ namespace OpenSim.Region.Framework.Interfaces | |||
37 | { | 37 | { |
38 | event NewGroupNotice OnNewGroupNotice; | 38 | event NewGroupNotice OnNewGroupNotice; |
39 | 39 | ||
40 | /// <summary> | ||
41 | /// Create a group | ||
42 | /// </summary> | ||
43 | /// <param name="remoteClient"></param> | ||
44 | /// <param name="name"></param> | ||
45 | /// <param name="charter"></param> | ||
46 | /// <param name="showInList"></param> | ||
47 | /// <param name="insigniaID"></param> | ||
48 | /// <param name="membershipFee"></param> | ||
49 | /// <param name="openEnrollment"></param> | ||
50 | /// <param name="allowPublish"></param> | ||
51 | /// <param name="maturePublish"></param> | ||
52 | /// <returns>The UUID of the created group</returns> | ||
53 | UUID CreateGroup( | ||
54 | IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, | ||
55 | bool openEnrollment, bool allowPublish, bool maturePublish); | ||
56 | |||
57 | /// <summary> | ||
58 | /// Get a group given its name | ||
59 | /// </summary> | ||
60 | /// <param name="name"></param> | ||
61 | /// <returns>The group's data. Null if there is no such group.</returns> | ||
62 | DirGroupsReplyData? GetGroup(string name); | ||
63 | |||
40 | void ActivateGroup(IClientAPI remoteClient, UUID groupID); | 64 | void ActivateGroup(IClientAPI remoteClient, UUID groupID); |
41 | List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); | 65 | List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); |
42 | List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID); | 66 | List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID); |
@@ -50,8 +74,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
50 | 74 | ||
51 | void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); | 75 | void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); |
52 | 76 | ||
53 | void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); | 77 | void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); |
54 | UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); | ||
55 | 78 | ||
56 | GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); | 79 | GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); |
57 | string GetGroupTitle(UUID avatarID); | 80 | string GetGroupTitle(UUID avatarID); |
@@ -67,4 +90,4 @@ namespace OpenSim.Region.Framework.Interfaces | |||
67 | GroupRecord GetGroupRecord(UUID GroupID); | 90 | GroupRecord GetGroupRecord(UUID GroupID); |
68 | void NotifyChange(UUID GroupID); | 91 | void NotifyChange(UUID GroupID); |
69 | } | 92 | } |
70 | } | 93 | } \ No newline at end of file |
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 | |||
328 | } | 328 | } |
329 | */ | 329 | */ |
330 | 330 | ||
331 | |||
332 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) | 331 | void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) |
333 | { | 332 | { |
334 | if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) | 333 | if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) |
335 | { | 334 | { |
336 | 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); | 335 | if (m_debugEnabled) |
336 | m_log.DebugFormat( | ||
337 | "[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", | ||
338 | System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart); | ||
337 | 339 | ||
338 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order | 340 | // TODO: This currently ignores pretty much all the query flags including Mature and sort order |
339 | remoteClient.SendDirGroupsReply(queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); | 341 | remoteClient.SendDirGroupsReply( |
340 | } | 342 | queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray()); |
341 | 343 | } | |
342 | } | 344 | } |
343 | 345 | ||
344 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) | 346 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) |
@@ -652,7 +654,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
652 | List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); | 654 | List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); |
653 | 655 | ||
654 | return data; | 656 | return data; |
655 | |||
656 | } | 657 | } |
657 | 658 | ||
658 | public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) | 659 | public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) |
@@ -662,8 +663,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
662 | List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); | 663 | List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); |
663 | 664 | ||
664 | return data; | 665 | return data; |
665 | |||
666 | |||
667 | } | 666 | } |
668 | 667 | ||
669 | public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) | 668 | public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) |
@@ -746,7 +745,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
746 | return UUID.Zero; | 745 | return UUID.Zero; |
747 | } | 746 | } |
748 | // is there is a money module present ? | 747 | // is there is a money module present ? |
749 | IMoneyModule money=remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); | 748 | IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); |
750 | if (money != null) | 749 | if (money != null) |
751 | { | 750 | { |
752 | // do the transaction, that is if the agent has got sufficient funds | 751 | // do the transaction, that is if the agent has got sufficient funds |
@@ -766,6 +765,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
766 | return groupID; | 765 | return groupID; |
767 | } | 766 | } |
768 | 767 | ||
768 | public DirGroupsReplyData? GetGroup(string name) | ||
769 | { | ||
770 | if (m_debugEnabled) | ||
771 | m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | ||
772 | |||
773 | List<DirGroupsReplyData> groups = m_groupData.FindGroups(null, name); | ||
774 | |||
775 | DirGroupsReplyData? foundGroup = null; | ||
776 | |||
777 | foreach (DirGroupsReplyData group in groups) | ||
778 | { | ||
779 | // We must have an exact match - I believe FindGroups will return partial matches | ||
780 | if (group.groupName == name) | ||
781 | foundGroup = group; | ||
782 | } | ||
783 | |||
784 | return foundGroup; | ||
785 | } | ||
786 | |||
769 | public GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID groupID) | 787 | public GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID groupID) |
770 | { | 788 | { |
771 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 789 | 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 | |||
470 | XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); | 470 | XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); |
471 | } | 471 | } |
472 | 472 | ||
473 | |||
474 | public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search) | 473 | public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search) |
475 | { | 474 | { |
476 | Hashtable param = new Hashtable(); | 475 | Hashtable param = new Hashtable(); |