diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent/IPBan')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs | 40 |
1 files changed, 12 insertions, 28 deletions
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; | |||
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; | ||
33 | using Nini.Config; | 32 | using Nini.Config; |
34 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
35 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
@@ -37,27 +36,21 @@ using OpenSim.Region.Framework.Scenes; | |||
37 | 36 | ||
38 | namespace OpenSim.Region.CoreModules.Agent.IPBan | 37 | namespace 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> |