aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs26
1 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 1493e32..e1599a8 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -32,7 +32,7 @@ using System.Net.Sockets;
32using System.Reflection; 32using System.Reflection;
33using System.Text.RegularExpressions; 33using System.Text.RegularExpressions;
34using System.Threading; 34using System.Threading;
35using libsecondlife; 35using OpenMetaverse;
36using log4net; 36using log4net;
37using Nini.Config; 37using Nini.Config;
38using OpenSim.Framework; 38using OpenSim.Framework;
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
115 115
116 // chat works by redistributing every incoming chat 116 // chat works by redistributing every incoming chat
117 // message to each avatar in the scene 117 // message to each avatar in the scene
118 LLVector3 pos = new LLVector3(128, 128, 30); 118 Vector3 pos = new Vector3(128, 128, 30);
119 ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence) 119 ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence)
120 { 120 {
121 if (presence.IsChildAgent) return; 121 if (presence.IsChildAgent) return;
@@ -129,12 +129,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
129 129
130 if (null == c.SenderObject) 130 if (null == c.SenderObject)
131 client.SendChatMessage(c.Message, (byte)c.Type, 131 client.SendChatMessage(c.Message, (byte)c.Type,
132 pos, c.From, LLUUID.Zero, 132 pos, c.From, UUID.Zero,
133 (byte)ChatSourceType.Agent, 133 (byte)ChatSourceType.Agent,
134 (byte)ChatAudibleLevel.Fully); 134 (byte)ChatAudibleLevel.Fully);
135 else 135 else
136 client.SendChatMessage(c.Message, (byte)c.Type, 136 client.SendChatMessage(c.Message, (byte)c.Type,
137 pos, c.From, LLUUID.Zero, 137 pos, c.From, UUID.Zero,
138 (byte)ChatSourceType.Object, 138 (byte)ChatSourceType.Object,
139 (byte)ChatAudibleLevel.Fully); 139 (byte)ChatAudibleLevel.Fully);
140 }); 140 });
@@ -153,13 +153,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
153 scene = m_scenes[0]; 153 scene = m_scenes[0];
154 154
155 // Filled in since it's easier than rewriting right now. 155 // Filled in since it's easier than rewriting right now.
156 LLVector3 fromPos = e.Position; 156 Vector3 fromPos = e.Position;
157 LLVector3 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 157 Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
158 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 158 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
159 159
160 string fromName = e.From; 160 string fromName = e.From;
161 string message = e.Message; 161 string message = e.Message;
162 LLUUID fromID = e.SenderUUID; 162 UUID fromID = e.SenderUUID;
163 163
164 if(message.Length >= 1000) // libomv limit 164 if(message.Length >= 1000) // libomv limit
165 message = message.Substring(0, 1000); 165 message = message.Substring(0, 1000);
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
172 if (avatar != null) 172 if (avatar != null)
173 { 173 {
174 fromPos = avatar.AbsolutePosition; 174 fromPos = avatar.AbsolutePosition;
175 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 175 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
176 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 176 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
177 fromName = avatar.Firstname + " " + avatar.Lastname; 177 fromName = avatar.Firstname + " " + avatar.Lastname;
178 fromID = e.Sender.AgentId; 178 fromID = e.Sender.AgentId;
@@ -217,16 +217,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
217 } 217 }
218 } 218 }
219 219
220 private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, 220 private void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
221 LLUUID fromAgentID, string fromName, ChatTypeEnum type, 221 UUID fromAgentID, string fromName, ChatTypeEnum type,
222 string message, ChatSourceType src) 222 string message, ChatSourceType src)
223 { 223 {
224 // don't send stuff to child agents 224 // don't send stuff to child agents
225 if (presence.IsChildAgent) return; 225 if (presence.IsChildAgent) return;
226 226
227 LLVector3 fromRegionPos = fromPos + regionPos; 227 Vector3 fromRegionPos = fromPos + regionPos;
228 LLVector3 toRegionPos = presence.AbsolutePosition + 228 Vector3 toRegionPos = presence.AbsolutePosition +
229 new LLVector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, 229 new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize,
230 presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 230 presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
231 231
232 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); 232 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));