Esempio n. 1
0
        // Token: 0x06002618 RID: 9752 RVA: 0x00086750 File Offset: 0x00084950
        public static bool smethod_1(string data, bool loaderPack, out Class402 parser)
        {
            parser = null;
            string[] array = data.Split(new char[]
            {
                '\n',
                '\r'
            }, StringSplitOptions.RemoveEmptyEntries);
            List <KeyValuePair <Struct43, Class319> > patches = null;
            Uri      uri     = null;
            Struct43 hash    = Struct43.struct43_0;
            Version  version = null;

            for (int i = 0; i < array.Length; i++)
            {
                string text = array[i];
                if (!text.StartsWith("#"))
                {
                    string[] array2 = text.Split(new char[]
                    {
                        '='
                    });
                    if (array2.Length == 2)
                    {
                        string text2;
                        if (!Class402.smethod_4(array, array2[1], ref i, out text2))
                        {
                            return(false);
                        }
                        string a;
                        if ((a = array2[0]) != null)
                        {
                            if (!(a == "minimum_version"))
                            {
                                if (!(a == "download"))
                                {
                                    if (!(a == "hash"))
                                    {
                                        if (a == "patches" && !Class402.smethod_2(text2, out patches))
                                        {
                                            return(false);
                                        }
                                    }
                                    else
                                    {
                                        if (!text2.smethod_13())
                                        {
                                            return(false);
                                        }
                                        hash = new Struct43(text2);
                                    }
                                }
                                else
                                {
                                    if (string.IsNullOrEmpty(text2))
                                    {
                                        return(false);
                                    }
                                    Uri uri2;
                                    if (!Uri.TryCreate(text2, UriKind.Absolute, out uri2))
                                    {
                                        return(false);
                                    }
                                    if (!uri2.smethod_0())
                                    {
                                        return(false);
                                    }
                                    uri = uri2;
                                }
                            }
                            else
                            {
                                if (string.IsNullOrEmpty(text2))
                                {
                                    return(false);
                                }
                                if (!Version.TryParse(text2, out version))
                                {
                                    return(false);
                                }
                            }
                        }
                    }
                }
            }
            if (uri == null)
            {
                return(false);
            }
            if (version == null)
            {
                version = Class500.Current.FileVersion;
            }
            parser = new Class402(hash, uri, version, patches);
            return(true);
        }