diff --git a/.gitignore b/.gitignore index 55f95fd71a..c5c6da3b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.svn .project .settings *.csproj diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs similarity index 95% rename from OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs rename to OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 4095041d13..0bfb8e7a61 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs @@ -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> m_agentsInGroupSession = new Dictionary>(); public Dictionary> m_agentsDroppedSession = new Dictionary>(); @@ -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 diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs similarity index 97% rename from OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs rename to OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 2cbc571aed..725c303edf 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -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 { /// /// ; 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(); + + // 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(); @@ -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 diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupDataProvider.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs similarity index 99% rename from OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupDataProvider.cs rename to OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index 302be4a213..9e0fa2de4a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupDataProvider.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs @@ -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); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs similarity index 91% rename from OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs rename to OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 1d4cde5ca3..d77fe5bb76 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupData.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -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(this); + } + + public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene) + { + if (scene.RequestModuleInterface() == this) + scene.UnregisterModuleInterface(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 + /// /// 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. /// @@ -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 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 + + /// + /// Encapsulate the XmlRpc call to standardize security and error handling. + /// 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 diff --git a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml index 4b7b39d44b..389044e775 100644 --- a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml +++ b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml @@ -10,8 +10,6 @@ - - diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs index 40693abe6f..5bf29d710c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/InventoryItem.cs @@ -81,6 +81,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule public int Type { get { return m_privateItem.Type; } } 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() where T : OpenMetaverse.Assets.Asset, new() { AssetBase a = m_rootSceene.AssetService.Get(AssetID.ToString()); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 53145e2d65..eb807f262c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -73,6 +73,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (!source.Configs["MRM"].GetBoolean("Hidden", false)) { scene.EventManager.OnRezScript += EventManager_OnRezScript; + scene.EventManager.OnStopScript += EventManager_OnStopScript; } 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() { m_microthreads.Tick(1000); diff --git a/bin/Ode.NET.dll.config b/bin/Ode.NET.dll.config index 58aad3f117..f8f071e8c6 100644 --- a/bin/Ode.NET.dll.config +++ b/bin/Ode.NET.dll.config @@ -2,4 +2,6 @@ + + \ No newline at end of file diff --git a/bin/OpenMetaverse.dll.config b/bin/OpenMetaverse.dll.config index 356b6a7d76..489ee6bcd7 100644 --- a/bin/OpenMetaverse.dll.config +++ b/bin/OpenMetaverse.dll.config @@ -2,4 +2,6 @@ + + diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index bd03652cc9..ff8fa5ff31 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -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