aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs
diff options
context:
space:
mode:
authorMelanie2010-01-29 07:20:13 +0000
committerMelanie2010-01-29 07:21:06 +0000
commita87a247f0548d39a8c39b1d28123d7da8db44598 (patch)
tree7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.zip
opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz
opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2
opensim-SC-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs40
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;
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>