diff options
author | BlueWall | 2012-11-25 17:03:14 -0500 |
---|---|---|
committer | BlueWall | 2012-11-25 17:03:14 -0500 |
commit | c754003944d0166bf50b4f94b0c0eea642503bb0 (patch) | |
tree | dfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Region/CoreModules/Agent | |
parent | Merge branch 'master' into connector_plugin (diff) | |
parent | Combine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff) | |
download | opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.zip opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2 opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz |
Merge branch 'master' into connector_plugin
Conflicts:
OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
4 files changed, 97 insertions, 35 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 73d1f72..e973652 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
54 | private Dictionary<UUID, AgentAssetTransactions> AgentTransactions = | 54 | private Dictionary<UUID, AgentAssetTransactions> AgentTransactions = |
55 | new Dictionary<UUID, AgentAssetTransactions>(); | 55 | new Dictionary<UUID, AgentAssetTransactions>(); |
56 | 56 | ||
57 | #region IRegionModule Members | 57 | #region Region Module interface |
58 | 58 | ||
59 | public void Initialise(IConfigSource source) | 59 | public void Initialise(IConfigSource source) |
60 | { | 60 | { |
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index bfe2a71..4b457b1 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Text; | 31 | using System.Text; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
@@ -36,13 +37,18 @@ using OpenSim.Region.Framework.Scenes; | |||
36 | 37 | ||
37 | namespace OpenSim.Region.CoreModules.Agent.IPBan | 38 | namespace OpenSim.Region.CoreModules.Agent.IPBan |
38 | { | 39 | { |
39 | public class IPBanModule : IRegionModule | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "IPBanModule")] |
41 | public class IPBanModule : ISharedRegionModule | ||
40 | { | 42 | { |
41 | #region Implementation of IRegionModule | 43 | #region Implementation of ISharedRegionModule |
42 | 44 | ||
43 | private List<string> m_bans = new List<string>(); | 45 | private List<string> m_bans = new List<string>(); |
44 | 46 | ||
45 | public void Initialise(Scene scene, IConfigSource source) | 47 | public void Initialise(IConfigSource source) |
48 | { | ||
49 | } | ||
50 | |||
51 | public void AddRegion(Scene scene) | ||
46 | { | 52 | { |
47 | new SceneBanner(scene, m_bans); | 53 | new SceneBanner(scene, m_bans); |
48 | 54 | ||
@@ -50,7 +56,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
50 | { | 56 | { |
51 | foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) | 57 | foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) |
52 | { | 58 | { |
53 | if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) | 59 | if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) |
54 | m_bans.Add(ban.BannedHostIPMask); | 60 | m_bans.Add(ban.BannedHostIPMask); |
55 | if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) | 61 | if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) |
56 | m_bans.Add(ban.BannedHostNameMask); | 62 | m_bans.Add(ban.BannedHostNameMask); |
@@ -58,6 +64,14 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
58 | } | 64 | } |
59 | } | 65 | } |
60 | 66 | ||
67 | public void RemoveRegion(Scene scene) | ||
68 | { | ||
69 | } | ||
70 | |||
71 | public void RegionLoaded(Scene scene) | ||
72 | { | ||
73 | } | ||
74 | |||
61 | public void PostInitialise() | 75 | public void PostInitialise() |
62 | { | 76 | { |
63 | if (File.Exists("bans.txt")) | 77 | if (File.Exists("bans.txt")) |
@@ -80,9 +94,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
80 | get { return "IPBanModule"; } | 94 | get { return "IPBanModule"; } |
81 | } | 95 | } |
82 | 96 | ||
83 | public bool IsSharedModule | 97 | public Type ReplaceableInterface |
84 | { | 98 | { |
85 | get { return true; } | 99 | get { return null; } |
86 | } | 100 | } |
87 | 101 | ||
88 | #endregion | 102 | #endregion |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index a1a2501..3764685 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -32,6 +32,7 @@ using System.Reflection; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using OpenMetaverse; | 37 | using OpenMetaverse; |
37 | using OpenMetaverse.Imaging; | 38 | using OpenMetaverse.Imaging; |
@@ -45,7 +46,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
45 | { | 46 | { |
46 | public delegate void J2KDecodeDelegate(UUID assetID); | 47 | public delegate void J2KDecodeDelegate(UUID assetID); |
47 | 48 | ||
48 | public class J2KDecoderModule : IRegionModule, IJ2KDecoder | 49 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "J2KDecoderModule")] |
50 | public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder | ||
49 | { | 51 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 53 | ||
@@ -55,27 +57,32 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
55 | private readonly Dictionary<UUID, List<DecodedCallback>> m_notifyList = new Dictionary<UUID, List<DecodedCallback>>(); | 57 | private readonly Dictionary<UUID, List<DecodedCallback>> m_notifyList = new Dictionary<UUID, List<DecodedCallback>>(); |
56 | /// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary> | 58 | /// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary> |
57 | private IImprovedAssetCache m_cache; | 59 | private IImprovedAssetCache m_cache; |
60 | private IImprovedAssetCache Cache | ||
61 | { | ||
62 | get | ||
63 | { | ||
64 | if (m_cache == null) | ||
65 | m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | ||
66 | |||
67 | return m_cache; | ||
68 | } | ||
69 | } | ||
58 | /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary> | 70 | /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary> |
71 | private UUID m_CreatorID = UUID.Zero; | ||
59 | private Scene m_scene; | 72 | private Scene m_scene; |
60 | 73 | ||
61 | #region IRegionModule | 74 | #region ISharedRegionModule |
62 | 75 | ||
63 | private bool m_useCSJ2K = true; | 76 | private bool m_useCSJ2K = true; |
64 | 77 | ||
65 | public string Name { get { return "J2KDecoderModule"; } } | 78 | public string Name { get { return "J2KDecoderModule"; } } |
66 | public bool IsSharedModule { get { return true; } } | ||
67 | 79 | ||
68 | public J2KDecoderModule() | 80 | public J2KDecoderModule() |
69 | { | 81 | { |
70 | } | 82 | } |
71 | 83 | ||
72 | public void Initialise(Scene scene, IConfigSource source) | 84 | public void Initialise(IConfigSource source) |
73 | { | 85 | { |
74 | if (m_scene == null) | ||
75 | m_scene = scene; | ||
76 | |||
77 | scene.RegisterModuleInterface<IJ2KDecoder>(this); | ||
78 | |||
79 | IConfig startupConfig = source.Configs["Startup"]; | 86 | IConfig startupConfig = source.Configs["Startup"]; |
80 | if (startupConfig != null) | 87 | if (startupConfig != null) |
81 | { | 88 | { |
@@ -83,16 +90,42 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
83 | } | 90 | } |
84 | } | 91 | } |
85 | 92 | ||
93 | public void AddRegion(Scene scene) | ||
94 | { | ||
95 | if (m_scene == null) | ||
96 | { | ||
97 | m_scene = scene; | ||
98 | m_CreatorID = scene.RegionInfo.RegionID; | ||
99 | } | ||
100 | |||
101 | scene.RegisterModuleInterface<IJ2KDecoder>(this); | ||
102 | |||
103 | } | ||
104 | |||
105 | public void RemoveRegion(Scene scene) | ||
106 | { | ||
107 | if (m_scene == scene) | ||
108 | m_scene = null; | ||
109 | } | ||
110 | |||
86 | public void PostInitialise() | 111 | public void PostInitialise() |
87 | { | 112 | { |
88 | m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | ||
89 | } | 113 | } |
90 | 114 | ||
91 | public void Close() | 115 | public void Close() |
92 | { | 116 | { |
93 | } | 117 | } |
94 | 118 | ||
95 | #endregion IRegionModule | 119 | public void RegionLoaded(Scene scene) |
120 | { | ||
121 | } | ||
122 | |||
123 | public Type ReplaceableInterface | ||
124 | { | ||
125 | get { return null; } | ||
126 | } | ||
127 | |||
128 | #endregion Region Module interface | ||
96 | 129 | ||
97 | #region IJ2KDecoder | 130 | #region IJ2KDecoder |
98 | 131 | ||
@@ -275,11 +308,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
275 | { | 308 | { |
276 | m_decodedCache.AddOrUpdate(AssetId, Layers, TimeSpan.FromMinutes(10)); | 309 | m_decodedCache.AddOrUpdate(AssetId, Layers, TimeSpan.FromMinutes(10)); |
277 | 310 | ||
278 | if (m_cache != null) | 311 | if (Cache != null) |
279 | { | 312 | { |
280 | string assetID = "j2kCache_" + AssetId.ToString(); | 313 | string assetID = "j2kCache_" + AssetId.ToString(); |
281 | 314 | ||
282 | AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_scene.RegionInfo.RegionID.ToString()); | 315 | AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_CreatorID.ToString()); |
283 | layerDecodeAsset.Local = true; | 316 | layerDecodeAsset.Local = true; |
284 | layerDecodeAsset.Temporary = true; | 317 | layerDecodeAsset.Temporary = true; |
285 | 318 | ||
@@ -299,7 +332,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
299 | 332 | ||
300 | #endregion Serialize Layer Data | 333 | #endregion Serialize Layer Data |
301 | 334 | ||
302 | m_cache.Cache(layerDecodeAsset); | 335 | Cache.Cache(layerDecodeAsset); |
303 | } | 336 | } |
304 | } | 337 | } |
305 | 338 | ||
@@ -309,10 +342,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
309 | { | 342 | { |
310 | return true; | 343 | return true; |
311 | } | 344 | } |
312 | else if (m_cache != null) | 345 | else if (Cache != null) |
313 | { | 346 | { |
314 | string assetName = "j2kCache_" + AssetId.ToString(); | 347 | string assetName = "j2kCache_" + AssetId.ToString(); |
315 | AssetBase layerDecodeAsset = m_cache.Get(assetName); | 348 | AssetBase layerDecodeAsset = Cache.Get(assetName); |
316 | 349 | ||
317 | if (layerDecodeAsset != null) | 350 | if (layerDecodeAsset != null) |
318 | { | 351 | { |
@@ -324,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
324 | if (lines.Length == 0) | 357 | if (lines.Length == 0) |
325 | { | 358 | { |
326 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (empty) " + assetName); | 359 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (empty) " + assetName); |
327 | m_cache.Expire(assetName); | 360 | Cache.Expire(assetName); |
328 | return false; | 361 | return false; |
329 | } | 362 | } |
330 | 363 | ||
@@ -345,7 +378,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
345 | catch (FormatException) | 378 | catch (FormatException) |
346 | { | 379 | { |
347 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (format) " + assetName); | 380 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (format) " + assetName); |
348 | m_cache.Expire(assetName); | 381 | Cache.Expire(assetName); |
349 | return false; | 382 | return false; |
350 | } | 383 | } |
351 | 384 | ||
@@ -356,7 +389,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
356 | else | 389 | else |
357 | { | 390 | { |
358 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (layout) " + assetName); | 391 | m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (layout) " + assetName); |
359 | m_cache.Expire(assetName); | 392 | Cache.Expire(assetName); |
360 | return false; | 393 | return false; |
361 | } | 394 | } |
362 | } | 395 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index b8e2820..4299726 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | |||
@@ -35,9 +35,12 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | 37 | ||
38 | using Mono.Addins; | ||
39 | |||
38 | namespace OpenSim.Region.CoreModules.Agent.Xfer | 40 | namespace OpenSim.Region.CoreModules.Agent.Xfer |
39 | { | 41 | { |
40 | public class XferModule : IRegionModule, IXfer | 42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XferModule")] |
43 | public class XferModule : INonSharedRegionModule, IXfer | ||
41 | { | 44 | { |
42 | private Scene m_scene; | 45 | private Scene m_scene; |
43 | private Dictionary<string, FileData> NewFiles = new Dictionary<string, FileData>(); | 46 | private Dictionary<string, FileData> NewFiles = new Dictionary<string, FileData>(); |
@@ -59,9 +62,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
59 | public int Count; | 62 | public int Count; |
60 | } | 63 | } |
61 | 64 | ||
62 | #region IRegionModule Members | 65 | #region INonSharedRegionModule Members |
66 | |||
67 | public void Initialise(IConfigSource config) | ||
68 | { | ||
69 | } | ||
63 | 70 | ||
64 | public void Initialise(Scene scene, IConfigSource config) | 71 | public void AddRegion(Scene scene) |
65 | { | 72 | { |
66 | m_scene = scene; | 73 | m_scene = scene; |
67 | m_scene.EventManager.OnNewClient += NewClient; | 74 | m_scene.EventManager.OnNewClient += NewClient; |
@@ -69,22 +76,30 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
69 | m_scene.RegisterModuleInterface<IXfer>(this); | 76 | m_scene.RegisterModuleInterface<IXfer>(this); |
70 | } | 77 | } |
71 | 78 | ||
72 | public void PostInitialise() | 79 | public void RemoveRegion(Scene scene) |
73 | { | 80 | { |
81 | m_scene.EventManager.OnNewClient -= NewClient; | ||
82 | |||
83 | m_scene.UnregisterModuleInterface<IXfer>(this); | ||
84 | m_scene = null; | ||
74 | } | 85 | } |
75 | 86 | ||
76 | public void Close() | 87 | public void RegionLoaded(Scene scene) |
77 | { | 88 | { |
78 | } | 89 | } |
79 | 90 | ||
80 | public string Name | 91 | public Type ReplaceableInterface |
81 | { | 92 | { |
82 | get { return "XferModule"; } | 93 | get { return null; } |
83 | } | 94 | } |
84 | 95 | ||
85 | public bool IsSharedModule | 96 | public void Close() |
86 | { | 97 | { |
87 | get { return false; } | 98 | } |
99 | |||
100 | public string Name | ||
101 | { | ||
102 | get { return "XferModule"; } | ||
88 | } | 103 | } |
89 | 104 | ||
90 | #endregion | 105 | #endregion |