Example #1
0
        internal void Parse005(string[] strMessage, int descriptionBeginsAtIndex)
        {
            for (int x = 0; x < descriptionBeginsAtIndex; x++)
            {
                string strParam = strMessage[x].Split('=')[0];
                string strValue = "";
                if (strMessage[x].IndexOf('=') != -1)
                {
                    strValue = strMessage[x].Split('=')[1];
                }

                if (strParam.Length > 0)
                {
                    if (strParam[0] == '-')
                    {
                        if (nm[strParam.Substring(1)] != null)
                        {
                            nm.Remove(strParam.Substring(1));
                        }
                    }
                    else
                    {
                        if (nm[strParam] != null)
                        {
                            nm[strParam] = strValue;
                        }
                        else
                        {
                            nm.Add(strParam, strValue);
                        }

                        // Parsing those that are frequently used, to speed up peformance.
                        switch (strParam)
                        {
                        case "PREFIX":
                            ParsePrefix(strValue);
                            break;

                        case "CHANMODES":
                            cmc.ParseChanModes(strValue);
                            break;

                        case "CHANLIMIT":
                        case "CHANTYPES":
                            if (nm["CHANTYPES"] != null && (nm["CHANLIMIT"] != null || nm["MAXCHANNELS"] != null))
                            {
                                string strTypes = nm["CHANTYPES"];
                                string strLimit = string.Format("{0}:{1}", strTypes, nm["MAXCHANNELS"]);
                                if (nm["CHANLIMIT"] != null)
                                {
                                    strLimit = nm["CHANLIMIT"];
                                }

                                ct.SetTypes(strTypes, strLimit);
                            }
                            break;
                        }
                    }
                }
            }
        }