diff options
Updates all IRegionModules to the new style region modules.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 2d4a635..3570495 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | |||
@@ -28,6 +28,7 @@ using System; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using log4net; | 30 | using log4net; |
31 | using Mono.Addins; | ||
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
@@ -39,7 +40,8 @@ using OpenSim.Region.Framework.Scenes; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.Avatar.MuteList | 41 | namespace OpenSim.Region.CoreModules.Avatar.MuteList |
41 | { | 42 | { |
42 | public class MuteListModule : IRegionModule | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
44 | public class MuteListModule : ISharedRegionModule | ||
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
@@ -47,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
47 | private List<Scene> m_SceneList = new List<Scene>(); | 49 | private List<Scene> m_SceneList = new List<Scene>(); |
48 | private string m_RestURL = String.Empty; | 50 | private string m_RestURL = String.Empty; |
49 | 51 | ||
50 | public void Initialise(Scene scene, IConfigSource config) | 52 | public void Initialise(IConfigSource config) |
51 | { | 53 | { |
52 | if (!enabled) | 54 | if (!enabled) |
53 | return; | 55 | return; |
@@ -66,19 +68,24 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
66 | enabled = false; | 68 | enabled = false; |
67 | return; | 69 | return; |
68 | } | 70 | } |
71 | m_RestURL = cnf.GetString("MuteListURL", ""); | ||
72 | if (m_RestURL == "") | ||
73 | { | ||
74 | m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); | ||
75 | enabled = false; | ||
76 | return; | ||
77 | } | ||
78 | } | ||
69 | 79 | ||
80 | public Type ReplaceableInterface | ||
81 | { | ||
82 | get { return null; } | ||
83 | } | ||
84 | |||
85 | public void AddRegion(Scene scene) | ||
86 | { | ||
70 | lock (m_SceneList) | 87 | lock (m_SceneList) |
71 | { | 88 | { |
72 | if (m_SceneList.Count == 0) | ||
73 | { | ||
74 | m_RestURL = cnf.GetString("MuteListURL", ""); | ||
75 | if (m_RestURL == "") | ||
76 | { | ||
77 | m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); | ||
78 | enabled = false; | ||
79 | return; | ||
80 | } | ||
81 | } | ||
82 | if (!m_SceneList.Contains(scene)) | 89 | if (!m_SceneList.Contains(scene)) |
83 | m_SceneList.Add(scene); | 90 | m_SceneList.Add(scene); |
84 | 91 | ||
@@ -86,6 +93,18 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
86 | } | 93 | } |
87 | } | 94 | } |
88 | 95 | ||
96 | public void RegionLoaded(Scene scene) | ||
97 | { | ||
98 | } | ||
99 | |||
100 | public void RemoveRegion(Scene scene) | ||
101 | { | ||
102 | if (m_SceneList.Contains(scene)) | ||
103 | m_SceneList.Remove(scene); | ||
104 | |||
105 | scene.EventManager.OnNewClient -= OnNewClient; | ||
106 | } | ||
107 | |||
89 | public void PostInitialise() | 108 | public void PostInitialise() |
90 | { | 109 | { |
91 | if (!enabled) | 110 | if (!enabled) |
@@ -102,11 +121,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
102 | get { return "MuteListModule"; } | 121 | get { return "MuteListModule"; } |
103 | } | 122 | } |
104 | 123 | ||
105 | public bool IsSharedModule | ||
106 | { | ||
107 | get { return true; } | ||
108 | } | ||
109 | |||
110 | public void Close() | 124 | public void Close() |
111 | { | 125 | { |
112 | } | 126 | } |