Merge branch 'groups-core-contrib' of git://github.com/mcortez/opensim into incoming
commit
ca5da5face
|
@ -31,6 +31,7 @@ using System.Reflection;
|
|||
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
@ -46,7 +47,8 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
|
|||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
{
|
||||
public class XmlRpcGroupsMessaging : ISharedRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GroupsMessagingModule : ISharedRegionModule
|
||||
{
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
@ -57,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
private IGroupsModule m_groupsModule = null;
|
||||
|
||||
// TODO: Move this off to the xmlrpc server
|
||||
// TODO: Move this off to the Groups Server
|
||||
public Dictionary<Guid, List<Guid>> m_agentsInGroupSession = new Dictionary<Guid, List<Guid>>();
|
||||
public Dictionary<Guid, List<Guid>> m_agentsDroppedSession = new Dictionary<Guid, List<Guid>>();
|
||||
|
||||
|
@ -79,31 +81,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!groupsConfig.GetBoolean("Enabled", false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (groupsConfig.GetString("Module", "Default") != "XmlRpcGroups")
|
||||
// if groups aren't enabled, we're not needed.
|
||||
// if we're not specified as the connector to use, then we're not wanted
|
||||
if ((groupsConfig.GetBoolean("Enabled", false) == false)
|
||||
|| (groupsConfig.GetString("MessagingModule", "Default") != Name))
|
||||
{
|
||||
m_groupMessagingEnabled = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_groupMessagingEnabled = groupsConfig.GetBoolean("XmlRpcMessagingEnabled", true);
|
||||
m_groupMessagingEnabled = groupsConfig.GetBoolean("MessagingEnabled", true);
|
||||
|
||||
if (!m_groupMessagingEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.Info("[GROUPS-MESSAGING]: Initializing XmlRpcGroupsMessaging");
|
||||
m_log.Info("[GROUPS-MESSAGING]: Initializing GroupsMessagingModule");
|
||||
|
||||
m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true);
|
||||
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
|
||||
}
|
||||
|
||||
m_log.Info("[GROUPS-MESSAGING]: XmlRpcGroupsMessaging starting up");
|
||||
m_log.Info("[GROUPS-MESSAGING]: GroupsMessagingModule starting up");
|
||||
|
||||
}
|
||||
|
||||
|
@ -123,7 +122,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
// No groups module, no groups messaging
|
||||
if (m_groupsModule == null)
|
||||
{
|
||||
m_log.Error("[GROUPS-MESSAGING]: Could not get IGroupsModule, XmlRpcGroupsMessaging is now disabled.");
|
||||
m_log.Error("[GROUPS-MESSAGING]: Could not get IGroupsModule, GroupsMessagingModule is now disabled.");
|
||||
Close();
|
||||
m_groupMessagingEnabled = false;
|
||||
return;
|
||||
|
@ -163,7 +162,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
if (!m_groupMessagingEnabled)
|
||||
return;
|
||||
|
||||
if (m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down XmlRpcGroupsMessaging module.");
|
||||
if (m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down GroupsMessagingModule module.");
|
||||
|
||||
foreach (Scene scene in m_sceneList)
|
||||
{
|
||||
|
@ -184,7 +183,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
public string Name
|
||||
{
|
||||
get { return "XmlRpcGroupsMessaging"; }
|
||||
get { return "GroupsMessagingModule"; }
|
||||
}
|
||||
|
||||
#endregion
|
|
@ -31,6 +31,7 @@ using System.Reflection;
|
|||
using System.Timers;
|
||||
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
@ -49,20 +50,26 @@ using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
|
|||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
{
|
||||
public class XmlRpcGroupsModule : ISharedRegionModule, IGroupsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class GroupsModule : ISharedRegionModule, IGroupsModule
|
||||
{
|
||||
/// <summary>
|
||||
/// ; To use this module, you must specify the following in your OpenSim.ini
|
||||
/// [GROUPS]
|
||||
/// Enabled = true
|
||||
/// Module = XmlRpcGroups
|
||||
/// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php
|
||||
/// XmlRpcMessagingEnabled = true
|
||||
/// XmlRpcNoticesEnabled = true
|
||||
/// XmlRpcDebugEnabled = true
|
||||
/// XmlRpcServiceReadKey = 1234
|
||||
///
|
||||
/// Module = GroupsModule
|
||||
/// NoticesEnabled = true
|
||||
/// DebugEnabled = true
|
||||
///
|
||||
/// GroupsServicesConnectorModule = XmlRpcGroupsServicesConnector
|
||||
/// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php
|
||||
/// XmlRpcServiceReadKey = 1234
|
||||
/// XmlRpcServiceWriteKey = 1234
|
||||
///
|
||||
/// MessagingModule = GroupsMessagingModule
|
||||
/// MessagingEnabled = true
|
||||
///
|
||||
/// ; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for
|
||||
/// ; a problem discovered on some Windows based region servers. Only disable
|
||||
/// ; if you see a large number (dozens) of the following Exceptions:
|
||||
|
@ -78,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
private IMessageTransferModule m_msgTransferModule = null;
|
||||
|
||||
private IGroupDataProvider m_groupData = null;
|
||||
private IGroupsServicesConnector m_groupData = null;
|
||||
|
||||
class GroupRequestIDInfo
|
||||
{
|
||||
|
@ -91,7 +98,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
|
||||
// Configuration settings
|
||||
private const string m_defaultXmlRpcServiceURL = "http://osflotsam.org/xmlrpc.php";
|
||||
private bool m_groupsEnabled = false;
|
||||
private bool m_groupNoticesEnabled = true;
|
||||
private bool m_debugEnabled = true;
|
||||
|
@ -115,7 +121,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
return;
|
||||
}
|
||||
|
||||
if (groupsConfig.GetString("Module", "Default") != "XmlRpcGroups")
|
||||
if (groupsConfig.GetString("Module", "Default") != Name)
|
||||
{
|
||||
m_groupsEnabled = false;
|
||||
|
||||
|
@ -124,17 +130,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name);
|
||||
|
||||
string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL", m_defaultXmlRpcServiceURL);
|
||||
bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false);
|
||||
|
||||
string ServiceReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty);
|
||||
string ServiceWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty);
|
||||
|
||||
m_groupData = new XmlRpcGroupDataProvider(ServiceURL, DisableKeepAlive, ServiceReadKey, ServiceWriteKey);
|
||||
m_log.InfoFormat("[GROUPS]: XmlRpc Service URL set to: {0}", ServiceURL);
|
||||
|
||||
m_groupNoticesEnabled = groupsConfig.GetBoolean("XmlRpcNoticesEnabled", true);
|
||||
m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true);
|
||||
m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
|
||||
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
|
||||
|
||||
m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut;
|
||||
m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache;
|
||||
|
@ -172,6 +169,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
if (m_groupData == null)
|
||||
{
|
||||
m_groupData = scene.RequestModuleInterface<IGroupsServicesConnector>();
|
||||
|
||||
// No Groups Service Connector, then nothing works...
|
||||
if (m_groupData == null)
|
||||
{
|
||||
m_groupsEnabled = false;
|
||||
m_log.Error("[GROUPS]: Could not get IGroupsServicesConnector");
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_msgTransferModule == null)
|
||||
{
|
||||
m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
|
||||
|
@ -218,7 +229,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
if (!m_groupsEnabled)
|
||||
return;
|
||||
|
||||
if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down XmlRpcGroups module.");
|
||||
if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module.");
|
||||
|
||||
m_clientRequestIDFlushTimer.Stop();
|
||||
}
|
||||
|
@ -230,7 +241,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
public string Name
|
||||
{
|
||||
get { return "XmlRpcGroupsModule"; }
|
||||
get { return "GroupsModule"; }
|
||||
}
|
||||
|
||||
#endregion
|
|
@ -34,7 +34,7 @@ using OpenSim.Framework;
|
|||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
{
|
||||
interface IGroupDataProvider
|
||||
interface IGroupsServicesConnector
|
||||
{
|
||||
UUID CreateGroup(GroupRequestID requestID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID);
|
||||
void UpdateGroup(GroupRequestID requestID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
|
|
@ -29,27 +29,27 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
//using System.Text;
|
||||
|
||||
using Nwc.XmlRpc;
|
||||
|
||||
using log4net;
|
||||
// using Nini.Config;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
using OpenSim.Framework;
|
||||
//using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
{
|
||||
public class XmlRpcGroupDataProvider : IGroupDataProvider
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class XmlRpcGroupsServicesConnectorModule : ISharedRegionModule, IGroupsServicesConnector
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private string m_serviceURL = string.Empty;
|
||||
|
||||
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
|
||||
GroupPowers.Accountable |
|
||||
|
@ -59,26 +59,108 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
GroupPowers.StartProposal |
|
||||
GroupPowers.VoteOnProposal;
|
||||
|
||||
private bool m_connectorEnabled = false;
|
||||
|
||||
private string m_serviceURL = string.Empty;
|
||||
|
||||
private bool m_disableKeepAlive = false;
|
||||
|
||||
private string m_groupReadKey = string.Empty;
|
||||
private string m_groupWriteKey = string.Empty;
|
||||
|
||||
public XmlRpcGroupDataProvider(string serviceURL, bool disableKeepAlive, string groupReadKey, string groupWriteKey)
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
|
||||
public string Name
|
||||
{
|
||||
m_serviceURL = serviceURL.Trim();
|
||||
m_disableKeepAlive = disableKeepAlive;
|
||||
|
||||
if ((serviceURL == null) ||
|
||||
(serviceURL == string.Empty))
|
||||
{
|
||||
throw new Exception("Please specify a valid ServiceURL for XmlRpcGroupDataProvider in OpenSim.ini, [Groups], XmlRpcServiceURL");
|
||||
}
|
||||
|
||||
m_groupReadKey = groupReadKey;
|
||||
m_groupWriteKey = groupWriteKey;
|
||||
get { return "XmlRpcGroupsServicesConnector"; }
|
||||
}
|
||||
|
||||
// this module is not intended to be replaced, but there should only be 1 of them.
|
||||
public Type ReplacableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig groupsConfig = config.Configs["Groups"];
|
||||
|
||||
if (groupsConfig == null)
|
||||
{
|
||||
// Do not run this module by default.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if groups aren't enabled, we're not needed.
|
||||
// if we're not specified as the connector to use, then we're not wanted
|
||||
if ( (groupsConfig.GetBoolean("Enabled", false) == false)
|
||||
|| (groupsConfig.GetString("ServicesConnectorModule", "Default") != Name))
|
||||
{
|
||||
m_connectorEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name);
|
||||
|
||||
m_serviceURL = groupsConfig.GetString("XmlRpcServiceURL", string.Empty);
|
||||
if ((m_serviceURL == null) ||
|
||||
(m_serviceURL == string.Empty))
|
||||
{
|
||||
m_log.ErrorFormat("Please specify a valid URL for XmlRpcServiceURL in OpenSim.ini, [Groups]");
|
||||
m_connectorEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_disableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_log.InfoFormat("[GROUPS-CONNECTOR]: Closing {0}", this.Name);
|
||||
}
|
||||
|
||||
public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
|
||||
{
|
||||
if (m_connectorEnabled)
|
||||
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)
|
||||
{
|
||||
// TODO: May want to consider listenning for Agent Connections so we can pre-cache group info
|
||||
// scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
// NoOp
|
||||
}
|
||||
|
||||
#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>
|
||||
|
@ -275,53 +357,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
}
|
||||
|
||||
private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)
|
||||
{
|
||||
GroupProfileData group = new GroupProfileData();
|
||||
group.GroupID = UUID.Parse((string)groupProfile["GroupID"]);
|
||||
group.Name = (string)groupProfile["Name"];
|
||||
|
||||
if (groupProfile["Charter"] != null)
|
||||
{
|
||||
group.Charter = (string)groupProfile["Charter"];
|
||||
}
|
||||
|
||||
group.ShowInList = ((string)groupProfile["ShowInList"]) == "1";
|
||||
group.InsigniaID = UUID.Parse((string)groupProfile["InsigniaID"]);
|
||||
group.MembershipFee = int.Parse((string)groupProfile["MembershipFee"]);
|
||||
group.OpenEnrollment = ((string)groupProfile["OpenEnrollment"]) == "1";
|
||||
group.AllowPublish = ((string)groupProfile["AllowPublish"]) == "1";
|
||||
group.MaturePublish = ((string)groupProfile["MaturePublish"]) == "1";
|
||||
group.FounderID = UUID.Parse((string)groupProfile["FounderID"]);
|
||||
group.OwnerRole = UUID.Parse((string)groupProfile["OwnerRoleID"]);
|
||||
|
||||
group.GroupMembershipCount = int.Parse((string)groupProfile["GroupMembershipCount"]);
|
||||
group.GroupRolesCount = int.Parse((string)groupProfile["GroupRolesCount"]);
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile)
|
||||
{
|
||||
|
||||
GroupRecord group = new GroupRecord();
|
||||
group.GroupID = UUID.Parse((string)groupProfile["GroupID"]);
|
||||
group.GroupName = groupProfile["Name"].ToString();
|
||||
if (groupProfile["Charter"] != null)
|
||||
{
|
||||
group.Charter = (string)groupProfile["Charter"];
|
||||
}
|
||||
group.ShowInList = ((string)groupProfile["ShowInList"]) == "1";
|
||||
group.GroupPicture = UUID.Parse((string)groupProfile["InsigniaID"]);
|
||||
group.MembershipFee = int.Parse((string)groupProfile["MembershipFee"]);
|
||||
group.OpenEnrollment = ((string)groupProfile["OpenEnrollment"]) == "1";
|
||||
group.AllowPublish = ((string)groupProfile["AllowPublish"]) == "1";
|
||||
group.MaturePublish = ((string)groupProfile["MaturePublish"]) == "1";
|
||||
group.FounderID = UUID.Parse((string)groupProfile["FounderID"]);
|
||||
group.OwnerRoleID = UUID.Parse((string)groupProfile["OwnerRoleID"]);
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
|
||||
{
|
||||
|
@ -579,40 +615,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
}
|
||||
|
||||
private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
|
||||
{
|
||||
GroupMembershipData data = new GroupMembershipData();
|
||||
data.AcceptNotices = ((string)respData["AcceptNotices"] == "1");
|
||||
data.Contribution = int.Parse((string)respData["Contribution"]);
|
||||
data.ListInProfile = ((string)respData["ListInProfile"] == "1");
|
||||
|
||||
data.ActiveRole = new UUID((string)respData["SelectedRoleID"]);
|
||||
data.GroupTitle = (string)respData["Title"];
|
||||
|
||||
data.GroupPowers = ulong.Parse((string)respData["GroupPowers"]);
|
||||
|
||||
// Is this group the agent's active group
|
||||
|
||||
data.GroupID = new UUID((string)respData["GroupID"]);
|
||||
|
||||
UUID ActiveGroup = new UUID((string)respData["ActiveGroupID"]);
|
||||
data.Active = data.GroupID.Equals(ActiveGroup);
|
||||
|
||||
data.AllowPublish = ((string)respData["AllowPublish"] == "1");
|
||||
if (respData["Charter"] != null)
|
||||
{
|
||||
data.Charter = (string)respData["Charter"];
|
||||
}
|
||||
data.FounderID = new UUID((string)respData["FounderID"]);
|
||||
data.GroupID = new UUID((string)respData["GroupID"]);
|
||||
data.GroupName = (string)respData["GroupName"];
|
||||
data.GroupPicture = new UUID((string)respData["InsigniaID"]);
|
||||
data.MaturePublish = ((string)respData["MaturePublish"] == "1");
|
||||
data.MembershipFee = int.Parse((string)respData["MembershipFee"]);
|
||||
data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1");
|
||||
data.ShowInList = ((string)respData["ShowInList"] == "1");
|
||||
return data;
|
||||
}
|
||||
|
||||
public List<GroupMembersData> GetGroupMembers(GroupRequestID requestID, UUID GroupID)
|
||||
{
|
||||
|
@ -744,7 +747,96 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
|
||||
XmlRpcCall(requestID, "groups.addGroupNotice", param);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region XmlRpcHashtableMarshalling
|
||||
private GroupProfileData GroupProfileHashtableToGroupProfileData(Hashtable groupProfile)
|
||||
{
|
||||
GroupProfileData group = new GroupProfileData();
|
||||
group.GroupID = UUID.Parse((string)groupProfile["GroupID"]);
|
||||
group.Name = (string)groupProfile["Name"];
|
||||
|
||||
if (groupProfile["Charter"] != null)
|
||||
{
|
||||
group.Charter = (string)groupProfile["Charter"];
|
||||
}
|
||||
|
||||
group.ShowInList = ((string)groupProfile["ShowInList"]) == "1";
|
||||
group.InsigniaID = UUID.Parse((string)groupProfile["InsigniaID"]);
|
||||
group.MembershipFee = int.Parse((string)groupProfile["MembershipFee"]);
|
||||
group.OpenEnrollment = ((string)groupProfile["OpenEnrollment"]) == "1";
|
||||
group.AllowPublish = ((string)groupProfile["AllowPublish"]) == "1";
|
||||
group.MaturePublish = ((string)groupProfile["MaturePublish"]) == "1";
|
||||
group.FounderID = UUID.Parse((string)groupProfile["FounderID"]);
|
||||
group.OwnerRole = UUID.Parse((string)groupProfile["OwnerRoleID"]);
|
||||
|
||||
group.GroupMembershipCount = int.Parse((string)groupProfile["GroupMembershipCount"]);
|
||||
group.GroupRolesCount = int.Parse((string)groupProfile["GroupRolesCount"]);
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile)
|
||||
{
|
||||
|
||||
GroupRecord group = new GroupRecord();
|
||||
group.GroupID = UUID.Parse((string)groupProfile["GroupID"]);
|
||||
group.GroupName = groupProfile["Name"].ToString();
|
||||
if (groupProfile["Charter"] != null)
|
||||
{
|
||||
group.Charter = (string)groupProfile["Charter"];
|
||||
}
|
||||
group.ShowInList = ((string)groupProfile["ShowInList"]) == "1";
|
||||
group.GroupPicture = UUID.Parse((string)groupProfile["InsigniaID"]);
|
||||
group.MembershipFee = int.Parse((string)groupProfile["MembershipFee"]);
|
||||
group.OpenEnrollment = ((string)groupProfile["OpenEnrollment"]) == "1";
|
||||
group.AllowPublish = ((string)groupProfile["AllowPublish"]) == "1";
|
||||
group.MaturePublish = ((string)groupProfile["MaturePublish"]) == "1";
|
||||
group.FounderID = UUID.Parse((string)groupProfile["FounderID"]);
|
||||
group.OwnerRoleID = UUID.Parse((string)groupProfile["OwnerRoleID"]);
|
||||
|
||||
return group;
|
||||
}
|
||||
private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
|
||||
{
|
||||
GroupMembershipData data = new GroupMembershipData();
|
||||
data.AcceptNotices = ((string)respData["AcceptNotices"] == "1");
|
||||
data.Contribution = int.Parse((string)respData["Contribution"]);
|
||||
data.ListInProfile = ((string)respData["ListInProfile"] == "1");
|
||||
|
||||
data.ActiveRole = new UUID((string)respData["SelectedRoleID"]);
|
||||
data.GroupTitle = (string)respData["Title"];
|
||||
|
||||
data.GroupPowers = ulong.Parse((string)respData["GroupPowers"]);
|
||||
|
||||
// Is this group the agent's active group
|
||||
|
||||
data.GroupID = new UUID((string)respData["GroupID"]);
|
||||
|
||||
UUID ActiveGroup = new UUID((string)respData["ActiveGroupID"]);
|
||||
data.Active = data.GroupID.Equals(ActiveGroup);
|
||||
|
||||
data.AllowPublish = ((string)respData["AllowPublish"] == "1");
|
||||
if (respData["Charter"] != null)
|
||||
{
|
||||
data.Charter = (string)respData["Charter"];
|
||||
}
|
||||
data.FounderID = new UUID((string)respData["FounderID"]);
|
||||
data.GroupID = new UUID((string)respData["GroupID"]);
|
||||
data.GroupName = (string)respData["GroupName"];
|
||||
data.GroupPicture = new UUID((string)respData["InsigniaID"]);
|
||||
data.MaturePublish = ((string)respData["MaturePublish"] == "1");
|
||||
data.MembershipFee = int.Parse((string)respData["MembershipFee"]);
|
||||
data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1");
|
||||
data.ShowInList = ((string)respData["ShowInList"] == "1");
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Encapsulate the XmlRpc call to standardize security and error handling.
|
||||
/// </summary>
|
||||
private Hashtable XmlRpcCall(GroupRequestID requestID, string function, Hashtable param)
|
||||
{
|
||||
if (requestID == null)
|
||||
|
@ -846,6 +938,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class GroupNoticeInfo
|
|
@ -10,8 +10,6 @@
|
|||
<Extension path = "/OpenSim/RegionModules">
|
||||
<RegionModule id="IRCBridge" type="OpenSim.Region.OptionalModules.Avatar.Chat.IRCBridgeModule" />
|
||||
<RegionModule id="Concierge" type="OpenSim.Region.OptionalModules.Avatar.Concierge.ConciergeModule" />
|
||||
<RegionModule id="XmlRpcGroups" type="OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.XmlRpcGroupsModule" />
|
||||
<RegionModule id="XmlRpcGroupsMessaging" type="OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.XmlRpcGroupsMessaging" />
|
||||
<RegionModule id="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" />
|
||||
</Extension>
|
||||
</Addin>
|
||||
|
|
|
@ -1271,21 +1271,28 @@
|
|||
; The PHP code for the server is available from the Flotsam project for you to deploy
|
||||
; to your own server. The Flotsam project is located at http://code.google.com/p/flotsam/
|
||||
;
|
||||
;Module = XmlRpcGroups
|
||||
;Module = GroupsModule
|
||||
|
||||
; Enable Group Notices
|
||||
;NoticesEnabled = true
|
||||
|
||||
;XmlRpcServiceURL = http://yourxmlrpcserver.com/xmlrpc.php
|
||||
;XmlRpcServiceReadKey = 1234
|
||||
;XmlRpcServiceWriteKey = 1234
|
||||
; This makes the Groups modules very chatty on the console.
|
||||
;DebugEnabled = true
|
||||
|
||||
;XmlRpcMessagingEnabled = true
|
||||
;XmlRpcNoticesEnabled = true
|
||||
; Specify which messaging module to use for groups messaging and if it's enabled
|
||||
;MessagingModule = GroupsMessagingModule
|
||||
;MessagingEnabled = true
|
||||
|
||||
; This makes the XmlRpcGroups modules very chatty on the console.
|
||||
;XmlRpcDebugEnabled = true
|
||||
; Service connector to Groups Service [Select One]
|
||||
; XmlRpc Service Connector to the Flotsam XmlRpc Groups Service Implementation
|
||||
;ServicesConnectorModule = XmlRpcGroupsServicesConnector
|
||||
;XmlRpcServiceURL = http://yourxmlrpcserver.com/xmlrpc.php
|
||||
;XmlRpcServiceReadKey = 1234
|
||||
;XmlRpcServiceWriteKey = 1234
|
||||
|
||||
; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for
|
||||
; a problem discovered on some Windows based region servers. Only disable
|
||||
; if you see a large number (dozens) of the following Exceptions:
|
||||
; Disables HTTP Keep-Alive for XmlRpcGroupsServicesConnector HTTP Requests,
|
||||
; this is a work around fora problem discovered on some Windows based region servers.
|
||||
; Only disable keep alive if you see a large number (dozens) of the following Exceptions:
|
||||
; System.Net.WebException: The request was aborted: The request was canceled.
|
||||
;
|
||||
; XmlRpcDisableKeepAlive = false
|
||||
|
|
Loading…
Reference in New Issue