Exemple #1
0
        // Token: 0x06002619 RID: 9753 RVA: 0x000868D0 File Offset: 0x00084AD0
        private static bool smethod_2(string patch_data, out List <KeyValuePair <Struct43, Class319> > patches)
        {
            patches = null;
            List <KeyValuePair <Struct43, Class319> > list = new List <KeyValuePair <Struct43, Class319> >();

            string[] array = patch_data.Split(new char[]
            {
                '\n',
                '\r'
            }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in array)
            {
                Struct43? @struct;
                Class319  value;
                if (!Class402.smethod_3(line, out @struct, out value))
                {
                    return(false);
                }
                list.Add(new KeyValuePair <Struct43, Class319>(@struct.Value, value));
            }
            patches = list;
            return(true);
        }
Exemple #2
0
        // Token: 0x06002617 RID: 9751 RVA: 0x00086590 File Offset: 0x00084790
        public static bool smethod_0(string data, bool loaderPack, out Class402 parser)
        {
            parser = null;
            string[] array = data.Split(new char[]
            {
                '\n',
                '\r'
            }, StringSplitOptions.RemoveEmptyEntries);
            Version  mininumVersion = null;
            Uri      uri            = null;
            Struct43 hash           = Struct43.struct43_0;

            foreach (string text in array)
            {
                if (!text.StartsWith("#"))
                {
                    string[] array2 = text.Split(new char[]
                    {
                        '='
                    });
                    if (array2.Length == 2)
                    {
                        if (string.IsNullOrEmpty(array2[1]))
                        {
                            return(false);
                        }
                        string a;
                        if ((a = array2[0]) != null)
                        {
                            if (!(a == "minimumversion"))
                            {
                                if (!(a == "hash"))
                                {
                                    if (a == "downloadurl")
                                    {
                                        Uri uri2;
                                        if (!Uri.TryCreate(array2[1], UriKind.Absolute, out uri2))
                                        {
                                            return(false);
                                        }
                                        if (!uri2.smethod_0())
                                        {
                                            return(false);
                                        }
                                        uri = uri2;
                                    }
                                }
                                else
                                {
                                    if (!array2[1].smethod_13())
                                    {
                                        return(false);
                                    }
                                    hash = new Struct43(array2[1]);
                                }
                            }
                            else
                            {
                                Regex regex = new Regex("^(?<major>(\\d+))\\.(?<minor>(\\d+))\\.(?<build>(\\d+))$");
                                if (regex.IsMatch(array2[1]))
                                {
                                    Match match = regex.Match(array2[1]);
                                    int   major = int.Parse(match.Groups["major"].Value);
                                    int   minor = int.Parse(match.Groups["minor"].Value);
                                    int   build = int.Parse(match.Groups["build"].Value);
                                    mininumVersion = new Version(major, minor, build, 0);
                                }
                            }
                        }
                    }
                }
            }
            if (uri == null)
            {
                return(false);
            }
            parser = new Class402(hash, uri, mininumVersion, null);
            return(true);
        }
Exemple #3
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);
        }