From 29bc2962adc2b0a297bb2c2eb70b5261d7cafc70 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 30 May 2009 03:53:04 +0000 Subject: * More IRCClientView fiddling. Now implements IClientAPI & IClientCore. --- .../Agent/InternetRelayClientView/Server/IRCServer.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs') 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 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; +using System.Reflection; using System.Text; using System.Threading; +using log4net; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server { + public delegate void OnNewIRCUserDelegate(IRCClientView user); + /// /// Adam's completely hacked up not-probably-compliant RFC1459 server class. /// class IRCServer { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public event OnNewIRCUserDelegate OnNewIRCClient; + private TcpListener m_listener; + private Scene m_baseScene; private bool m_running = true; - public IRCServer(IPAddress listener, int port) + public IRCServer(IPAddress listener, int port, Scene baseScene) { m_listener = new TcpListener(listener, port); @@ -23,6 +33,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server Thread thread = new Thread(ListenLoop); thread.Start(); + m_baseScene = baseScene; } public void Stop() @@ -41,7 +52,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server private void AcceptClient(TcpClient client) { - + IRCClientView cv = new IRCClientView(client, m_baseScene); + + if (OnNewIRCClient != null) + OnNewIRCClient(cv); } } } -- cgit v1.1