Beispiel #1
0
        // This function is lifted from the IRCConnector because it
        // contains information that is not differentiating from an
        // IRC point-of-view.

        public static void OSChat(IRCConnector p_irc, OSChatMessage c, bool cmsg)
        {
            // m_log.DebugFormat("[IRC-OSCHAT] from {0}:{1}", p_irc.Server, p_irc.IrcChannel);

            try
            {
                // Scan through the set of unique channel configuration for those
                // that belong to this connector. And then forward the message to
                // all regions known to those channels.
                // Note that this code is responsible for completing some of the
                // settings for the inbound OSChatMessage

                lock (IRCBridgeModule.m_channels)
                {
                    foreach (ChannelState cs in IRCBridgeModule.m_channels)
                    {
                        if (p_irc == cs.irc)
                        {
                            // This non-IRC differentiator moved to here

                            if (cmsg && !cs.ClientReporting)
                            {
                                continue;
                            }

                            // This non-IRC differentiator moved to here

                            c.Channel = (cs.RelayPrivateChannels ? cs.RelayChannel : 0);

                            foreach (RegionState region in cs.clientregions)
                            {
                                region.OSChat(cs.irc, c);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                m_log.ErrorFormat("[IRC-OSCHAT]: BroadcastSim Exception: {0}", ex.Message);
                m_log.Debug(ex);
            }
        }
        // This function is lifted from the IRCConnector because it 
        // contains information that is not differentiating from an
        // IRC point-of-view.

        public static void OSChat(IRCConnector p_irc, OSChatMessage c, bool cmsg)
        {

            // m_log.DebugFormat("[IRC-OSCHAT] from {0}:{1}", p_irc.Server, p_irc.IrcChannel);

            try
            {

                // Scan through the set of unique channel configuration for those
                // that belong to this connector. And then forward the message to 
                // all regions known to those channels.
                // Note that this code is responsible for completing some of the
                // settings for the inbound OSChatMessage

                lock (IRCBridgeModule.m_channels)
                {
                    foreach (ChannelState cs in IRCBridgeModule.m_channels)
                    {
                        if (p_irc == cs.irc)
                        {

                            // This non-IRC differentiator moved to here

                            if (cmsg && !cs.ClientReporting)
                                continue;

                            // This non-IRC differentiator moved to here

                            c.Channel = (cs.RelayPrivateChannels ? cs.RelayChannel : 0);

                            foreach (RegionState region in cs.clientregions)
                            {
                                region.OSChat(cs.irc, c);
                            }

                        }
                    }
                }
            }
            catch (Exception ex)
            {
                m_log.ErrorFormat("[IRC-OSCHAT]: BroadcastSim Exception: {0}", ex.Message);
                m_log.Debug(ex);
            }
        }