Пример #1
0
        /// <summary>Tries to retrieve a channel for the given character.</summary>
        /// <param name="channelName">the channel name</param>
        /// <returns>the requested channel; null if there was an error or it doesn't exist</returns>
        public static ChatChannel RetrieveChannel(IUser user, string channelName)
        {
            if (channelName == string.Empty)
            {
                return((ChatChannel)null);
            }
            ChatChannel channel = ChatChannelGroup.Global.GetChannel(channelName, false);

            if (channel == null)
            {
                ChatChannelGroup group = ChatChannelGroup.GetGroup(user.FactionGroup);
                if (group == null)
                {
                    return((ChatChannel)null);
                }
                channel = group.GetChannel(channelName, false);
            }

            return(channel);
        }
Пример #2
0
        /// <summary>
        /// Tries to retrieve a channel for the given character.
        /// </summary>
        /// <param name="channelName">the channel name</param>
        /// <returns>the requested channel; null if there was an error or it doesn't exist</returns>
        public static ChatChannel RetrieveChannel(IUser user, string channelName)
        {
            if (channelName == string.Empty)
            {
                return(null);
            }

            var chan = Global.GetChannel(channelName, false);

            // TODO: Improve lookup
            if (chan == null)
            {
                var group = GetGroup(user.FactionGroup);
                if (group == null)
                {
                    return(null);
                }
                chan = group.GetChannel(channelName, false);
            }
            return(chan);
        }