aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Agent
diff options
context:
space:
mode:
authorRevolution2010-01-22 18:09:33 -0600
committerMelanie2010-01-23 15:18:52 +0000
commitec3c31e61e5e540f822891110df9bc978655bbaf (patch)
treeb0b34a239eab48e163a3ca064edcd7567948423c /OpenSim/Region/CoreModules/Agent
parentadd a target position to agent updates to ScenePresence to support alternativ... (diff)
downloadopensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.zip
opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.gz
opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.bz2
opensim-SC-ec3c31e61e5e540f822891110df9bc978655bbaf.tar.xz
Updates all IRegionModules to the new style region modules.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs35
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs40
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs33
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs33
-rw-r--r--OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs30
6 files changed, 126 insertions, 47 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
index 1077f4a..7012037 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Mono.Addins;
30using Nini.Config; 31using Nini.Config;
31using OpenMetaverse; 32using OpenMetaverse;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes;
35 36
36namespace OpenSim.Region.CoreModules.Agent.AssetTransaction 37namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
37{ 38{
38 public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions 39 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
40 public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions
39 { 41 {
40 private readonly Dictionary<UUID, Scene> RegisteredScenes = new Dictionary<UUID, Scene>(); 42 private readonly Dictionary<UUID, Scene> RegisteredScenes = new Dictionary<UUID, Scene>();
41 private bool m_dumpAssetsToFile = false; 43 private bool m_dumpAssetsToFile = false;
@@ -59,9 +61,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
59 //m_log.Debug("creating AgentAssetTransactionModule"); 61 //m_log.Debug("creating AgentAssetTransactionModule");
60 } 62 }
61 63
62 #region IRegionModule Members 64 #region ISharedRegionModule Members
63 65
64 public void Initialise(Scene scene, IConfigSource config) 66 public void Initialise(IConfigSource config)
67 {
68
69 }
70
71 public void AddRegion(Scene scene)
65 { 72 {
66 if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) 73 if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID))
67 { 74 {
@@ -79,6 +86,23 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
79 m_scene = scene; 86 m_scene = scene;
80 } 87 }
81 88
89 public Type ReplaceableInterface
90 {
91 get { return null; }
92 }
93
94 public void RegionLoaded(Scene scene)
95 {
96 }
97
98 public void RemoveRegion(Scene scene)
99 {
100 if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID))
101 RegisteredScenes.Remove(scene.RegionInfo.RegionID);
102 scene.UnregisterModuleInterface<IAgentAssetTransactions>(this);
103 scene.EventManager.OnNewClient -= NewClient;
104 }
105
82 public void PostInitialise() 106 public void PostInitialise()
83 { 107 {
84 } 108 }
@@ -92,11 +116,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
92 get { return "AgentTransactionModule"; } 116 get { return "AgentTransactionModule"; }
93 } 117 }
94 118
95 public bool IsSharedModule
96 {
97 get { return true; }
98 }
99
100 #endregion 119 #endregion
101 120
102 public void NewClient(IClientAPI client) 121 public void NewClient(IClientAPI client)
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index 2a1355b..886173f 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
69 69
70 public void RemoveRegion(Scene scene) 70 public void RemoveRegion(Scene scene)
71 { 71 {
72 m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this); 72 scene.UnregisterModuleInterface<ICapabilitiesModule>(this);
73 } 73 }
74 74
75 public void PostInitialise() {} 75 public void PostInitialise() {}
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs
index bfe2a71..f7f2eff 100644
--- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Text; 31using System.Text;
32using Mono.Addins;
32using Nini.Config; 33using Nini.Config;
33using OpenSim.Framework; 34using OpenSim.Framework;
34using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
@@ -36,21 +37,27 @@ using OpenSim.Region.Framework.Scenes;
36 37
37namespace OpenSim.Region.CoreModules.Agent.IPBan 38namespace OpenSim.Region.CoreModules.Agent.IPBan
38{ 39{
39 public class IPBanModule : IRegionModule 40 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
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>();
46 private Dictionary<Scene, SceneBanner> SceneBanners = new Dictionary<Scene, SceneBanner>();
44 47
45 public void Initialise(Scene scene, IConfigSource source) 48 public void Initialise(IConfigSource source)
46 { 49 {
47 new SceneBanner(scene, m_bans); 50 }
51
52 public void AddRegion(Scene scene)
53 {
54 SceneBanners.Add(scene, new SceneBanner(scene, m_bans));
48 55
49 lock (m_bans) 56 lock (m_bans)
50 { 57 {
51 foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) 58 foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans)
52 { 59 {
53 if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) 60 if (!String.IsNullOrEmpty(ban.BannedHostIPMask))
54 m_bans.Add(ban.BannedHostIPMask); 61 m_bans.Add(ban.BannedHostIPMask);
55 if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) 62 if (!String.IsNullOrEmpty(ban.BannedHostNameMask))
56 m_bans.Add(ban.BannedHostNameMask); 63 m_bans.Add(ban.BannedHostNameMask);
@@ -58,7 +65,12 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
58 } 65 }
59 } 66 }
60 67
61 public void PostInitialise() 68 public Type ReplaceableInterface
69 {
70 get { return null; }
71 }
72
73 public void RegionLoaded(Scene scene)
62 { 74 {
63 if (File.Exists("bans.txt")) 75 if (File.Exists("bans.txt"))
64 { 76 {
@@ -70,19 +82,23 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
70 } 82 }
71 } 83 }
72 84
73 public void Close() 85 public void RemoveRegion(Scene scene)
74 { 86 {
75 87 if(SceneBanners.ContainsKey(scene))
88 SceneBanners.Remove(scene);
76 } 89 }
77 90
78 public string Name 91 public void PostInitialise()
92 {
93 }
94
95 public void Close()
79 { 96 {
80 get { return "IPBanModule"; }
81 } 97 }
82 98
83 public bool IsSharedModule 99 public string Name
84 { 100 {
85 get { return true; } 101 get { return "IPBanModule"; }
86 } 102 }
87 103
88 #endregion 104 #endregion
diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs
index 71ff28c..c4d84cb 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading; 31using System.Threading;
32using log4net; 32using log4net;
33using Mono.Addins;
33using Nini.Config; 34using Nini.Config;
34using OpenMetaverse; 35using OpenMetaverse;
35using OpenSim.Framework; 36using OpenSim.Framework;
@@ -41,7 +42,8 @@ using OpenSim.Services.Interfaces;
41 42
42namespace OpenSim.Region.CoreModules.Agent.TextureDownload 43namespace OpenSim.Region.CoreModules.Agent.TextureDownload
43{ 44{
44 public class TextureDownloadModule : IRegionModule 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
46 public class TextureDownloadModule : INonSharedRegionModule
45 { 47 {
46 private static readonly ILog m_log 48 private static readonly ILog m_log
47 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -65,11 +67,14 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
65 { 67 {
66 } 68 }
67 69
68 #region IRegionModule Members 70 #region INonSharedRegionModule Members
69 71
70 public void Initialise(Scene scene, IConfigSource config) 72 public void Initialise(IConfigSource config)
73 {
74 }
75
76 public void AddRegion(Scene scene)
71 { 77 {
72
73 if (m_scene == null) 78 if (m_scene == null)
74 { 79 {
75 //m_log.Debug("Creating Texture download module"); 80 //m_log.Debug("Creating Texture download module");
@@ -90,22 +95,30 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
90 } 95 }
91 } 96 }
92 97
93 public void PostInitialise() 98 public Type ReplaceableInterface
94 { 99 {
100 get { return null; }
95 } 101 }
96 102
97 public void Close() 103 public void RegionLoaded(Scene scene)
98 { 104 {
99 } 105 }
100 106
101 public string Name 107 public void RemoveRegion(Scene scene)
102 { 108 {
103 get { return "TextureDownloadModule"; } 109 if(m_scenes.Contains(scene))
110 m_scenes.Remove(scene);
111 scene.EventManager.OnNewClient -= NewClient;
112 scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence;
104 } 113 }
105 114
106 public bool IsSharedModule 115 public void Close()
116 {
117 }
118
119 public string Name
107 { 120 {
108 get { return false; } 121 get { return "TextureDownloadModule"; }
109 } 122 }
110 123
111 #endregion 124 #endregion
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 7ac8bed..ff87493 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -32,6 +32,7 @@ using System.Reflection;
32using System.Text; 32using System.Text;
33using System.Threading; 33using System.Threading;
34using log4net; 34using log4net;
35using Mono.Addins;
35using Nini.Config; 36using Nini.Config;
36using OpenMetaverse; 37using OpenMetaverse;
37using OpenMetaverse.Imaging; 38using 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")]
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
@@ -58,16 +60,19 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
58 /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary> 60 /// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary>
59 private Scene m_scene; 61 private Scene m_scene;
60 62
61 #region IRegionModule 63 #region ISharedRegionModule
62 64
63 public string Name { get { return "J2KDecoderModule"; } } 65 public string Name { get { return "J2KDecoderModule"; } }
64 public bool IsSharedModule { get { return true; } } 66
65
66 public J2KDecoderModule() 67 public J2KDecoderModule()
67 { 68 {
68 } 69 }
69 70
70 public void Initialise(Scene scene, IConfigSource source) 71 public void Initialise(IConfigSource source)
72 {
73 }
74
75 public void AddRegion(Scene scene)
71 { 76 {
72 if (m_scene == null) 77 if (m_scene == null)
73 m_scene = scene; 78 m_scene = scene;
@@ -75,16 +80,30 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
75 scene.RegisterModuleInterface<IJ2KDecoder>(this); 80 scene.RegisterModuleInterface<IJ2KDecoder>(this);
76 } 81 }
77 82
78 public void PostInitialise() 83 public Type ReplaceableInterface
84 {
85 get { return null; }
86 }
87
88 public void RegionLoaded(Scene scene)
79 { 89 {
80 m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); 90 m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
81 } 91 }
82 92
93 public void RemoveRegion(Scene scene)
94 {
95 scene.UnregisterModuleInterface<IJ2KDecoder>(this);
96 }
97
98 public void PostInitialise()
99 {
100 }
101
83 public void Close() 102 public void Close()
84 { 103 {
85 } 104 }
86 105
87 #endregion IRegionModule 106 #endregion
88 107
89 #region IJ2KDecoder 108 #region IJ2KDecoder
90 109
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
index ef7dce8..d062361 100644
--- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Mono.Addins;
30using Nini.Config; 31using Nini.Config;
31using OpenMetaverse; 32using OpenMetaverse;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes;
35 36
36namespace OpenSim.Region.CoreModules.Agent.Xfer 37namespace OpenSim.Region.CoreModules.Agent.Xfer
37{ 38{
38 public class XferModule : IRegionModule, IXfer 39 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
40 public class XferModule : INonSharedRegionModule, IXfer
39 { 41 {
40 private Scene m_scene; 42 private Scene m_scene;
41 private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>(); 43 private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
@@ -52,9 +54,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
52 public DateTime timeStamp; 54 public DateTime timeStamp;
53 } 55 }
54 56
55 #region IRegionModule Members 57 #region INonSharedRegionModule Members
56 58
57 public void Initialise(Scene scene, IConfigSource config) 59 public void Initialise(IConfigSource config)
60 {
61 }
62
63 public void AddRegion(Scene scene)
58 { 64 {
59 m_scene = scene; 65 m_scene = scene;
60 m_scene.EventManager.OnNewClient += NewClient; 66 m_scene.EventManager.OnNewClient += NewClient;
@@ -62,22 +68,28 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
62 m_scene.RegisterModuleInterface<IXfer>(this); 68 m_scene.RegisterModuleInterface<IXfer>(this);
63 } 69 }
64 70
65 public void PostInitialise() 71 public Type ReplaceableInterface
66 { 72 {
73 get { return null; }
67 } 74 }
68 75
69 public void Close() 76 public void RegionLoaded(Scene scene)
70 { 77 {
71 } 78 }
72 79
73 public string Name 80 public void RemoveRegion(Scene scene)
74 { 81 {
75 get { return "XferModule"; } 82 scene.EventManager.OnNewClient -= NewClient;
83 scene.UnregisterModuleInterface<IXfer>(this);
76 } 84 }
77 85
78 public bool IsSharedModule 86 public void Close()
87 {
88 }
89
90 public string Name
79 { 91 {
80 get { return false; } 92 get { return "XferModule"; }
81 } 93 }
82 94
83 #endregion 95 #endregion