Ejemplo n.º 1
0
        private void ApplyPatches(DirectoryInfo patchFolder)
        {
            OnStatusChange(null, new StatusChangeEventArgs("Gathering Patch data..."));

            FileInfo[] muoFiles = patchFolder.GetFiles("*.muo");
            FileInfo[] uopFiles = patchFolder.GetFiles("*.uop");
            FileInfo[] mulFiles = patchFolder.GetFiles("verdata.mul");

            _allPatchFiles = new List <FileInfo>();
            _allPatchFiles.AddRange(muoFiles);
            _allPatchFiles.AddRange(uopFiles);

            for (int i = 0; i < mulFiles.Length; i++)
            {
                _allPatchFiles.Add(mulFiles[i]);
            }

            if (!CrcCheck(_allPatchFiles))
            {
                List <Patch> patches = new List <Patch>();
                for (int i = 0; i < _allPatchFiles.Count; i++)
                {
                    PatchReader reader = new PatchReader(File.OpenRead(_allPatchFiles[i].FullName), PatchReader.ExtensionToPatchFileType(_allPatchFiles[i].FullName));
                    patches.AddRange(reader.ReadPatches());
                    reader.Close();
                }

                _patcher = new Patcher(patches.ToArray(), patchFolder.FullName, _oldPatchingStyle);                //Switch argument 2 to false for new patching system.
                _patcher.ProgressChange   += new ProgressChangeHandler(OnPatchProgressChange);
                _patcher.PatchingComplete += new OperationCompleteHandler(OnPatchingComplete);
                _patcher.StatusChange     += new StatusChangeHandler(OnStatusChange);
                _patcher.WritePatches();
            }
            else
            {
                OnPatchingComplete(null, new OperationCompleteArgs());
            }
        }
Ejemplo n.º 2
0
        private void ApplyPatches(DirectoryInfo patchFolder)
        {
            OnStatusChange(null, new StatusChangeEventArgs("Gathering Patch data..."));

            FileInfo[] muoFiles = patchFolder.GetFiles("*.muo");
            FileInfo[] uopFiles = patchFolder.GetFiles("*.uop");
            FileInfo[] mulFiles = patchFolder.GetFiles("verdata.mul");

            _allPatchFiles = new List<FileInfo>();
            _allPatchFiles.AddRange(muoFiles);
            _allPatchFiles.AddRange(uopFiles);

            for( int i = 0; i < mulFiles.Length; i++ )
                    _allPatchFiles.Add(mulFiles[i]);

            if( !CrcCheck(_allPatchFiles) )
            {
                List<Patch> patches = new List<Patch>();
                for( int i = 0; i < _allPatchFiles.Count; i++ )
                {
                    PatchReader reader = new PatchReader(File.OpenRead(_allPatchFiles[i].FullName), PatchReader.ExtensionToPatchFileType(_allPatchFiles[i].FullName));
                    patches.AddRange(reader.ReadPatches());
                    reader.Close();
                }

                _patcher = new Patcher(patches.ToArray(), patchFolder.FullName, _oldPatchingStyle);//Switch argument 2 to false for new patching system.
                _patcher.ProgressChange += new ProgressChangeHandler(OnPatchProgressChange);
                _patcher.PatchingComplete += new OperationCompleteHandler(OnPatchingComplete);
                _patcher.StatusChange += new StatusChangeHandler(OnStatusChange);
                _patcher.WritePatches();
            }
            else
                OnPatchingComplete(null, new OperationCompleteArgs());
        }