Ejemplo n.º 1
0
        private static void PopulateRootFile(TACTRepo repo, DirectoryReader dirReader, MPQReader mpqReader)
        {
            Log.WriteLine("Extracting Data files");

            // load files from mpqs, patches and loose files in the data directory
            mpqReader.FileList.Clear();
            mpqReader.EnumerateDataArchives(dirReader.DataArchives);
            mpqReader.EnumeratePatchArchives();
            //mpqReader.EnumerateLooseDataFiles(dirReader.GetLooseDataFiles());

            Log.WriteLine("Populating Root file");
            mpqReader.Process <RootFile>((x) =>
            {
                repo.RootFile.AddOrUpdate(x);
                repo.EncodingFile.AddOrUpdate(x);
                repo.IndexContainer.Enqueue(x);
                repo.DownloadFile.AddOrUpdate(x);
            });
        }
Ejemplo n.º 2
0
        private static void PopulateInstallFile(TACTRepo repo, DirectoryReader dirReader, MPQReader mpqReader)
        {
            Log.WriteLine("Extracting and Populating Install file");

            // use base-*.mpq if available else enumerate all non-archived files not inside the data folder
            // this ignores temp data folders e.g. wdb, wtf, cache etc
            if (dirReader.BaseArchives.Count == 0)
            {
                dirReader.ExportFiles();
            }
            else
            {
                mpqReader.EnumerateDataArchives(dirReader.BaseArchives, true);
                mpqReader.Process <InstallFile>((x) =>
                {
                    repo.InstallFile.AddOrUpdate(x);
                    repo.EncodingFile.AddOrUpdate(x);
                    repo.IndexContainer.Enqueue(x);
                    repo.DownloadFile.AddOrUpdate(x);
                });
            }
        }