• 大小: 8.02M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-14
  • 语言: C/C++
  • 标签: 传奇  官方  水晶  

资源简介

稳定发布2021.02.12.00

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Threading;
using System.Windows.Forms;

namespace AutoPatcher
{
    public partial class AMain : Form
    {
        long _totalBytes _completedBytes _currentBytes;
        private int _fileCount _currentCount;

        private FileInformation _currentFile;
        public bool Completed Checked ErrorFound;
        
        public List OldList;
        public Queue DownloadList;

        private Stopwatch _stopwatch = Stopwatch.StartNew();

        private Thread _workThread;

        public AMain()
        {
            InitializeComponent();
        }



        public void Start()
        {
            OldList = new List();
            DownloadList = new Queue();

            byte[] data = Download(Settings.PatchFileName);

            if (data != null)
            {
                using (MemoryStream stream = new MemoryStream(data))
                using (BinaryReader reader = new BinaryReader(stream))
                    ParseOld(reader);
            }
            else
            {
                MessageBox.Show(“Could not get Patch Information.“);
                Completed = true;
                return;
            }

            _fileCount = OldList.Count;
            for (int i = 0; i < OldList.Count; i++)
                CheckFile(OldList[i]);

            Checked = true;
            _fileCount = 0;
            _currentCount = 0;


            _fileCount = DownloadList.Count;
            BeginDownload();
        }

        private void BeginDownload()
        {
            if (DownloadList == null) return;

            if (DownloadList.Count == 0)
            {
                DownloadList = null;
                _currentFile = null;
                Completed = true;

                CleanUp();
                return;
            }

            _currentFile = DownloadList.Dequeue();

            Download(_currentFile);
        }
        private void CleanUp()
        {
            if (!Settings.AllowCleanUp) return;

            string[] fileNames;

            if (Directory.Exists(@“.\Data\“))
            {
                fileNames = Directory.GetFiles(@“.\Data\“ @“*.lib“);

                for (int i = 0; i < fileNames.Length; i++)
                {
                    if (!NeedFile(fileNames[i]))
                        File.Delete(fileNames[i]);
                }
            }


            if (Directory.Exists(@“.\Sound\“))
            {
                fileNames = Directory.GetFiles(@“.\Sound\“ @“*.wav“);

                for (int i = 0; i < fileNames.Length; i++)
                {
                    if (!NeedFile(fileNames[i]))
                        File.Delete(fileNames[i]);
                }

                fileNames = Directory.GetFiles(@“.\Sound\“ @“*.mp3“);

                for (int i = 0; i < fi

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\
     文件         378  2021-02-11 22:39  mir2-2021.02.12.00\.gitattributes
     文件         927  2021-02-11 22:39  mir2-2021.02.12.00\.gitignore
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\
     文件       10865  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\AMain.Designer.cs
     文件       13120  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\AMain.cs
     文件        5897  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\AMain.resx
     文件        5491  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\AutoPatcher.csproj
     文件       11796  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\InIReader.cs
     文件         562  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Program.cs
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\
     文件        1398  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\AssemblyInfo.cs
     文件        3149  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\Resources.Designer.cs
     文件        6074  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\Resources.resx
     文件        1068  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\Settings.Designer.cs
     文件         242  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Properties\Settings.settings
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Resources\
     文件       30873  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Resources\C#Mir.gif
     文件        1440  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\Settings.cs
     文件         141  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcher\app.config
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\
     文件       14363  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\AMain.Designer.cs
     文件       20992  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\AMain.cs
     文件        5698  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\AMain.resx
     文件         161  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\App.config
     文件        4116  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\AutoPatcherAdmin.csproj
     文件       11801  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\InIReader.cs
     文件         589  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\Program.cs
     目录           0  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\Properties\
     文件        1420  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\Properties\AssemblyInfo.cs
     文件        2798  2021-02-11 22:39  mir2-2021.02.12.00\AutoPatcherAdmin\Properties\Resources.Designer.cs
............此处省略486个文件信息

评论

共有 条评论