aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
diff options
context:
space:
mode:
authorJeff Ames2009-05-31 16:26:18 +0000
committerJeff Ames2009-05-31 16:26:18 +0000
commitdb2c4ab94cc40bf16910806fd4fe0d9a2b7cbd8f (patch)
tree59640d71ec7a7dcae97e261ba3197df0d5e688e3 /OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
parent* Adds MRM scripting commands, World.Objects.Create(Vector3 position) and Wor... (diff)
downloadopensim-SC-db2c4ab94cc40bf16910806fd4fe0d9a2b7cbd8f.zip
opensim-SC-db2c4ab94cc40bf16910806fd4fe0d9a2b7cbd8f.tar.gz
opensim-SC-db2c4ab94cc40bf16910806fd4fe0d9a2b7cbd8f.tar.bz2
opensim-SC-db2c4ab94cc40bf16910806fd4fe0d9a2b7cbd8f.tar.xz
Update svn properties.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs122
1 files changed, 61 insertions, 61 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
index b8f5afa..612ac48 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
@@ -1,61 +1,61 @@
1using System; 1using System;
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.Reflection;
6using System.Text; 6using System.Text;
7using System.Threading; 7using System.Threading;
8using log4net; 8using log4net;
9using OpenSim.Region.Framework.Scenes; 9using OpenSim.Region.Framework.Scenes;
10 10
11namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server 11namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
12{ 12{
13 public delegate void OnNewIRCUserDelegate(IRCClientView user); 13 public delegate void OnNewIRCUserDelegate(IRCClientView user);
14 14
15 /// <summary> 15 /// <summary>
16 /// Adam's completely hacked up not-probably-compliant RFC1459 server class. 16 /// Adam's completely hacked up not-probably-compliant RFC1459 server class.
17 /// </summary> 17 /// </summary>
18 class IRCServer 18 class IRCServer
19 { 19 {
20 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 20 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
21 21
22 public event OnNewIRCUserDelegate OnNewIRCClient; 22 public event OnNewIRCUserDelegate OnNewIRCClient;
23 23
24 private readonly TcpListener m_listener; 24 private readonly TcpListener m_listener;
25 private readonly Scene m_baseScene; 25 private readonly Scene m_baseScene;
26 private bool m_running = true; 26 private bool m_running = true;
27 27
28 public IRCServer(IPAddress listener, int port, Scene baseScene) 28 public IRCServer(IPAddress listener, int port, Scene baseScene)
29 { 29 {
30 m_listener = new TcpListener(listener, port); 30 m_listener = new TcpListener(listener, port);
31 31
32 m_listener.Start(50); 32 m_listener.Start(50);
33 33
34 Thread thread = new Thread(ListenLoop); 34 Thread thread = new Thread(ListenLoop);
35 thread.Start(); 35 thread.Start();
36 m_baseScene = baseScene; 36 m_baseScene = baseScene;
37 } 37 }
38 38
39 public void Stop() 39 public void Stop()
40 { 40 {
41 m_running = false; 41 m_running = false;
42 m_listener.Stop(); 42 m_listener.Stop();
43 } 43 }
44 44
45 private void ListenLoop() 45 private void ListenLoop()
46 { 46 {
47 while(m_running) 47 while(m_running)
48 { 48 {
49 AcceptClient(m_listener.AcceptTcpClient()); 49 AcceptClient(m_listener.AcceptTcpClient());
50 } 50 }
51 } 51 }
52 52
53 private void AcceptClient(TcpClient client) 53 private void AcceptClient(TcpClient client)
54 { 54 {
55 IRCClientView cv = new IRCClientView(client, m_baseScene); 55 IRCClientView cv = new IRCClientView(client, m_baseScene);
56 56
57 if (OnNewIRCClient != null) 57 if (OnNewIRCClient != null)
58 OnNewIRCClient(cv); 58 OnNewIRCClient(cv);
59 } 59 }
60 } 60 }
61} 61}