示例#1
0
        private static bool IsMatch(UrlDir.UrlConfig url, string type, string[] namePatterns, string constraints)
        {
            if (url.type != type)
            {
                return(false);
            }

            if (namePatterns != null)
            {
                if (url.name == url.type)
                {
                    return(false);
                }

                bool match = false;
                foreach (string pattern in namePatterns)
                {
                    if (MMPatchLoader.WildcardMatch(url.name, pattern))
                    {
                        match = true;
                        break;
                    }
                }

                if (!match)
                {
                    return(false);
                }
            }

            return(MMPatchLoader.CheckConstraints(url.config, constraints));
        }
示例#2
0
        public bool IsMatch(ConfigNode node)
        {
            if (node.name != type)
            {
                return(false);
            }

            if (namePatterns != null)
            {
                string name = node.GetValue("name");
                if (name == null)
                {
                    return(false);
                }

                bool match = false;
                foreach (string pattern in namePatterns)
                {
                    if (MMPatchLoader.WildcardMatch(name, pattern))
                    {
                        match = true;
                        break;
                    }
                }

                if (!match)
                {
                    return(false);
                }
            }

            return(MMPatchLoader.CheckConstraints(node, constraints));
        }