add get group by name method to IGroupsModule

slimupdates
Justin Clark-Casey (justincc) 2010-03-25 22:47:52 +00:00
parent 19c659ca99
commit f0703cad2c
3 changed files with 53 additions and 13 deletions

View File

@ -37,6 +37,30 @@ namespace OpenSim.Region.Framework.Interfaces
{ {
event NewGroupNotice OnNewGroupNotice; event NewGroupNotice OnNewGroupNotice;
/// <summary>
/// Create a group
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="name"></param>
/// <param name="charter"></param>
/// <param name="showInList"></param>
/// <param name="insigniaID"></param>
/// <param name="membershipFee"></param>
/// <param name="openEnrollment"></param>
/// <param name="allowPublish"></param>
/// <param name="maturePublish"></param>
/// <returns>The UUID of the created group</returns>
UUID CreateGroup(
IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee,
bool openEnrollment, bool allowPublish, bool maturePublish);
/// <summary>
/// Get a group given its name
/// </summary>
/// <param name="name"></param>
/// <returns>The group's data. Null if there is no such group.</returns>
DirGroupsReplyData? GetGroup(string name);
void ActivateGroup(IClientAPI remoteClient, UUID groupID); void ActivateGroup(IClientAPI remoteClient, UUID groupID);
List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID); List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID);
List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID); List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID);
@ -51,7 +75,6 @@ namespace OpenSim.Region.Framework.Interfaces
void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile);
void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID);
UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID);
string GetGroupTitle(UUID avatarID); string GetGroupTitle(UUID avatarID);

View File

@ -328,17 +328,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
*/ */
void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
{ {
if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) 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 // 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) private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID)
@ -652,7 +654,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID); List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID);
return data; return data;
} }
public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID) public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID)
@ -662,8 +663,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID); List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID);
return data; return data;
} }
public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID) public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID)
@ -766,6 +765,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return groupID; return groupID;
} }
public DirGroupsReplyData? GetGroup(string name)
{
if (m_debugEnabled)
m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
List<DirGroupsReplyData> 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) public GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID groupID)
{ {
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);

View File

@ -470,7 +470,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param); XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param);
} }
public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search) public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search)
{ {
Hashtable param = new Hashtable(); Hashtable param = new Hashtable();