aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2012-11-10 08:10:43 -0800
committerDiva Canto2012-11-10 08:10:43 -0800
commit791c4d5b9fe831cab3dd984184714e6e674918f9 (patch)
treeaf5354ddd9492cf58e8c829105f05af2dca8e511
parentOne more more converted: IPBanModule. (diff)
downloadopensim-SC_OLD-791c4d5b9fe831cab3dd984184714e6e674918f9.zip
opensim-SC_OLD-791c4d5b9fe831cab3dd984184714e6e674918f9.tar.gz
opensim-SC_OLD-791c4d5b9fe831cab3dd984184714e6e674918f9.tar.bz2
opensim-SC_OLD-791c4d5b9fe831cab3dd984184714e6e674918f9.tar.xz
One more module converted: J2KDecoderModule.
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml1
2 files changed, 33 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index a1a2501..2879154 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
45{ 45{
46 public delegate void J2KDecodeDelegate(UUID assetID); 46 public delegate void J2KDecodeDelegate(UUID assetID);
47 47
48 public class J2KDecoderModule : IRegionModule, IJ2KDecoder 48 public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder
49 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51 51
@@ -56,26 +56,21 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
56 /// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary> 56 /// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary>
57 private IImprovedAssetCache m_cache; 57 private IImprovedAssetCache m_cache;
58 /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary> 58 /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary>
59 private UUID m_CreatorID = UUID.Zero;
59 private Scene m_scene; 60 private Scene m_scene;
60 61
61 #region IRegionModule 62 #region ISharedRegionModule
62 63
63 private bool m_useCSJ2K = true; 64 private bool m_useCSJ2K = true;
64 65
65 public string Name { get { return "J2KDecoderModule"; } } 66 public string Name { get { return "J2KDecoderModule"; } }
66 public bool IsSharedModule { get { return true; } }
67 67
68 public J2KDecoderModule() 68 public J2KDecoderModule()
69 { 69 {
70 } 70 }
71 71
72 public void Initialise(Scene scene, IConfigSource source) 72 public void Initialise(IConfigSource source)
73 { 73 {
74 if (m_scene == null)
75 m_scene = scene;
76
77 scene.RegisterModuleInterface<IJ2KDecoder>(this);
78
79 IConfig startupConfig = source.Configs["Startup"]; 74 IConfig startupConfig = source.Configs["Startup"];
80 if (startupConfig != null) 75 if (startupConfig != null)
81 { 76 {
@@ -83,6 +78,24 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
83 } 78 }
84 } 79 }
85 80
81 public void AddRegion(Scene scene)
82 {
83 if (m_scene == null)
84 {
85 m_scene = scene;
86 m_CreatorID = scene.RegionInfo.RegionID;
87 }
88
89 scene.RegisterModuleInterface<IJ2KDecoder>(this);
90
91 }
92
93 public void RemoveRegion(Scene scene)
94 {
95 if (m_scene == scene)
96 m_scene = null;
97 }
98
86 public void PostInitialise() 99 public void PostInitialise()
87 { 100 {
88 m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); 101 m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
@@ -92,6 +105,15 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
92 { 105 {
93 } 106 }
94 107
108 public void RegionLoaded(Scene scene)
109 {
110 }
111
112 public Type ReplaceableInterface
113 {
114 get { return null; }
115 }
116
95 #endregion IRegionModule 117 #endregion IRegionModule
96 118
97 #region IJ2KDecoder 119 #region IJ2KDecoder
@@ -279,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
279 { 301 {
280 string assetID = "j2kCache_" + AssetId.ToString(); 302 string assetID = "j2kCache_" + AssetId.ToString();
281 303
282 AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_scene.RegionInfo.RegionID.ToString()); 304 AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_CreatorID.ToString());
283 layerDecodeAsset.Local = true; 305 layerDecodeAsset.Local = true;
284 layerDecodeAsset.Temporary = true; 306 layerDecodeAsset.Temporary = true;
285 307
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index 5a413a9..820f11b 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -43,6 +43,7 @@
43 <RegionModule id="MapSearchModule" type="OpenSim.Region.CoreModules.World.WorldMap.MapSearchModule"/> 43 <RegionModule id="MapSearchModule" type="OpenSim.Region.CoreModules.World.WorldMap.MapSearchModule"/>
44 <RegionModule id="VegetationModule" type="OpenSim.Region.CoreModules.Avatar.Vegetation.VegetationModule"/> 44 <RegionModule id="VegetationModule" type="OpenSim.Region.CoreModules.Avatar.Vegetation.VegetationModule"/>
45 <RegionModule id="IPBanModule" type="OpenSim.Region.CoreModules.Agent.IPBan.IPBanModule"/> 45 <RegionModule id="IPBanModule" type="OpenSim.Region.CoreModules.Agent.IPBan.IPBanModule"/>
46 <RegionModule id="J2KDecoderModule" type="OpenSim.Region.CoreModules.Agent.TextureSender.J2KDecoderModule"/>
46 <!-- Service connectors OUT modules --> 47 <!-- Service connectors OUT modules -->
47 <RegionModule id="LocalAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.LocalAssetServicesConnector" /> 48 <RegionModule id="LocalAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.LocalAssetServicesConnector" />
48 <RegionModule id="RemoteAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.RemoteAssetServicesConnector" /> 49 <RegionModule id="RemoteAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.RemoteAssetServicesConnector" />