diff options
author | lbsa71 | 2007-09-19 00:30:55 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-19 00:30:55 +0000 |
commit | 8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch) | |
tree | f9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/Modules/ChatModule.cs | |
parent | * Moved SendLogoutPacket back to IClientAPI. (diff) | |
download | opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2 opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz |
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ChatModule.cs | 50 |
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 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.IO; |
3 | using System.Text; | 3 | using System.Net.Sockets; |
4 | using System.Net; | 4 | using System.Threading; |
5 | using System.Net.Sockets; | 5 | using libsecondlife; |
6 | using System.Threading; | 6 | using OpenSim.Framework.Interfaces; |
7 | using System.IO; | 7 | using OpenSim.Framework.Utilities; |
8 | using libsecondlife; | 8 | using OpenSim.Region.Environment.Interfaces; |
9 | using OpenSim.Region.Environment.Scenes; | 9 | using OpenSim.Region.Environment.Scenes; |
10 | using OpenSim.Region.Environment.Interfaces; | 10 | |
11 | using OpenSim.Framework.Interfaces; | ||
12 | using OpenSim.Framework.Utilities; | ||
13 | using OpenSim.Framework.Console; | ||
14 | |||
15 | namespace OpenSim.Region.Environment.Modules | 11 | namespace 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 |