aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ChatModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ChatModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs50
1 files changed, 24 insertions, 26 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 8d3a553..468a5b7 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -1,17 +1,13 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.IO;
3using System.Text; 3using System.Net.Sockets;
4using System.Net; 4using System.Threading;
5using System.Net.Sockets; 5using libsecondlife;
6using System.Threading; 6using OpenSim.Framework.Interfaces;
7using System.IO; 7using OpenSim.Framework.Utilities;
8using libsecondlife; 8using OpenSim.Region.Environment.Interfaces;
9using OpenSim.Region.Environment.Scenes; 9using OpenSim.Region.Environment.Scenes;
10using OpenSim.Region.Environment.Interfaces; 10
11using OpenSim.Framework.Interfaces;
12using OpenSim.Framework.Utilities;
13using OpenSim.Framework.Console;
14
15namespace OpenSim.Region.Environment.Modules 11namespace OpenSim.Region.Environment.Modules
16{ 12{
17 public class ChatModule : IRegionModule, ISimChat 13 public class ChatModule : IRegionModule, ISimChat
@@ -20,18 +16,18 @@ namespace OpenSim.Region.Environment.Modules
20 16
21 private string m_server = "irc2.choopa.net"; 17 private string m_server = "irc2.choopa.net";
22 18
23 // private int m_port = 6668; 19 // private int m_port = 6668;
24 //private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; 20 //private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
25 private string m_nick = "OSimBot"; 21 private string m_nick = "OSimBot";
26 private string m_channel = "#opensim"; 22 private string m_channel = "#opensim";
27 23
28 // private NetworkStream m_stream; 24 // private NetworkStream m_stream;
29 private TcpClient m_irc; 25 private TcpClient m_irc;
30 private StreamWriter m_ircWriter; 26 private StreamWriter m_ircWriter;
31 private StreamReader m_ircReader; 27 private StreamReader m_ircReader;
32 28
33 // private Thread pingSender; 29 // private Thread pingSender;
34 // private Thread listener; 30 // private Thread listener;
35 31
36 private bool connected = false; 32 private bool connected = false;
37 33
@@ -127,16 +123,18 @@ namespace OpenSim.Region.Environment.Modules
127 { 123 {
128 string mess = inputLine.Substring(inputLine.IndexOf(m_channel)); 124 string mess = inputLine.Substring(inputLine.IndexOf(m_channel));
129 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 125 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
130 { 126 {
131 presence.ControllingClient.SendChatMessage(Helpers.StringToField(mess), 255, pos, "IRC:", 127 presence.ControllingClient.SendChatMessage(
132 LLUUID.Zero); 128 Helpers.StringToField(mess), 255, pos, "IRC:",
133 }); 129 LLUUID.Zero);
130 });
134 } 131 }
135 } 132 }
136 } 133 }
137 } 134 }
138 135
139 public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 136 public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName,
137 LLUUID fromAgentID)
140 { 138 {
141 ScenePresence avatar = null; 139 ScenePresence avatar = null;
142 avatar = m_scene.RequestAvatar(fromAgentID); 140 avatar = m_scene.RequestAvatar(fromAgentID);
@@ -213,4 +211,4 @@ namespace OpenSim.Region.Environment.Modules
213 } 211 }
214 } 212 }
215 } 213 }
216} 214} \ No newline at end of file