diff options
author | Diva Canto | 2012-11-11 14:54:40 -0800 |
---|---|---|
committer | Diva Canto | 2012-11-11 14:54:40 -0800 |
commit | 9f45198516ef7c7bfc92d638ae142d821852a4d9 (patch) | |
tree | dfc803e41604181b402a3fd1583506a49b26fc06 /OpenSim/Region | |
parent | One more module converted: LoadImageURLModule. Also removed it from its hard-... (diff) | |
download | opensim-SC-9f45198516ef7c7bfc92d638ae142d821852a4d9.zip opensim-SC-9f45198516ef7c7bfc92d638ae142d821852a4d9.tar.gz opensim-SC-9f45198516ef7c7bfc92d638ae142d821852a4d9.tar.bz2 opensim-SC-9f45198516ef7c7bfc92d638ae142d821852a4d9.tar.xz |
One more module: DynamicTextureModule. Removed it from the special load in the beginning.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 93a045e..9d90517 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; | |||
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using log4net; | 38 | using log4net; |
39 | using System.Reflection; | 39 | using System.Reflection; |
40 | using Mono.Addins; | ||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | 42 | namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture |
42 | { | 43 | { |
43 | public class DynamicTextureModule : IRegionModule, IDynamicTextureManager | 44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicTextureModule")] |
45 | public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager | ||
44 | { | 46 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 48 | ||
@@ -323,17 +325,30 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
323 | 325 | ||
324 | #endregion | 326 | #endregion |
325 | 327 | ||
326 | #region IRegionModule Members | 328 | #region ISharedRegionModule Members |
327 | 329 | ||
328 | public void Initialise(Scene scene, IConfigSource config) | 330 | public void Initialise(IConfigSource config) |
329 | { | 331 | { |
330 | IConfig texturesConfig = config.Configs["Textures"]; | 332 | IConfig texturesConfig = config.Configs["Textures"]; |
331 | if (texturesConfig != null) | 333 | if (texturesConfig != null) |
332 | { | 334 | { |
333 | ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false); | 335 | ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false); |
334 | ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false); | 336 | ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false); |
337 | |||
338 | if (ReuseTextures) | ||
339 | { | ||
340 | m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative); | ||
341 | m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0); | ||
342 | } | ||
335 | } | 343 | } |
344 | } | ||
345 | |||
346 | public void PostInitialise() | ||
347 | { | ||
348 | } | ||
336 | 349 | ||
350 | public void AddRegion(Scene scene) | ||
351 | { | ||
337 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) | 352 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) |
338 | { | 353 | { |
339 | RegisteredScenes.Add(scene.RegionInfo.RegionID, scene); | 354 | RegisteredScenes.Add(scene.RegionInfo.RegionID, scene); |
@@ -341,13 +356,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
341 | } | 356 | } |
342 | } | 357 | } |
343 | 358 | ||
344 | public void PostInitialise() | 359 | public void RegionLoaded(Scene scene) |
345 | { | 360 | { |
346 | if (ReuseTextures) | 361 | } |
347 | { | 362 | |
348 | m_reuseableDynamicTextures = new Cache(CacheMedium.Memory, CacheStrategy.Conservative); | 363 | public void RemoveRegion(Scene scene) |
349 | m_reuseableDynamicTextures.DefaultTTL = new TimeSpan(24, 0, 0); | 364 | { |
350 | } | 365 | if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) |
366 | RegisteredScenes.Remove(scene.RegionInfo.RegionID); | ||
351 | } | 367 | } |
352 | 368 | ||
353 | public void Close() | 369 | public void Close() |
@@ -359,9 +375,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
359 | get { return "DynamicTextureModule"; } | 375 | get { return "DynamicTextureModule"; } |
360 | } | 376 | } |
361 | 377 | ||
362 | public bool IsSharedModule | 378 | public Type ReplaceableInterface |
363 | { | 379 | { |
364 | get { return true; } | 380 | get { return null; } |
365 | } | 381 | } |
366 | 382 | ||
367 | #endregion | 383 | #endregion |