Ejemplo n.º 1
0
 // Token: 0x06001EE1 RID: 7905 RVA: 0x0000C0C0 File Offset: 0x0000A2C0
 public void method_4(Class96 data)
 {
     this.Properties   = data.Properties.imethod_0();
     this.DownloadUrls = new List <Uri>(data.DownloadUrls);
     this.FILES        = new Dictionary <string, Class186>(data.FILES);
 }
Ejemplo n.º 2
0
        // Token: 0x06001EEA RID: 7914 RVA: 0x00065C98 File Offset: 0x00063E98
        public Dictionary <string, Class307> method_9(Class96 data, string installFolder, bool usingVirtualServer, bool canMoveOrInstallFiles, HashSet <string> changedFiles, out bool success)
        {
            Dictionary <string, Class307> dictionary = new Dictionary <string, Class307>();

            success = true;
            lock (((ICollection)this.FILES).SyncRoot)
            {
                lock (((ICollection)data.FILES).SyncRoot)
                {
                    foreach (KeyValuePair <string, Class186> keyValuePair in data.FILES)
                    {
                        Class96.Class308 @class;
                        bool             flag3;
                        if (usingVirtualServer && Class136.smethod_6(keyValuePair.Key))
                        {
                            @class = new Class96.Class308(keyValuePair.Key, keyValuePair.Key + ".orig", Path.Combine(installFolder, keyValuePair.Key + ".orig"), keyValuePair.Key, Path.Combine(installFolder, keyValuePair.Key), true);
                            flag3  = true;
                        }
                        else
                        {
                            @class = new Class96.Class308(keyValuePair.Key, keyValuePair.Key, Path.Combine(installFolder, keyValuePair.Key), keyValuePair.Key + ".orig", Path.Combine(installFolder, keyValuePair.Key + ".orig"), false);
                            flag3  = false;
                        }
                        bool     flag4;
                        Struct43 @struct;
                        Enum23   @enum;
                        if (flag4 = this.FILES.ContainsKey(keyValuePair.Key))
                        {
                            @enum = keyValuePair.Value.method_5(this.FILES[keyValuePair.Key], @class.FilePath, out @struct);
                        }
                        else
                        {
                            @enum = keyValuePair.Value.method_3(@class.FilePath, out @struct);
                        }
                        if (@enum != Enum23.const_2)
                        {
                            if (!canMoveOrInstallFiles)
                            {
                                success = false;
                                break;
                            }
                            if (@enum == Enum23.const_1 && keyValuePair.Value.method_2(@struct))
                            {
                                @class.FileDetails = keyValuePair.Value.method_1(@struct);
                                dictionary.Add(keyValuePair.Key, @class);
                            }
                            else if (flag3)
                            {
                                Struct43 struct2;
                                long     expectedSize;
                                switch (keyValuePair.Value.method_4(@class.AltFilePath, out struct2, out expectedSize))
                                {
                                case Enum23.const_0:
                                    @class.FileDetails = keyValuePair.Value.method_0();
                                    dictionary.Add(keyValuePair.Key, @class);
                                    break;

                                case Enum23.const_1:
                                    if (keyValuePair.Value.method_2(struct2))
                                    {
                                        Class234.smethod_14(@class.AltFilePath, @class.FilePath, true);
                                        @class.FileDetails = keyValuePair.Value.method_1(struct2);
                                        this.method_7(keyValuePair.Key, new Class186(expectedSize, struct2, string.Empty));
                                        dictionary.Add(keyValuePair.Key, @class);
                                        Class110.Instance.CreatedFileArchive.method_4(@class.FilePath);
                                        Class110.Instance.CreatedFileArchive.method_5(@class.AltFilePath);
                                    }
                                    else
                                    {
                                        @class.FileDetails = keyValuePair.Value.method_0();
                                        dictionary.Add(keyValuePair.Key, @class);
                                    }
                                    break;

                                case Enum23.const_2:
                                    File.Copy(@class.AltFilePath, @class.FilePath, true);
                                    this.method_6(keyValuePair.Key, keyValuePair.Value, null, null);
                                    Class110.Instance.CreatedFileArchive.method_4(@class.FilePath);
                                    break;
                                }
                            }
                            else
                            {
                                @class.FileDetails = keyValuePair.Value.method_0();
                                dictionary.Add(keyValuePair.Key, @class);
                            }
                            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(keyValuePair.Key);
                            if (!changedFiles.Contains(fileNameWithoutExtension))
                            {
                                changedFiles.Add(fileNameWithoutExtension);
                            }
                        }
                        else if (!flag4)
                        {
                            this.method_6(keyValuePair.Key, keyValuePair.Value, null, null);
                        }
                        if (flag3 && !File.Exists(@class.AltFilePath) && File.Exists(@class.FilePath))
                        {
                            File.Copy(@class.FilePath, @class.AltFilePath, true);
                            string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(keyValuePair.Key);
                            if (!changedFiles.Contains(fileNameWithoutExtension2))
                            {
                                changedFiles.Add(fileNameWithoutExtension2);
                            }
                            Class110.Instance.CreatedFileArchive.method_4(@class.AltFilePath);
                        }
                    }
                }
            }
            return(dictionary);
        }
