From cfca9e1e811f6cdea6b7c3338f7f783a07f8e0ac Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:20:13 +0000 Subject: Revert "Updates all IRegionModules to the new style region modules." This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf. --- .../AssetTransaction/AssetTransactionModule.cs | 35 +++++-------------- .../Agent/Capabilities/CapabilitiesModule.cs | 2 +- .../Region/CoreModules/Agent/IPBan/IPBanModule.cs | 40 +++++++--------------- .../Agent/TextureDownload/TextureDownloadModule.cs | 33 ++++++------------ .../Agent/TextureSender/J2KDecoderModule.cs | 33 ++++-------------- .../Region/CoreModules/Agent/Xfer/XferModule.cs | 30 +++++----------- 6 files changed, 47 insertions(+), 126 deletions(-) (limited to 'OpenSim/Region/CoreModules/Agent') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7012037..1077f4a 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions + public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions { private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; @@ -61,14 +59,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction //m_log.Debug("creating AgentAssetTransactionModule"); } - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -86,23 +79,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_scene = scene; } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - RegisteredScenes.Remove(scene.RegionInfo.RegionID); - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= NewClient; - } - public void PostInitialise() { } @@ -116,6 +92,11 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 886173f..2a1355b 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); + m_scene.UnregisterModuleInterface(this); } public void PostInitialise() {} diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index f7f2eff..bfe2a71 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -37,27 +36,21 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.IPBan { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class IPBanModule : ISharedRegionModule + public class IPBanModule : IRegionModule { - #region Implementation of ISharedRegionModule + #region Implementation of IRegionModule private List m_bans = new List(); - private Dictionary SceneBanners = new Dictionary(); - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { - } - - public void AddRegion(Scene scene) - { - SceneBanners.Add(scene, new SceneBanner(scene, m_bans)); + new SceneBanner(scene, m_bans); lock (m_bans) { foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) { - if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) + if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) m_bans.Add(ban.BannedHostIPMask); if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) m_bans.Add(ban.BannedHostNameMask); @@ -65,12 +58,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (File.Exists("bans.txt")) { @@ -82,18 +70,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void RemoveRegion(Scene scene) - { - if(SceneBanners.ContainsKey(scene)) - SceneBanners.Remove(scene); - } - - public void PostInitialise() - { - } - public void Close() { + } public string Name @@ -101,6 +80,11 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan get { return "IPBanModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index c4d84cb..71ff28c 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -42,8 +41,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.TextureDownload { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class TextureDownloadModule : INonSharedRegionModule + public class TextureDownloadModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -67,14 +65,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) { //m_log.Debug("Creating Texture download module"); @@ -95,23 +90,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - if(m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= NewClient; - scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence; - } - public void Close() { } @@ -121,6 +103,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload get { return "TextureDownloadModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index ff87493..7ac8bed 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -32,7 +32,6 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -46,8 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { public delegate void J2KDecodeDelegate(UUID assetID); - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder + public class J2KDecoderModule : IRegionModule, IJ2KDecoder { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -60,19 +58,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// Reference to a scene (doesn't matter which one as long as it can load the cache module) private Scene m_scene; - #region ISharedRegionModule + #region IRegionModule public string Name { get { return "J2KDecoderModule"; } } - - public J2KDecoderModule() - { - } + public bool IsSharedModule { get { return true; } } - public void Initialise(IConfigSource source) + public J2KDecoderModule() { } - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_scene == null) m_scene = scene; @@ -80,30 +75,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - m_cache = m_scene.RequestModuleInterface(); - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - public void PostInitialise() { + m_cache = m_scene.RequestModuleInterface(); } public void Close() { } - #endregion + #endregion IRegionModule #region IJ2KDecoder diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index d062361..ef7dce8 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.Xfer { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XferModule : INonSharedRegionModule, IXfer + public class XferModule : IRegionModule, IXfer { private Scene m_scene; private Dictionary Requests = new Dictionary(); @@ -54,13 +52,9 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public DateTime timeStamp; } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; @@ -68,21 +62,10 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer m_scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= NewClient; - scene.UnregisterModuleInterface(this); - } - public void Close() { } @@ -92,6 +75,11 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer get { return "XferModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion #region IXfer Members -- cgit v1.1