mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 10:46:00 +08:00
@@ -40,7 +40,9 @@ using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
{
|
||||
@@ -66,6 +68,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
private string m_groupReadKey = string.Empty;
|
||||
private string m_groupWriteKey = string.Empty;
|
||||
|
||||
private IUserAccountService m_accountService = null;
|
||||
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
|
||||
@@ -116,6 +120,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty);
|
||||
m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty);
|
||||
|
||||
|
||||
|
||||
|
||||
// If we got all the config options we need, lets start'er'up
|
||||
m_connectorEnabled = true;
|
||||
}
|
||||
@@ -129,13 +136,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
|
||||
{
|
||||
if (m_connectorEnabled)
|
||||
{
|
||||
|
||||
if (m_accountService == null)
|
||||
{
|
||||
m_accountService = scene.UserAccountService;
|
||||
}
|
||||
|
||||
|
||||
scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
|
||||
{
|
||||
if (scene.RequestModuleInterface<IGroupsServicesConnector>() == this)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IGroupsServicesConnector>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
|
||||
@@ -155,14 +173,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region IGroupsServicesConnector Members
|
||||
|
||||
/// <summary>
|
||||
/// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role.
|
||||
/// </summary>
|
||||
public UUID CreateGroup(GroupRequestID requestID, string name, string charter, bool showInList, UUID insigniaID,
|
||||
public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID,
|
||||
int membershipFee, bool openEnrollment, bool allowPublish,
|
||||
bool maturePublish, UUID founderID)
|
||||
{
|
||||
@@ -234,7 +250,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.createGroup", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.createGroup", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -246,7 +262,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return UUID.Parse((string)respData["GroupID"]);
|
||||
}
|
||||
|
||||
public void UpdateGroup(GroupRequestID requestID, UUID groupID, string charter, bool showInList,
|
||||
public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList,
|
||||
UUID insigniaID, int membershipFee, bool openEnrollment,
|
||||
bool allowPublish, bool maturePublish)
|
||||
{
|
||||
@@ -260,10 +276,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["AllowPublish"] = allowPublish == true ? 1 : 0;
|
||||
param["MaturePublish"] = maturePublish == true ? 1 : 0;
|
||||
|
||||
XmlRpcCall(requestID, "groups.updateGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.updateGroup", param);
|
||||
}
|
||||
|
||||
public void AddGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID, string name, string description,
|
||||
public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
|
||||
string title, ulong powers)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
@@ -274,19 +290,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["Title"] = title;
|
||||
param["Powers"] = powers.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.addRoleToGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.addRoleToGroup", param);
|
||||
}
|
||||
|
||||
public void RemoveGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID)
|
||||
public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = groupID.ToString();
|
||||
param["RoleID"] = roleID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.removeRoleFromGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.removeRoleFromGroup", param);
|
||||
}
|
||||
|
||||
public void UpdateGroupRole(GroupRequestID requestID, UUID groupID, UUID roleID, string name, string description,
|
||||
public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
|
||||
string title, ulong powers)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
@@ -306,10 +322,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
}
|
||||
param["Powers"] = powers.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.updateGroupRole", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.updateGroupRole", param);
|
||||
}
|
||||
|
||||
public GroupRecord GetGroupRecord(GroupRequestID requestID, UUID GroupID, string GroupName)
|
||||
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
if (GroupID != UUID.Zero)
|
||||
@@ -321,7 +337,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["Name"] = GroupName.ToString();
|
||||
}
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroup", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroup", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -332,12 +348,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
}
|
||||
|
||||
public GroupProfileData GetMemberGroupProfile(GroupRequestID requestID, UUID GroupID, UUID AgentID)
|
||||
public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroup", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroup", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -345,7 +361,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return new GroupProfileData();
|
||||
}
|
||||
|
||||
GroupMembershipData MemberInfo = GetAgentGroupMembership(requestID, AgentID, GroupID);
|
||||
GroupMembershipData MemberInfo = GetAgentGroupMembership(requestingAgentID, AgentID, GroupID);
|
||||
GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData);
|
||||
|
||||
MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle;
|
||||
@@ -354,26 +370,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return MemberGroupProfile;
|
||||
}
|
||||
|
||||
public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.setAgentActiveGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.setAgentActiveGroup", param);
|
||||
}
|
||||
|
||||
public void SetAgentActiveGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
param["SelectedRoleID"] = RoleID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.setAgentGroupInfo", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.setAgentGroupInfo", param);
|
||||
}
|
||||
|
||||
public void SetAgentGroupInfo(GroupRequestID requestID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile)
|
||||
public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
@@ -381,11 +397,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["AcceptNotices"] = AcceptNotices ? "1" : "0";
|
||||
param["ListInProfile"] = ListInProfile ? "1" : "0";
|
||||
|
||||
XmlRpcCall(requestID, "groups.setAgentGroupInfo", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.setAgentGroupInfo", param);
|
||||
|
||||
}
|
||||
|
||||
public void AddAgentToGroupInvite(GroupRequestID requestID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
|
||||
public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["InviteID"] = inviteID.ToString();
|
||||
@@ -393,16 +409,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["RoleID"] = roleID.ToString();
|
||||
param["GroupID"] = groupID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.addAgentToGroupInvite", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.addAgentToGroupInvite", param);
|
||||
|
||||
}
|
||||
|
||||
public GroupInviteInfo GetAgentToGroupInvite(GroupRequestID requestID, UUID inviteID)
|
||||
public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["InviteID"] = inviteID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getAgentToGroupInvite", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getAgentToGroupInvite", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -418,59 +434,59 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return inviteInfo;
|
||||
}
|
||||
|
||||
public void RemoveAgentToGroupInvite(GroupRequestID requestID, UUID inviteID)
|
||||
public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["InviteID"] = inviteID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.removeAgentToGroupInvite", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.removeAgentToGroupInvite", param);
|
||||
}
|
||||
|
||||
public void AddAgentToGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
param["RoleID"] = RoleID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.addAgentToGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.addAgentToGroup", param);
|
||||
}
|
||||
|
||||
public void RemoveAgentFromGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.removeAgentFromGroup", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.removeAgentFromGroup", param);
|
||||
}
|
||||
|
||||
public void AddAgentToGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
param["RoleID"] = RoleID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.addAgentToGroupRole", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.addAgentToGroupRole", param);
|
||||
}
|
||||
|
||||
public void RemoveAgentFromGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
param["RoleID"] = RoleID.ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.removeAgentFromGroupRole", param);
|
||||
}
|
||||
|
||||
public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search)
|
||||
public List<DirGroupsReplyData> FindGroups(UUID requestingAgentID, string search)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["Search"] = search;
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.findGroups", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.findGroups", param);
|
||||
|
||||
List<DirGroupsReplyData> findings = new List<DirGroupsReplyData>();
|
||||
|
||||
@@ -492,13 +508,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return findings;
|
||||
}
|
||||
|
||||
public GroupMembershipData GetAgentGroupMembership(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getAgentGroupMembership", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getAgentGroupMembership", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -510,12 +526,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return data;
|
||||
}
|
||||
|
||||
public GroupMembershipData GetAgentActiveMembership(GroupRequestID requestID, UUID AgentID)
|
||||
public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getAgentActiveMembership", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getAgentActiveMembership", param);
|
||||
|
||||
if (respData.Contains("error"))
|
||||
{
|
||||
@@ -525,12 +541,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return HashTableToGroupMembershipData(respData);
|
||||
}
|
||||
|
||||
public List<GroupMembershipData> GetAgentGroupMemberships(GroupRequestID requestID, UUID AgentID)
|
||||
public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getAgentGroupMemberships", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getAgentGroupMemberships", param);
|
||||
|
||||
List<GroupMembershipData> memberships = new List<GroupMembershipData>();
|
||||
|
||||
@@ -545,13 +561,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return memberships;
|
||||
}
|
||||
|
||||
public List<GroupRolesData> GetAgentGroupRoles(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["AgentID"] = AgentID.ToString();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getAgentRoles", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getAgentRoles", param);
|
||||
|
||||
List<GroupRolesData> Roles = new List<GroupRolesData>();
|
||||
|
||||
@@ -577,12 +593,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
}
|
||||
|
||||
public List<GroupRolesData> GetGroupRoles(GroupRequestID requestID, UUID GroupID)
|
||||
public List<GroupRolesData> GetGroupRoles(UUID requestingAgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroupRoles", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupRoles", param);
|
||||
|
||||
List<GroupRolesData> Roles = new List<GroupRolesData>();
|
||||
|
||||
@@ -610,12 +626,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
|
||||
|
||||
public List<GroupMembersData> GetGroupMembers(GroupRequestID requestID, UUID GroupID)
|
||||
public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroupMembers", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupMembers", param);
|
||||
|
||||
List<GroupMembersData> members = new List<GroupMembersData>();
|
||||
|
||||
@@ -643,12 +659,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
}
|
||||
|
||||
public List<GroupRoleMembersData> GetGroupRoleMembers(GroupRequestID requestID, UUID GroupID)
|
||||
public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroupRoleMembers", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupRoleMembers", param);
|
||||
|
||||
List<GroupRoleMembersData> members = new List<GroupRoleMembersData>();
|
||||
|
||||
@@ -667,12 +683,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return members;
|
||||
}
|
||||
|
||||
public List<GroupNoticeData> GetGroupNotices(GroupRequestID requestID, UUID GroupID)
|
||||
public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroupNotices", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupNotices", param);
|
||||
|
||||
List<GroupNoticeData> values = new List<GroupNoticeData>();
|
||||
|
||||
@@ -694,12 +710,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return values;
|
||||
|
||||
}
|
||||
public GroupNoticeInfo GetGroupNotice(GroupRequestID requestID, UUID noticeID)
|
||||
public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["NoticeID"] = noticeID.ToString();
|
||||
|
||||
Hashtable respData = XmlRpcCall(requestID, "groups.getGroupNotice", param);
|
||||
Hashtable respData = XmlRpcCall(requestingAgentID, "groups.getGroupNotice", param);
|
||||
|
||||
|
||||
if (respData.Contains("error"))
|
||||
@@ -725,7 +741,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
|
||||
return data;
|
||||
}
|
||||
public void AddGroupNotice(GroupRequestID requestID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
|
||||
public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
|
||||
{
|
||||
string binBucket = OpenMetaverse.Utils.BytesToHexString(binaryBucket, "");
|
||||
|
||||
@@ -738,7 +754,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
param["BinaryBucket"] = binBucket;
|
||||
param["TimeStamp"] = ((uint)Util.UnixTimeSinceEpoch()).ToString();
|
||||
|
||||
XmlRpcCall(requestID, "groups.addGroupNotice", param);
|
||||
XmlRpcCall(requestingAgentID, "groups.addGroupNotice", param);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -831,15 +847,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
/// <summary>
|
||||
/// Encapsulate the XmlRpc call to standardize security and error handling.
|
||||
/// </summary>
|
||||
private Hashtable XmlRpcCall(GroupRequestID requestID, string function, Hashtable param)
|
||||
private Hashtable XmlRpcCall(UUID requestingAgentID, string function, Hashtable param)
|
||||
{
|
||||
if (requestID == null)
|
||||
{
|
||||
requestID = new GroupRequestID();
|
||||
}
|
||||
param.Add("RequestingAgentID", requestID.AgentID.ToString());
|
||||
param.Add("RequestingAgentUserService", requestID.UserServiceURL);
|
||||
param.Add("RequestingSessionID", requestID.SessionID.ToString());
|
||||
string UserService;
|
||||
UUID SessionID;
|
||||
GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);
|
||||
param.Add("requestingAgentID", requestingAgentID.ToString());
|
||||
param.Add("RequestingAgentUserService", UserService);
|
||||
param.Add("RequestingSessionID", SessionID.ToString());
|
||||
|
||||
|
||||
param.Add("ReadKey", m_groupReadKey);
|
||||
@@ -930,15 +945,49 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Group Request Tokens are an attempt to allow the groups service to authenticate
|
||||
/// requests. Currently uses UserService, AgentID, and SessionID
|
||||
/// TODO: Find a better way to do this.
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <returns></returns>
|
||||
private void GetClientGroupRequestID(UUID AgentID, out string UserServiceURL, out UUID SessionID)
|
||||
{
|
||||
UserServiceURL = "";
|
||||
SessionID = UUID.Zero;
|
||||
|
||||
}
|
||||
|
||||
public class GroupNoticeInfo
|
||||
{
|
||||
public GroupNoticeData noticeData = new GroupNoticeData();
|
||||
public UUID GroupID = UUID.Zero;
|
||||
public string Message = string.Empty;
|
||||
public byte[] BinaryBucket = new byte[0];
|
||||
// Need to rework this based on changes to User Services
|
||||
/*
|
||||
UserAccount userAccount = m_accountService.GetUserAccount(UUID.Zero,AgentID);
|
||||
if (userAccount == null)
|
||||
{
|
||||
// This should be impossible. If I've been passed a reference to a client
|
||||
// that client should be registered with the UserService. So something
|
||||
// is horribly wrong somewhere.
|
||||
|
||||
m_log.WarnFormat("[GROUPS]: Could not find a UserServiceURL for {0}", AgentID);
|
||||
|
||||
}
|
||||
else if (userProfile is ForeignUserProfileData)
|
||||
{
|
||||
// They aren't from around here
|
||||
ForeignUserProfileData fupd = (ForeignUserProfileData)userProfile;
|
||||
UserServiceURL = fupd.UserServerURI;
|
||||
SessionID = fupd.CurrentAgent.SessionID;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// They're a local user, use this:
|
||||
UserServiceURL = m_commManager.NetworkServersInfo.UserURL;
|
||||
SessionID = userProfile.CurrentAgent.SessionID;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user