diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 15720fc..9f3429e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | |||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
168 | 168 | ||
169 | string fromName = e.From; | 169 | string fromName = e.From; |
170 | string message = e.Message; | 170 | string message = e.Message; |
171 | LLUUID fromAgentID = LLUUID.Zero; | 171 | LLUUID fromAgentID = e.SenderUUID; |
172 | 172 | ||
173 | if (e.Sender != null) | 173 | if (e.Sender != null) |
174 | { | 174 | { |
@@ -208,10 +208,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
208 | 208 | ||
209 | 209 | ||
210 | // We only want to relay stuff on channel 0 | 210 | // We only want to relay stuff on channel 0 |
211 | if (e.Channel == 0) | 211 | if (e.Channel == 0 || e.Channel == 2147483647) |
212 | { | 212 | { |
213 | if (e.Channel == 2147483647) | ||
214 | e.Type = ChatTypeEnum.DebugChannel; | ||
215 | |||
213 | // IRC stuff | 216 | // IRC stuff |
214 | if (e.Message.Length > 0) | 217 | if (e.Message.Length > 0 && e.Channel == 0) |
215 | { | 218 | { |
216 | if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC | 219 | if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC |
217 | { | 220 | { |
@@ -223,8 +226,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
223 | { | 226 | { |
224 | s.ForEachScenePresence(delegate(ScenePresence presence) | 227 | s.ForEachScenePresence(delegate(ScenePresence presence) |
225 | { | 228 | { |
226 | TrySendChatMessage(presence, fromPos, regionPos, | 229 | if (e.Channel == 2147483647) |
227 | fromAgentID, fromName, e.Type, message); | 230 | { |
231 | TrySendChatMessage(presence, fromPos, regionPos, | ||
232 | fromAgentID, fromName, e.Type, message, ChatSourceType.Object); | ||
233 | } | ||
234 | else | ||
235 | { | ||
236 | TrySendChatMessage(presence, fromPos, regionPos, | ||
237 | fromAgentID, fromName, e.Type, message, ChatSourceType.Agent); | ||
238 | |||
239 | } | ||
228 | }); | 240 | }); |
229 | } | 241 | } |
230 | } | 242 | } |
@@ -290,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
290 | } | 302 | } |
291 | 303 | ||
292 | private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, | 304 | private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, |
293 | LLUUID fromAgentID, string fromName, ChatTypeEnum type, string message) | 305 | LLUUID fromAgentID, string fromName, ChatTypeEnum type, string message, ChatSourceType src) |
294 | { | 306 | { |
295 | if (!presence.IsChildAgent) | 307 | if (!presence.IsChildAgent) |
296 | { | 308 | { |
@@ -306,7 +318,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
306 | } | 318 | } |
307 | 319 | ||
308 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 320 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
309 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID); | 321 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); |
310 | } | 322 | } |
311 | } | 323 | } |
312 | 324 | ||
@@ -633,7 +645,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
633 | avatar.ControllingClient.SendChatMessage( | 645 | avatar.ControllingClient.SendChatMessage( |
634 | Helpers.StringToField(data["msg"]), 255, | 646 | Helpers.StringToField(data["msg"]), 255, |
635 | pos, data["nick"], | 647 | pos, data["nick"], |
636 | LLUUID.Zero); | 648 | LLUUID.Zero,(byte)ChatSourceType.Agent,(byte)ChatAudibleLevel.Fully); |
637 | } | 649 | } |
638 | }); | 650 | }); |
639 | } | 651 | } |
@@ -678,7 +690,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
678 | avatar.ControllingClient.SendChatMessage( | 690 | avatar.ControllingClient.SendChatMessage( |
679 | Helpers.StringToField(message), 255, | 691 | Helpers.StringToField(message), 255, |
680 | pos, sender, | 692 | pos, sender, |
681 | LLUUID.Zero); | 693 | LLUUID.Zero,(byte)ChatSourceType.Object,(byte)ChatAudibleLevel.Fully); |
682 | } | 694 | } |
683 | }); | 695 | }); |
684 | } | 696 | } |