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