コード例 #1
0
        public FileDownloader(IWoWRepository repository, List <FileObject> files)
        {
            Files    = files;
            BasePath = repository.GetDefaultDirectory();

            Progress = new ConsoleDownloadProgressBar(Files.Count);
        }
コード例 #2
0
        public FileDownloader(IWoWRepository repository, List<FileObject> files)
        {
            Files = files;
            BasePath = repository.GetDefaultDirectory();

            Progress = new ConsoleDownloadProgressBar(Files.Count);
        }
コード例 #3
0
        private bool IsAcceptedFile(IWoWRepository repository, FileObject file)
        {
            if (WoWRegeneration.CurrentSession.Os == "Win" && file.Filename == "base-OSX.MPQ")
            {
                return(false);
            }

            if (WoWRegeneration.CurrentSession.Os == "OSX" && file.Filename == "base-Win.MPQ")
            {
                return(false);
            }

            if (file.Filename == "alternate.MPQ" && file.Info != WoWRegeneration.CurrentSession.Locale)
            {
                return(false);
            }

            if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path) &&
                File.Exists(Program.ExecutionPath + repository.GetDefaultDirectory() + file.Path))
            {
                Program.Log("Skipping " + file.Filename + " allready downloaded", ConsoleColor.DarkGray);
                return(false);
            }

            if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path))
            {
                WoWRegeneration.CurrentSession.CompletedFiles.Remove(file.Path);
                WoWRegeneration.CurrentSession.SaveSession();
            }

            if (file.Directory == "Data/")
            {
                return(true);
            }

            if (file.Directory.StartsWith("Data/Interface/"))
            {
                return(true);
            }

            if (file.Directory.StartsWith("Data/" + WoWRegeneration.CurrentSession.Locale))
            {
                return(true);
            }
            return(false);
        }
コード例 #4
0
        private bool IsAcceptedFile(IWoWRepository repository, FileObject file)
        {
            if (WoWRegeneration.CurrentSession.Os == "Win" && file.Filename == "base-OSX.MPQ")
                return false;

            if (WoWRegeneration.CurrentSession.Os == "OSX" && file.Filename == "base-Win.MPQ")
                return false;

            if (file.Filename == "alternate.MPQ" && file.Info != WoWRegeneration.CurrentSession.Locale)
                return false;

            if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path) &&
                File.Exists(Program.ExecutionPath + repository.GetDefaultDirectory() + file.Path))
            {
                Program.Log("Skipping " + file.Filename + " allready downloaded", ConsoleColor.DarkGray);
                return false;
            }

            if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path))
            {
                WoWRegeneration.CurrentSession.CompletedFiles.Remove(file.Path);
                WoWRegeneration.CurrentSession.SaveSession();
            }

            if (file.Directory == "Data/")
            {
                return true;
            }

            if (file.Directory.StartsWith("Data/Interface/"))
            {
                return true;
            }

            if (file.Directory.StartsWith("Data/" + WoWRegeneration.CurrentSession.Locale))
            {
                return true;
            }
            return false;
        }