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 commandsafrisby
parent
f1fec04c56
commit
81e5cf14ce
|
@ -326,14 +326,17 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
Regex RE = new Regex(regex, RegexOptions.Multiline);
|
Regex RE = new Regex(regex, RegexOptions.Multiline);
|
||||||
MatchCollection matches = RE.Matches(input);
|
MatchCollection matches = RE.Matches(input);
|
||||||
// Get some direct matches $1 $4 is a
|
// Get some direct matches $1 $4 is a
|
||||||
if ((matches.Count == 1) && (matches[0].Groups.Count == 4)) {
|
if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) {
|
||||||
result = new Dictionary<string, string>();
|
result = new Dictionary<string, string>();
|
||||||
result.Add("nick", matches[0].Groups[0].Value);
|
result.Add("nick", matches[0].Groups[1].Value);
|
||||||
result.Add("user", matches[0].Groups[1].Value);
|
result.Add("user", matches[0].Groups[2].Value);
|
||||||
result.Add("channel", matches[0].Groups[2].Value);
|
result.Add("channel", matches[0].Groups[3].Value);
|
||||||
result.Add("msg", matches[0].Groups[3].Value);
|
result.Add("msg", matches[0].Groups[4].Value);
|
||||||
} else {
|
} else {
|
||||||
m_log.Verbose("IRC", "Number of matches: " + matches.Count);
|
m_log.Verbose("IRC", "Number of matches: " + matches.Count);
|
||||||
|
if (matches.Count > 0) {
|
||||||
|
m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue