From 9f45198516ef7c7bfc92d638ae142d821852a4d9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 11 Nov 2012 14:54:40 -0800 Subject: [PATCH] One more module: DynamicTextureModule. Removed it from the special load in the beginning. --- .../LoadRegions/LoadRegionsPlugin.cs | 4 +- .../DynamicTexture/DynamicTextureModule.cs | 40 +++++++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index e7b12bee0e..920a6bcca5 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -99,8 +99,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules..."); - m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule..."); - m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); + //m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule..."); + //m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); //m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule..."); //m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule()); m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule..."); diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 93a045eff7..9d905174f9 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -37,10 +37,12 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using log4net; using System.Reflection; +using Mono.Addins; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { - public class DynamicTextureModule : IRegionModule, IDynamicTextureManager + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicTextureModule")] + public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -323,17 +325,30 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig texturesConfig = config.Configs["Textures"]; if (texturesConfig != null) { ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false); ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false); - } + if (ReuseTextures) + { + m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative); + m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0); + } + } + } + + public void PostInitialise() + { + } + + public void AddRegion(Scene scene) + { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { RegisteredScenes.Add(scene.RegionInfo.RegionID, scene); @@ -341,13 +356,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } } - public void PostInitialise() + public void RegionLoaded(Scene scene) { - if (ReuseTextures) - { - m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative); - m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0); - } + } + + public void RemoveRegion(Scene scene) + { + if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) + RegisteredScenes.Remove(scene.RegionInfo.RegionID); } public void Close() @@ -359,9 +375,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture get { return "DynamicTextureModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return true; } + get { return null; } } #endregion