aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs18
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 @@
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Net; 3using System.Net;
4using System.Net.Sockets; 4using System.Net.Sockets;
5using System.Reflection;
5using System.Text; 6using System.Text;
6using System.Threading; 7using System.Threading;
8using log4net;
9using OpenSim.Region.Framework.Scenes;
7 10
8namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server 11namespace 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}