mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
replace recent IModule.GetGroup() with better GetGroupRecord(string name)
This commit is contained in:
@@ -365,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
SendScenePresenceUpdate(dataForAgentID, activeGroupTitle);
|
||||
}
|
||||
|
||||
private void HandleUUIDGroupNameRequest(UUID GroupID,IClientAPI remoteClient)
|
||||
private void HandleUUIDGroupNameRequest(UUID GroupID, IClientAPI remoteClient)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
@@ -595,6 +595,31 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return m_groupData.GetGroupRecord(null, GroupID, null);
|
||||
}
|
||||
|
||||
public GroupRecord GetGroupRecord(string name)
|
||||
{
|
||||
if (m_debugEnabled)
|
||||
m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
// XXX: Two call implementation. This could be done in a single call if the server itself were to
|
||||
// implement the code below.
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (null == foundGroup)
|
||||
return null;
|
||||
|
||||
return GetGroupRecord(((DirGroupsReplyData)foundGroup).groupID);
|
||||
}
|
||||
|
||||
public void ActivateGroup(IClientAPI remoteClient, UUID groupID)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
@@ -768,25 +793,6 @@ 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<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)
|
||||
{
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
@@ -352,11 +352,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
|
||||
|
||||
return MemberGroupProfile;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
|
||||
Reference in New Issue
Block a user