aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-25 23:27:38 +0000
committerJeff Ames2008-05-25 23:27:38 +0000
commit5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d (patch)
treeb010c015ac515fe2a3dd0c9f89c16cbc6383d685 /OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
parent* A hacky Top Scripts display. It isn't accurate as far as ms accounting, ho... (diff)
downloadopensim-SC-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.zip
opensim-SC-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.gz
opensim-SC-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.bz2
opensim-SC-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.xz
Update svn properties. Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 8216222..9730b02 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
43{ 43{
44 public class ChatModule : IRegionModule, ISimChat 44 public class ChatModule : IRegionModule, ISimChat
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private const int DEBUG_CHANNEL = 2147483647; 49 private const int DEBUG_CHANNEL = 2147483647;
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
115 115
116 // Filled in since it's easier than rewriting right now. 116 // Filled in since it's easier than rewriting right now.
117 LLVector3 fromPos = e.Position; 117 LLVector3 fromPos = e.Position;
118 LLVector3 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 118 LLVector3 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
119 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 119 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
120 120
121 string fromName = e.From; 121 string fromName = e.From;
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
130 if (avatar != null) 130 if (avatar != null)
131 { 131 {
132 fromPos = avatar.AbsolutePosition; 132 fromPos = avatar.AbsolutePosition;
133 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 133 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
134 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 134 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
135 fromName = avatar.Firstname + " " + avatar.Lastname; 135 fromName = avatar.Firstname + " " + avatar.Lastname;
136 fromAgentID = e.Sender.AgentId; 136 fromAgentID = e.Sender.AgentId;
@@ -151,13 +151,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
151 if (e.Channel == DEBUG_CHANNEL) 151 if (e.Channel == DEBUG_CHANNEL)
152 { 152 {
153 TrySendChatMessage(presence, fromPos, regionPos, 153 TrySendChatMessage(presence, fromPos, regionPos,
154 fromAgentID, fromName, e.Type, 154 fromAgentID, fromName, e.Type,
155 message, ChatSourceType.Object); 155 message, ChatSourceType.Object);
156 } 156 }
157 else 157 else
158 { 158 {
159 TrySendChatMessage(presence, fromPos, regionPos, 159 TrySendChatMessage(presence, fromPos, regionPos,
160 fromAgentID, fromName, e.Type, 160 fromAgentID, fromName, e.Type,
161 message, ChatSourceType.Agent); 161 message, ChatSourceType.Agent);
162 } 162 }
163 }); 163 });
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
180 } 180 }
181 181
182 private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, 182 private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos,
183 LLUUID fromAgentID, string fromName, ChatTypeEnum type, 183 LLUUID fromAgentID, string fromName, ChatTypeEnum type,
184 string message, ChatSourceType src) 184 string message, ChatSourceType src)
185 { 185 {
186 if (!presence.IsChildAgent) 186 if (!presence.IsChildAgent)
@@ -188,7 +188,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
188 LLVector3 fromRegionPos = fromPos + regionPos; 188 LLVector3 fromRegionPos = fromPos + regionPos;
189 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos; 189 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
190 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); 190 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
191 191
192 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || 192 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
193 type == ChatTypeEnum.Say && dis > m_saydistance || 193 type == ChatTypeEnum.Say && dis > m_saydistance ||
194 type == ChatTypeEnum.Shout && dis > m_shoutdistance) 194 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
@@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
197 } 197 }
198 198
199 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView 199 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
200 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, 200 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
201 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); 201 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
202 } 202 }
203 } 203 }