diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs index 18106be..452ea7b 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs | |||
@@ -88,6 +88,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
88 | { | 88 | { |
89 | m_irc = new IRCChatModule(config); | 89 | m_irc = new IRCChatModule(config); |
90 | } | 90 | } |
91 | |||
91 | if (m_irc_connector == null) | 92 | if (m_irc_connector == null) |
92 | { | 93 | { |
93 | m_irc_connector = new Thread(IRCConnectRun); | 94 | m_irc_connector = new Thread(IRCConnectRun); |
@@ -183,6 +184,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
183 | m_irc_connector.Name = "IRCConnectorThread"; | 184 | m_irc_connector.Name = "IRCConnectorThread"; |
184 | m_irc_connector.IsBackground = true; | 185 | m_irc_connector.IsBackground = true; |
185 | } | 186 | } |
187 | |||
186 | if (!m_irc_connector.IsAlive) | 188 | if (!m_irc_connector.IsAlive) |
187 | { | 189 | { |
188 | m_irc_connector.Start(); | 190 | m_irc_connector.Start(); |
@@ -196,20 +198,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
196 | 198 | ||
197 | if (e.Message.StartsWith("/me ") && (null != avatar)) | 199 | if (e.Message.StartsWith("/me ") && (null != avatar)) |
198 | e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4)); | 200 | e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4)); |
199 | if (e.Channel == 0 || e.Channel == DEBUG_CHANNEL) | 201 | |
200 | { | 202 | // this is to keep objects from talking to IRC |
201 | if (e.Channel == DEBUG_CHANNEL) | 203 | if (m_irc.Connected && (avatar != null)) |
202 | e.Type = ChatTypeEnum.DebugChannel; | ||
203 | |||
204 | // IRC stuff | ||
205 | if (e.Message.Length > 0 && e.Channel == 0) | ||
206 | { | ||
207 | if (m_irc.Connected && (avatar != null)) // this is to keep objects from talking to IRC | ||
208 | { | ||
209 | m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); | 204 | m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); |
210 | } | ||
211 | } | ||
212 | } | ||
213 | } | 205 | } |
214 | 206 | ||
215 | #endregion | 207 | #endregion |
@@ -529,14 +521,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
529 | // Get some direct matches $1 $4 is a | 521 | // Get some direct matches $1 $4 is a |
530 | if ((matches.Count == 0) || (matches.Count != 1) || (matches[0].Groups.Count != 5)) | 522 | if ((matches.Count == 0) || (matches.Count != 1) || (matches[0].Groups.Count != 5)) |
531 | { | 523 | { |
532 | result = new Dictionary<string, string>(); | ||
533 | result.Add("nick", matches[0].Groups[1].Value); | ||
534 | result.Add("user", matches[0].Groups[2].Value); | ||
535 | result.Add("channel", matches[0].Groups[3].Value); | ||
536 | result.Add("msg", matches[0].Groups[4].Value); | ||
537 | } | ||
538 | else | ||
539 | { | ||
540 | m_log.Info("[IRC]: Number of matches: " + matches.Count); | 524 | m_log.Info("[IRC]: Number of matches: " + matches.Count); |
541 | if (matches.Count > 0) | 525 | if (matches.Count > 0) |
542 | { | 526 | { |
@@ -641,7 +625,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
641 | 625 | ||
642 | public void BroadcastSim(string sender, string format, params string[] args) | 626 | public void BroadcastSim(string sender, string format, params string[] args) |
643 | { | 627 | { |
644 | LLVector3 pos = new LLVector3(128, 128, 20); | ||
645 | try | 628 | try |
646 | { | 629 | { |
647 | ChatFromViewerArgs c = new ChatFromViewerArgs(); | 630 | ChatFromViewerArgs c = new ChatFromViewerArgs(); |
@@ -781,8 +764,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
781 | 764 | ||
782 | public void eventIrcMode(string[] commArgs) | 765 | public void eventIrcMode(string[] commArgs) |
783 | { | 766 | { |
784 | string IrcChannel = commArgs[2]; | ||
785 | string IrcUser = commArgs[0].Split('!')[0]; | ||
786 | string UserMode = ""; | 767 | string UserMode = ""; |
787 | for (int i = 3; i < commArgs.Length; i++) | 768 | for (int i = 3; i < commArgs.Length; i++) |
788 | { | 769 | { |