aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs32
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
28using System;
29using System.Net; 28using System.Net;
30using System.Reflection; 29using System.Reflection;
31using log4net; 30using log4net;
32using Mono.Addins;
33using Nini.Config; 31using Nini.Config;
34using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
35using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
@@ -37,23 +35,24 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server;
37 35
38namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView 36namespace 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