Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim

arthursv
Melanie 2009-08-07 19:01:27 +01:00
commit 7811bceb8f
11 changed files with 272 additions and 149 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.svn
.project .project
.settings .settings
*.csproj *.csproj

View File

@ -31,6 +31,7 @@ using System.Reflection;
using log4net; using log4net;
using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
@ -46,7 +47,8 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 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); 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; 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_agentsInGroupSession = new Dictionary<Guid, List<Guid>>();
public Dictionary<Guid, List<Guid>> m_agentsDroppedSession = 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 else
{ {
if (!groupsConfig.GetBoolean("Enabled", false)) // if groups aren't enabled, we're not needed.
{ // if we're not specified as the connector to use, then we're not wanted
return; if ((groupsConfig.GetBoolean("Enabled", false) == false)
} || (groupsConfig.GetString("MessagingModule", "Default") != Name))
if (groupsConfig.GetString("Module", "Default") != "XmlRpcGroups")
{ {
m_groupMessagingEnabled = false; m_groupMessagingEnabled = false;
return; return;
} }
m_groupMessagingEnabled = groupsConfig.GetBoolean("XmlRpcMessagingEnabled", true); m_groupMessagingEnabled = groupsConfig.GetBoolean("MessagingEnabled", true);
if (!m_groupMessagingEnabled) if (!m_groupMessagingEnabled)
{ {
return; 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 // No groups module, no groups messaging
if (m_groupsModule == null) 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(); Close();
m_groupMessagingEnabled = false; m_groupMessagingEnabled = false;
return; return;
@ -163,7 +162,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (!m_groupMessagingEnabled) if (!m_groupMessagingEnabled)
return; 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) foreach (Scene scene in m_sceneList)
{ {
@ -184,7 +183,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public string Name public string Name
{ {
get { return "XmlRpcGroupsMessaging"; } get { return "GroupsMessagingModule"; }
} }
#endregion #endregion

View File

@ -31,6 +31,7 @@ using System.Reflection;
using System.Timers; using System.Timers;
using log4net; using log4net;
using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
@ -49,20 +50,26 @@ using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{ {
public class XmlRpcGroupsModule : ISharedRegionModule, IGroupsModule [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class GroupsModule : ISharedRegionModule, IGroupsModule
{ {
/// <summary> /// <summary>
/// ; To use this module, you must specify the following in your OpenSim.ini /// ; To use this module, you must specify the following in your OpenSim.ini
/// [GROUPS] /// [GROUPS]
/// Enabled = true /// Enabled = true
/// Module = XmlRpcGroups ///
/// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php /// Module = GroupsModule
/// XmlRpcMessagingEnabled = true /// NoticesEnabled = true
/// XmlRpcNoticesEnabled = true /// DebugEnabled = true
/// XmlRpcDebugEnabled = true ///
/// XmlRpcServiceReadKey = 1234 /// GroupsServicesConnectorModule = XmlRpcGroupsServicesConnector
/// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php
/// XmlRpcServiceReadKey = 1234
/// XmlRpcServiceWriteKey = 1234 /// XmlRpcServiceWriteKey = 1234
/// ///
/// MessagingModule = GroupsMessagingModule
/// MessagingEnabled = true
///
/// ; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for /// ; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for
/// ; a problem discovered on some Windows based region servers. Only disable /// ; a problem discovered on some Windows based region servers. Only disable
/// ; if you see a large number (dozens) of the following Exceptions: /// ; 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 IMessageTransferModule m_msgTransferModule = null;
private IGroupDataProvider m_groupData = null; private IGroupsServicesConnector m_groupData = null;
class GroupRequestIDInfo class GroupRequestIDInfo
{ {
@ -91,7 +98,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Configuration settings // Configuration settings
private const string m_defaultXmlRpcServiceURL = "http://osflotsam.org/xmlrpc.php";
private bool m_groupsEnabled = false; private bool m_groupsEnabled = false;
private bool m_groupNoticesEnabled = true; private bool m_groupNoticesEnabled = true;
private bool m_debugEnabled = true; private bool m_debugEnabled = true;
@ -115,7 +121,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return; return;
} }
if (groupsConfig.GetString("Module", "Default") != "XmlRpcGroups") if (groupsConfig.GetString("Module", "Default") != Name)
{ {
m_groupsEnabled = false; m_groupsEnabled = false;
@ -124,17 +130,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name); m_log.InfoFormat("[GROUPS]: Initializing {0}", this.Name);
string ServiceURL = groupsConfig.GetString("XmlRpcServiceURL", m_defaultXmlRpcServiceURL); m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
bool DisableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false); m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
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_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut; m_clientRequestIDFlushTimer.Interval = m_clientRequestIDFlushTimeOut;
m_clientRequestIDFlushTimer.Elapsed += FlushClientRequestIDInfoCache; 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_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) if (m_msgTransferModule == null)
{ {
m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
@ -218,7 +229,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (!m_groupsEnabled) if (!m_groupsEnabled)
return; 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(); m_clientRequestIDFlushTimer.Stop();
} }
@ -230,7 +241,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public string Name public string Name
{ {
get { return "XmlRpcGroupsModule"; } get { return "GroupsModule"; }
} }
#endregion #endregion

View File

@ -34,7 +34,7 @@ using OpenSim.Framework;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 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); 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); void UpdateGroup(GroupRequestID requestID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);

View File

@ -29,27 +29,27 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
//using System.Text;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using log4net; using log4net;
// using Nini.Config; using Mono.Addins;
using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
//using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 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 = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_serviceURL = string.Empty;
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
GroupPowers.Accountable | GroupPowers.Accountable |
@ -59,26 +59,108 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
GroupPowers.StartProposal | GroupPowers.StartProposal |
GroupPowers.VoteOnProposal; GroupPowers.VoteOnProposal;
private bool m_connectorEnabled = false;
private string m_serviceURL = string.Empty;
private bool m_disableKeepAlive = false; private bool m_disableKeepAlive = false;
private string m_groupReadKey = string.Empty; private string m_groupReadKey = string.Empty;
private string m_groupWriteKey = 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(); get { return "XmlRpcGroupsServicesConnector"; }
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;
} }
// 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> /// <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. /// 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> /// </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) 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) public List<GroupMembersData> GetGroupMembers(GroupRequestID requestID, UUID GroupID)
{ {
@ -744,7 +747,96 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
XmlRpcCall(requestID, "groups.addGroupNotice", param); 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) private Hashtable XmlRpcCall(GroupRequestID requestID, string function, Hashtable param)
{ {
if (requestID == null) if (requestID == null)
@ -846,6 +938,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
} }
} }
} }
public class GroupNoticeInfo public class GroupNoticeInfo

View File

@ -10,8 +10,6 @@
<Extension path = "/OpenSim/RegionModules"> <Extension path = "/OpenSim/RegionModules">
<RegionModule id="IRCBridge" type="OpenSim.Region.OptionalModules.Avatar.Chat.IRCBridgeModule" /> <RegionModule id="IRCBridge" type="OpenSim.Region.OptionalModules.Avatar.Chat.IRCBridgeModule" />
<RegionModule id="Concierge" type="OpenSim.Region.OptionalModules.Avatar.Concierge.ConciergeModule" /> <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" /> <RegionModule id="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" />
</Extension> </Extension>
</Addin> </Addin>

View File

@ -81,6 +81,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public int Type { get { return m_privateItem.Type; } } public int Type { get { return m_privateItem.Type; } }
public UUID AssetID { get { return m_privateItem.AssetID; } } public UUID AssetID { get { return m_privateItem.AssetID; } }
// This method exposes OpenSim/OpenMetaverse internals and needs to be replaced with a IAsset specific to MRM.
public T RetreiveAsset<T>() where T : OpenMetaverse.Assets.Asset, new() public T RetreiveAsset<T>() where T : OpenMetaverse.Assets.Asset, new()
{ {
AssetBase a = m_rootSceene.AssetService.Get(AssetID.ToString()); AssetBase a = m_rootSceene.AssetService.Get(AssetID.ToString());

View File

@ -73,6 +73,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (!source.Configs["MRM"].GetBoolean("Hidden", false)) if (!source.Configs["MRM"].GetBoolean("Hidden", false))
{ {
scene.EventManager.OnRezScript += EventManager_OnRezScript; scene.EventManager.OnRezScript += EventManager_OnRezScript;
scene.EventManager.OnStopScript += EventManager_OnStopScript;
} }
scene.EventManager.OnFrame += EventManager_OnFrame; scene.EventManager.OnFrame += EventManager_OnFrame;
@ -90,6 +91,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
} }
} }
void EventManager_OnStopScript(uint localID, UUID itemID)
{
if(m_scripts.ContainsKey(itemID))
{
m_scripts[itemID].Stop();
}
}
void EventManager_OnFrame() void EventManager_OnFrame()
{ {
m_microthreads.Tick(1000); m_microthreads.Tick(1000);

View File

@ -2,4 +2,6 @@
<dllmap os="osx" dll="ode" target="libode.dylib" /> <dllmap os="osx" dll="ode" target="libode.dylib" />
<dllmap os="!windows,osx" cpu="x86-64,ia64" dll="ode" target="libode-x86_64" /> <dllmap os="!windows,osx" cpu="x86-64,ia64" dll="ode" target="libode-x86_64" />
<dllmap os="!windows,osx" cpu="x86" dll="ode" target="libode" /> <dllmap os="!windows,osx" cpu="x86" dll="ode" target="libode" />
<dllmap os="!windows,osx" cpu="ppc64" dll="ode" target="libode-ppc64" />
<dllmap os="!windows,osx" cpu="s390x" dll="ode" target="libode-s390x" />
</configuration> </configuration>

View File

@ -2,4 +2,6 @@
<dllmap os="osx" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib" /> <dllmap os="osx" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib" />
<dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64" /> <dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64" />
<dllmap os="!windows,osx" cpu="x86" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1" /> <dllmap os="!windows,osx" cpu="x86" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1" />
<dllmap os="!windows,osx" cpu="s390x" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-s390x" />
<dllmap os="!windows,osx" cpu="ppc64" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-ppc64" />
</configuration> </configuration>

View File

@ -1271,21 +1271,28 @@
; The PHP code for the server is available from the Flotsam project for you to deploy ; 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/ ; to your own server. The Flotsam project is located at http://code.google.com/p/flotsam/
; ;
;Module = XmlRpcGroups ;Module = GroupsModule
;XmlRpcServiceURL = http://yourxmlrpcserver.com/xmlrpc.php ; Enable Group Notices
;XmlRpcServiceReadKey = 1234 ;NoticesEnabled = true
;XmlRpcServiceWriteKey = 1234
;XmlRpcMessagingEnabled = true ; This makes the Groups modules very chatty on the console.
;XmlRpcNoticesEnabled = true ;DebugEnabled = true
; This makes the XmlRpcGroups modules very chatty on the console. ; Specify which messaging module to use for groups messaging and if it's enabled
;XmlRpcDebugEnabled = true ;MessagingModule = GroupsMessagingModule
;MessagingEnabled = true
; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for ; Service connector to Groups Service [Select One]
; a problem discovered on some Windows based region servers. Only disable ; XmlRpc Service Connector to the Flotsam XmlRpc Groups Service Implementation
; if you see a large number (dozens) of the following Exceptions: ;ServicesConnectorModule = XmlRpcGroupsServicesConnector
;XmlRpcServiceURL = http://yourxmlrpcserver.com/xmlrpc.php
;XmlRpcServiceReadKey = 1234
;XmlRpcServiceWriteKey = 1234
; 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. ; System.Net.WebException: The request was aborted: The request was canceled.
; ;
; XmlRpcDisableKeepAlive = false ; XmlRpcDisableKeepAlive = false