Ejemplo n.º 3
0
        // Token: 0x06001EEC RID: 7916 RVA: 0x000664A8 File Offset: 0x000646A8
        public void method_11(string data)
        {
            Regex regex  = new Regex("^(FILE_){1}(?<fileName>.+){1}(\\.v){1}(?<fileVersion>\\d+\\.{1}\\d+){1}$");
            Regex regex2 = new Regex("^(PFILE_){1}(?<fileName>.+){1}(\\.v){1}(?<fileVersion>\\d+\\.{1}\\d+){1}(\\.pch){1}$");

            string[] array = data.Split(new char[]
            {
                '\r',
                '\n'
            }, StringSplitOptions.RemoveEmptyEntries);
            lock (((ICollection)this.FILES).SyncRoot)
            {
                this.FILES.Clear();
                foreach (string text in array)
                {
                    string[] array3 = text.Split(new char[]
                    {
                        '='
                    });
                    if (array3.Length == 2)
                    {
                        string key;
                        if ((key = array3[0]) != null)
                        {
                            if (Class529.dictionary_1 == null)
                            {
                                Class529.dictionary_1 = new Dictionary <string, int>(13)
                                {
                                    {
                                        "PATCHER_VERSION_STRING_SERVER",
                                        0
                                    },
                                    {
                                        "PATCHER_VERSION_STRING_SERVER_OSX",
                                        1
                                    },
                                    {
                                        "GAME_VERSION_TEXT",
                                        2
                                    },
                                    {
                                        "DOWNLOAD_PATCHER_CURRENT_VERSION",
                                        3
                                    },
                                    {
                                        "DOWNLOAD_PATCHER_CURRENT_VERSION_OSX",
                                        4
                                    },
                                    {
                                        "ACCOUNT_SERVER",
                                        5
                                    },
                                    {
                                        "GAME_SERVER",
                                        6
                                    },
                                    {
                                        "PANDA_DOWNLOAD_URL",
                                        7
                                    },
                                    {
                                        "PATCHER_BASE_URL_HEAVY_LIFTING",
                                        8
                                    },
                                    {
                                        "WEB_PAGE_LOGIN_RPC",
                                        9
                                    },
                                    {
                                        "REQUIRED_INSTALL_FILES",
                                        10
                                    },
                                    {
                                        "REQUIRED_INSTALL_FILES_OSX",
                                        11
                                    },
                                    {
                                        "REMOVE_OLD_FILE_LIST",
                                        12
                                    }
                                };
                            }
                            int num;
                            if (Class529.dictionary_1.TryGetValue(key, out num))
                            {
                                switch (num)
                                {
                                case 0:
                                    this.Properties.PATCHER_VERSION_STRING_SERVER = array3[1];
                                    goto IL_5EA;

                                case 1:
                                    this.Properties.PATCHER_VERSION_STRING_SERVER_OSX = array3[1];
                                    goto IL_5EA;

                                case 2:
                                    this.Properties.GAME_VERSION_TEXT = array3[1];
                                    goto IL_5EA;

                                case 3:
                                    this.Properties.DOWNLOAD_PATCHER_CURRENT_VERSION = array3[1];
                                    goto IL_5EA;

                                case 4:
                                    this.Properties.DOWNLOAD_PATCHER_CURRENT_VERSION_OSX = array3[1];
                                    goto IL_5EA;

                                case 5:
                                    this.Properties.ACCOUNT_SERVER = array3[1];
                                    goto IL_5EA;

                                case 6:
                                    this.Properties.GAME_SERVER = array3[1];
                                    goto IL_5EA;

                                case 7:
                                    this.Properties.PANDA_DOWNLOAD_URL = array3[1];
                                    try
                                    {
                                        lock (((ICollection)this.DownloadUrls).SyncRoot)
                                        {
                                            this.DownloadUrls.Insert(this.DownloadUrls.Count, new Uri(Class96.smethod_0(this.Properties.PANDA_DOWNLOAD_URL)));
                                        }
                                        goto IL_5EA;
                                    }
                                    catch (Exception ex)
                                    {
                                        ex.smethod_1(new object[]
                                        {
                                            array3[1]
                                        });
                                        goto IL_5EA;
                                    }
                                    break;

                                case 8:
                                    break;

                                case 9:
                                    this.Properties.WEB_PAGE_LOGIN_RPC = array3[1];
                                    goto IL_5EA;

                                case 10:
                                    this.Properties.REQUIRED_INSTALL_FILES = array3[1];
                                    goto IL_5EA;

                                case 11:
                                    this.Properties.REQUIRED_INSTALL_FILES_OSX = array3[1];
                                    goto IL_5EA;

                                case 12:
                                    this.Properties.REMOVE_OLD_FILE_LIST = array3[1];
                                    goto IL_5EA;

                                default:
                                    goto IL_3B8;
                                }
                                this.Properties.PATCHER_BASE_URL_HEAVY_LIFTING = array3[1];
                                string[] array4 = this.Properties.PATCHER_BASE_URL_HEAVY_LIFTING.Split(new char[]
                                {
                                    ';'
                                }, StringSplitOptions.RemoveEmptyEntries);
                                for (int j = array4.Length - 1; j >= 0; j--)
                                {
                                    try
                                    {
                                        lock (((ICollection)this.DownloadUrls).SyncRoot)
                                        {
                                            this.DownloadUrls.Insert(0, new Uri(Class96.smethod_0(array4[0])));
                                        }
                                    }
                                    catch (Exception ex2)
                                    {
                                        ex2.smethod_1(new object[]
                                        {
                                            array4[j]
                                        });
                                    }
                                }
                                goto IL_5EA;
                            }
                        }
IL_3B8:
                        if (array3[0].StartsWith("FILE"))
                        {
                            Match    match = regex.Match(array3[0]);
                            long     expectedSize;
                            Struct43 expectedHash;
                            if (match.Success && !match.Groups["fileName"].Value.Contains("OSX") && Class96.smethod_2(array3[1].Trim(), out expectedSize, out expectedHash))
                            {
                                if (!this.FILES.ContainsKey(match.Groups["fileName"].Value))
                                {
                                    this.FILES.Add(match.Groups["fileName"].Value, new Class186());
                                }
                                Class186 @class = this.FILES[match.Groups["fileName"].Value];
                                @class.Version      = match.Groups["fileVersion"].Value;
                                @class.ExpectedHash = expectedHash;
                                @class.ExpectedSize = expectedSize;
                            }
                        }
                        else if (array3[0].StartsWith("PFILE"))
                        {
                            Match    match = regex2.Match(array3[0]);
                            uint     expectedFileSize;
                            Struct43 expectedHash2;
                            uint     resultingFileSize;
                            Struct43 resultingHash;
                            if (match.Success && !match.Groups["fileName"].Value.Contains("OSX") && Class96.smethod_1(array3[1].Trim(), out expectedFileSize, out expectedHash2, out resultingFileSize, out resultingHash))
                            {
                                Class282 class2 = new Class282();
                                class2.ExpectedFileSize  = expectedFileSize;
                                class2.ExpectedHash      = expectedHash2;
                                class2.ResultingFileSize = resultingFileSize;
                                class2.ResultingHash     = resultingHash;
                                class2.Version           = match.Groups["fileVersion"].Value;
                                string value = match.Groups["fileName"].Value;
                                if (!this.FILES.ContainsKey(value))
                                {
                                    this.FILES.Add(value, new Class186());
                                }
                                lock (((ICollection)this.FILES[value].Patches).SyncRoot)
                                {
                                    this.FILES[value].Patches.Add(class2);
                                }
                            }
                        }
                    }
                    IL_5EA :;
                }
            }
        }
