diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ChatModule.cs | 99 |
1 files changed, 51 insertions, 48 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 9d4187a..52491ed 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -181,60 +181,63 @@ namespace OpenSim.Region.Environment.Modules | |||
181 | { | 181 | { |
182 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) | 182 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
183 | { | 183 | { |
184 | int dis = -100000; | 184 | if (!presence.IsChildAgent) |
185 | |||
186 | LLVector3 avatarRegionPos = presence.AbsolutePosition + | ||
187 | new LLVector3( | ||
188 | scene.RegionInfo.RegionLocX*256, | ||
189 | scene.RegionInfo.RegionLocY*256, | ||
190 | 0); | ||
191 | dis = | ||
192 | Math.Abs((int) avatarRegionPos.GetDistanceTo(fromRegionPos)); | ||
193 | |||
194 | switch (e.Type) | ||
195 | { | 185 | { |
196 | case ChatTypeEnum.Whisper: | 186 | int dis = -100000; |
197 | if (dis < m_whisperdistance) | 187 | |
198 | { | 188 | LLVector3 avatarRegionPos = presence.AbsolutePosition + |
199 | //should change so the message is sent through the avatar rather than direct to the ClientView | 189 | new LLVector3( |
200 | presence.ControllingClient.SendChatMessage(message, | 190 | scene.RegionInfo.RegionLocX * 256, |
201 | type, | 191 | scene.RegionInfo.RegionLocY * 256, |
202 | fromPos, | 192 | 0); |
203 | fromName, | 193 | dis = |
204 | fromAgentID); | 194 | Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos)); |
205 | } | 195 | |
206 | break; | 196 | switch (e.Type) |
207 | case ChatTypeEnum.Say: | 197 | { |
208 | if (dis < m_saydistance) | 198 | case ChatTypeEnum.Whisper: |
209 | { | 199 | if (dis < m_whisperdistance) |
210 | //Console.WriteLine("sending chat"); | 200 | { |
211 | presence.ControllingClient.SendChatMessage(message, | 201 | //should change so the message is sent through the avatar rather than direct to the ClientView |
212 | type, | 202 | presence.ControllingClient.SendChatMessage(message, |
213 | fromPos, | 203 | type, |
214 | fromName, | 204 | fromPos, |
215 | fromAgentID); | 205 | fromName, |
216 | } | 206 | fromAgentID); |
217 | break; | 207 | } |
218 | case ChatTypeEnum.Shout: | 208 | break; |
219 | if (dis < m_shoutdistance) | 209 | case ChatTypeEnum.Say: |
220 | { | 210 | if (dis < m_saydistance) |
211 | { | ||
212 | //Console.WriteLine("sending chat"); | ||
213 | presence.ControllingClient.SendChatMessage(message, | ||
214 | type, | ||
215 | fromPos, | ||
216 | fromName, | ||
217 | fromAgentID); | ||
218 | } | ||
219 | break; | ||
220 | case ChatTypeEnum.Shout: | ||
221 | if (dis < m_shoutdistance) | ||
222 | { | ||
223 | presence.ControllingClient.SendChatMessage(message, | ||
224 | type, | ||
225 | fromPos, | ||
226 | fromName, | ||
227 | fromAgentID); | ||
228 | } | ||
229 | break; | ||
230 | |||
231 | case ChatTypeEnum.Broadcast: | ||
221 | presence.ControllingClient.SendChatMessage(message, | 232 | presence.ControllingClient.SendChatMessage(message, |
222 | type, | 233 | type, |
223 | fromPos, | 234 | fromPos, |
224 | fromName, | 235 | fromName, |
225 | fromAgentID); | 236 | fromAgentID); |
226 | } | 237 | break; |
227 | break; | 238 | default: |
228 | 239 | break; | |
229 | case ChatTypeEnum.Broadcast: | 240 | } |
230 | presence.ControllingClient.SendChatMessage(message, | ||
231 | type, | ||
232 | fromPos, | ||
233 | fromName, | ||
234 | fromAgentID); | ||
235 | break; | ||
236 | default: | ||
237 | break; | ||
238 | } | 241 | } |
239 | }); | 242 | }); |
240 | } | 243 | } |