diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs index ec040db..cfe1278 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | |||
@@ -25,11 +25,9 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Net; | 28 | using System.Net; |
30 | using System.Reflection; | 29 | using System.Reflection; |
31 | using log4net; | 30 | using log4net; |
32 | using Mono.Addins; | ||
33 | using Nini.Config; | 31 | using Nini.Config; |
34 | using OpenSim.Region.Framework.Interfaces; | 32 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
@@ -37,23 +35,24 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; | |||
37 | 35 | ||
38 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | 36 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView |
39 | { | 37 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 38 | public class IRCStackModule : IRegionModule |
41 | public class IRCStackModule : INonSharedRegionModule | ||
42 | { | 39 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 41 | ||
45 | private IRCServer m_server; | 42 | private IRCServer m_server; |
46 | // private Scene m_scene; | 43 | // private Scene m_scene; |
47 | private int portNo; | ||
48 | 44 | ||
49 | #region Implementation of ISharedRegionModule | 45 | #region Implementation of IRegionModule |
50 | 46 | ||
51 | public void Initialise(IConfigSource source) | 47 | public void Initialise(Scene scene, IConfigSource source) |
52 | { | 48 | { |
53 | if (null != source.Configs["IRCd"] && | 49 | if (null != source.Configs["IRCd"] && |
54 | source.Configs["IRCd"].GetBoolean("Enabled",false)) | 50 | source.Configs["IRCd"].GetBoolean("Enabled",false)) |
55 | { | 51 | { |
56 | portNo = source.Configs["IRCd"].GetInt("Port",6666); | 52 | int portNo = source.Configs["IRCd"].GetInt("Port",6666); |
53 | // m_scene = scene; | ||
54 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); | ||
55 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; | ||
57 | } | 56 | } |
58 | } | 57 | } |
59 | 58 | ||
@@ -69,20 +68,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | |||
69 | m_log.Info("[IRCd] Added user to Scene"); | 68 | m_log.Info("[IRCd] Added user to Scene"); |
70 | } | 69 | } |
71 | 70 | ||
72 | public void AddRegion(Scene scene) | 71 | public void PostInitialise() |
73 | { | ||
74 | if (portNo != null) | ||
75 | { | ||
76 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); | ||
77 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; | ||
78 | } | ||
79 | } | ||
80 | public void RegionLoaded(Scene scene) | ||
81 | { | 72 | { |
82 | } | ||
83 | 73 | ||
84 | public void RemoveRegion(Scene scene) | ||
85 | { | ||
86 | } | 74 | } |
87 | 75 | ||
88 | public void Close() | 76 | public void Close() |
@@ -95,9 +83,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | |||
95 | get { return "IRCClientStackModule"; } | 83 | get { return "IRCClientStackModule"; } |
96 | } | 84 | } |
97 | 85 | ||
98 | public Type ReplaceableInterface | 86 | public bool IsSharedModule |
99 | { | 87 | { |
100 | get { return null; } | 88 | get { return false; } |
101 | } | 89 | } |
102 | 90 | ||
103 | #endregion | 91 | #endregion |