diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs index 4b39b92..23c213f 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs | |||
@@ -2,20 +2,30 @@ | |||
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Net; | 3 | using System.Net; |
4 | using System.Net.Sockets; | 4 | using System.Net.Sockets; |
5 | using System.Reflection; | ||
5 | using System.Text; | 6 | using System.Text; |
6 | using System.Threading; | 7 | using System.Threading; |
8 | using log4net; | ||
9 | using OpenSim.Region.Framework.Scenes; | ||
7 | 10 | ||
8 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | 11 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server |
9 | { | 12 | { |
13 | public delegate void OnNewIRCUserDelegate(IRCClientView user); | ||
14 | |||
10 | /// <summary> | 15 | /// <summary> |
11 | /// Adam's completely hacked up not-probably-compliant RFC1459 server class. | 16 | /// Adam's completely hacked up not-probably-compliant RFC1459 server class. |
12 | /// </summary> | 17 | /// </summary> |
13 | class IRCServer | 18 | class IRCServer |
14 | { | 19 | { |
20 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
21 | |||
22 | public event OnNewIRCUserDelegate OnNewIRCClient; | ||
23 | |||
15 | private TcpListener m_listener; | 24 | private TcpListener m_listener; |
25 | private Scene m_baseScene; | ||
16 | private bool m_running = true; | 26 | private bool m_running = true; |
17 | 27 | ||
18 | public IRCServer(IPAddress listener, int port) | 28 | public IRCServer(IPAddress listener, int port, Scene baseScene) |
19 | { | 29 | { |
20 | m_listener = new TcpListener(listener, port); | 30 | m_listener = new TcpListener(listener, port); |
21 | 31 | ||
@@ -23,6 +33,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
23 | 33 | ||
24 | Thread thread = new Thread(ListenLoop); | 34 | Thread thread = new Thread(ListenLoop); |
25 | thread.Start(); | 35 | thread.Start(); |
36 | m_baseScene = baseScene; | ||
26 | } | 37 | } |
27 | 38 | ||
28 | public void Stop() | 39 | public void Stop() |
@@ -41,7 +52,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
41 | 52 | ||
42 | private void AcceptClient(TcpClient client) | 53 | private void AcceptClient(TcpClient client) |
43 | { | 54 | { |
44 | 55 | IRCClientView cv = new IRCClientView(client, m_baseScene); | |
56 | |||
57 | if (OnNewIRCClient != null) | ||
58 | OnNewIRCClient(cv); | ||
45 | } | 59 | } |
46 | } | 60 | } |
47 | } | 61 | } |