Ejemplo n.º 4
0
 // Token: 0x06001EE9 RID: 7913 RVA: 0x000659CC File Offset: 0x00063BCC
 public void method_8(Class96 data, HashSet <string> filesUpdated, string installPath)
 {
     lock (((ICollection)this.FILES).SyncRoot)
     {
         lock (filesUpdated)
         {
             if (data == null)
             {
                 using (HashSet <string> .Enumerator enumerator = filesUpdated.GetEnumerator())
                 {
                     while (enumerator.MoveNext())
                     {
                         string   str    = enumerator.Current;
                         string   text   = str + ".mf";
                         string   text2  = Path.Combine(installPath, text);
                         Class186 @class = new Class186(Class234.smethod_11(text2), Class513.smethod_0(text2), null);
                         if (this.FILES.ContainsKey(text))
                         {
                             @class.Version   = this.FILES[text].Version;
                             this.FILES[text] = @class;
                         }
                         else
                         {
                             this.FILES.Add(text, @class);
                         }
                     }
                     goto IL_20D;
                 }
             }
             lock (((ICollection)data.FILES).SyncRoot)
             {
                 foreach (string str2 in filesUpdated)
                 {
                     string   text3 = str2 + ".mf";
                     string   text4 = Path.Combine(installPath, text3);
                     Class186 value = new Class186(Class234.smethod_11(text4), Class513.smethod_0(text4), data.FILES[text3].Version);
                     if (this.FILES.ContainsKey(text3))
                     {
                         this.FILES[text3] = value;
                     }
                     else
                     {
                         this.FILES.Add(text3, value);
                     }
                 }
                 foreach (KeyValuePair <string, Class186> keyValuePair in data.FILES)
                 {
                     if (!this.FILES.ContainsKey(keyValuePair.Key))
                     {
                         this.FILES.Add(keyValuePair.Key, keyValuePair.Value.method_0());
                     }
                     else
                     {
                         this.FILES[keyValuePair.Key].Version = keyValuePair.Value.Version;
                     }
                 }
             }
             IL_20D :;
         }
     }
 }