diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 3570495..2d4a635 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | |||
@@ -28,7 +28,6 @@ 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; | ||
32 | using Nini.Config; | 31 | using Nini.Config; |
33 | using OpenMetaverse; | 32 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
@@ -40,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; | |||
40 | 39 | ||
41 | namespace OpenSim.Region.CoreModules.Avatar.MuteList | 40 | namespace OpenSim.Region.CoreModules.Avatar.MuteList |
42 | { | 41 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 42 | public class MuteListModule : IRegionModule |
44 | public class MuteListModule : ISharedRegionModule | ||
45 | { | 43 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 45 | ||
@@ -49,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
49 | private List<Scene> m_SceneList = new List<Scene>(); | 47 | private List<Scene> m_SceneList = new List<Scene>(); |
50 | private string m_RestURL = String.Empty; | 48 | private string m_RestURL = String.Empty; |
51 | 49 | ||
52 | public void Initialise(IConfigSource config) | 50 | public void Initialise(Scene scene, IConfigSource config) |
53 | { | 51 | { |
54 | if (!enabled) | 52 | if (!enabled) |
55 | return; | 53 | return; |
@@ -68,24 +66,19 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
68 | enabled = false; | 66 | enabled = false; |
69 | return; | 67 | return; |
70 | } | 68 | } |
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 | } | ||
79 | 69 | ||
80 | public Type ReplaceableInterface | ||
81 | { | ||
82 | get { return null; } | ||
83 | } | ||
84 | |||
85 | public void AddRegion(Scene scene) | ||
86 | { | ||
87 | lock (m_SceneList) | 70 | lock (m_SceneList) |
88 | { | 71 | { |
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 | } | ||
89 | if (!m_SceneList.Contains(scene)) | 82 | if (!m_SceneList.Contains(scene)) |
90 | m_SceneList.Add(scene); | 83 | m_SceneList.Add(scene); |
91 | 84 | ||
@@ -93,18 +86,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
93 | } | 86 | } |
94 | } | 87 | } |
95 | 88 | ||
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 | |||
108 | public void PostInitialise() | 89 | public void PostInitialise() |
109 | { | 90 | { |
110 | if (!enabled) | 91 | if (!enabled) |
@@ -121,6 +102,11 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList | |||
121 | get { return "MuteListModule"; } | 102 | get { return "MuteListModule"; } |
122 | } | 103 | } |
123 | 104 | ||
105 | public bool IsSharedModule | ||
106 | { | ||
107 | get { return true; } | ||
108 | } | ||
109 | |||
124 | public void Close() | 110 | public void Close() |
125 | { | 111 | { |
126 | } | 112 | } |