aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ChatModule.cs
diff options
context:
space:
mode:
authorSean Dague2007-10-22 16:55:03 +0000
committerSean Dague2007-10-22 16:55:03 +0000
commit81e5cf14ceb309b8e160389368883dad683bc74a (patch)
tree1218cf92c5dadf90c369ed8a5b777f78bcfa03b4 /OpenSim/Region/Environment/Modules/ChatModule.cs
parentmy confusion on matches vs. groups in regex. This should work a bit better (diff)
downloadopensim-SC_OLD-81e5cf14ceb309b8e160389368883dad683bc74a.zip
opensim-SC_OLD-81e5cf14ceb309b8e160389368883dad683bc74a.tar.gz
opensim-SC_OLD-81e5cf14ceb309b8e160389368883dad683bc74a.tar.bz2
opensim-SC_OLD-81e5cf14ceb309b8e160389368883dad683bc74a.tar.xz
after a small misunderstanding with the match group numbers
IRC relay mode now has much more sensible broadcast messages in world and ignores non PRIVMSG commands
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ChatModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index f60b5ff..bba335b 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -326,14 +326,17 @@ namespace OpenSim.Region.Environment.Modules
326 Regex RE = new Regex(regex, RegexOptions.Multiline); 326 Regex RE = new Regex(regex, RegexOptions.Multiline);
327 MatchCollection matches = RE.Matches(input); 327 MatchCollection matches = RE.Matches(input);
328 // Get some direct matches $1 $4 is a 328 // Get some direct matches $1 $4 is a
329 if ((matches.Count == 1) && (matches[0].Groups.Count == 4)) { 329 if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) {
330 result = new Dictionary<string, string>(); 330 result = new Dictionary<string, string>();
331 result.Add("nick", matches[0].Groups[0].Value); 331 result.Add("nick", matches[0].Groups[1].Value);
332 result.Add("user", matches[0].Groups[1].Value); 332 result.Add("user", matches[0].Groups[2].Value);
333 result.Add("channel", matches[0].Groups[2].Value); 333 result.Add("channel", matches[0].Groups[3].Value);
334 result.Add("msg", matches[0].Groups[3].Value); 334 result.Add("msg", matches[0].Groups[4].Value);
335 } else { 335 } else {
336 m_log.Verbose("IRC", "Number of matches: " + matches.Count); 336 m_log.Verbose("IRC", "Number of matches: " + matches.Count);
337 if (matches.Count > 0) {
338 m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count);
339 }
337 } 340 }
338 return result; 341 return result;
339 } 342 }