diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs index 5c8bfc6..808f1f9 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | |||
@@ -1,66 +1,66 @@ | |||
1 | using System.Net; | 1 | using System.Net; |
2 | using System.Reflection; | 2 | using System.Reflection; |
3 | using log4net; | 3 | using log4net; |
4 | using Nini.Config; | 4 | using Nini.Config; |
5 | using OpenSim.Region.Framework.Interfaces; | 5 | using OpenSim.Region.Framework.Interfaces; |
6 | using OpenSim.Region.Framework.Scenes; | 6 | using OpenSim.Region.Framework.Scenes; |
7 | using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; | 7 | using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; |
8 | 8 | ||
9 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | 9 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView |
10 | { | 10 | { |
11 | public class IRCStackModule : IRegionModule | 11 | public class IRCStackModule : IRegionModule |
12 | { | 12 | { |
13 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 13 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
14 | 14 | ||
15 | private IRCServer m_server; | 15 | private IRCServer m_server; |
16 | private Scene m_scene; | 16 | private Scene m_scene; |
17 | 17 | ||
18 | #region Implementation of IRegionModule | 18 | #region Implementation of IRegionModule |
19 | 19 | ||
20 | public void Initialise(Scene scene, IConfigSource source) | 20 | public void Initialise(Scene scene, IConfigSource source) |
21 | { | 21 | { |
22 | if (null != source.Configs["IRCd"] && | 22 | if (null != source.Configs["IRCd"] && |
23 | source.Configs["IRCd"].GetBoolean("Enabled",false)) | 23 | source.Configs["IRCd"].GetBoolean("Enabled",false)) |
24 | { | 24 | { |
25 | m_scene = scene; | 25 | m_scene = scene; |
26 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), 6666, scene); | 26 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), 6666, scene); |
27 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; | 27 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | void m_server_OnNewIRCClient(IRCClientView user) | 31 | void m_server_OnNewIRCClient(IRCClientView user) |
32 | { | 32 | { |
33 | user.OnIRCReady += user_OnIRCReady; | 33 | user.OnIRCReady += user_OnIRCReady; |
34 | } | 34 | } |
35 | 35 | ||
36 | void user_OnIRCReady(IRCClientView cv) | 36 | void user_OnIRCReady(IRCClientView cv) |
37 | { | 37 | { |
38 | m_log.Info("[IRCd] Adding user..."); | 38 | m_log.Info("[IRCd] Adding user..."); |
39 | m_scene.ClientManager.Add(cv.CircuitCode, cv); | 39 | m_scene.ClientManager.Add(cv.CircuitCode, cv); |
40 | cv.Start(); | 40 | cv.Start(); |
41 | m_log.Info("[IRCd] Added user to Scene"); | 41 | m_log.Info("[IRCd] Added user to Scene"); |
42 | } | 42 | } |
43 | 43 | ||
44 | public void PostInitialise() | 44 | public void PostInitialise() |
45 | { | 45 | { |
46 | 46 | ||
47 | } | 47 | } |
48 | 48 | ||
49 | public void Close() | 49 | public void Close() |
50 | { | 50 | { |
51 | 51 | ||
52 | } | 52 | } |
53 | 53 | ||
54 | public string Name | 54 | public string Name |
55 | { | 55 | { |
56 | get { return "IRCClientStackModule"; } | 56 | get { return "IRCClientStackModule"; } |
57 | } | 57 | } |
58 | 58 | ||
59 | public bool IsSharedModule | 59 | public bool IsSharedModule |
60 | { | 60 | { |
61 | get { return false; } | 61 | get { return false; } |
62 | } | 62 | } |
63 | 63 | ||
64 | #endregion | 64 | #endregion |
65 | } | 65 | } |
66 | } | 66 | } |