private static async Task <int> DumpMetadataStore(DumpMetadataStoreOptions options) { var ms = new Metadata_Store("C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Witcher 3\\content\\metadata.store"); using (StreamWriter writer = File.CreateText("C:\\Users\\maxim\\Desktop\\wk\\dump_metadatastore.csv")) { ms.SerializeToCsv(writer); } return(1); }
private static void InterpretCL(string[] args) { if (args == null || !(args.Length > 0)) { return; } if (args[0] == "Pack") { List <FileInfo> bundlefiles = new List <FileInfo>(); List <FileInfo> bufferfiles = new List <FileInfo>(); DirectoryInfo indir = new DirectoryInfo(args[1]); foreach (var f in indir.GetFiles("*", SearchOption.AllDirectories)) { if (f.Extension == ".buffer") { bufferfiles.Add(f); } else { bundlefiles.Add(f); } } var blob = new Bundle(bundlefiles.ToArray(), indir); var buffer = new Bundle(bufferfiles.ToArray(), indir); blob.Write(indir.Parent.FullName); buffer.Write(indir.Parent.FullName); } if (args[0] == "Cook") { } if (args[0] == "Buildcache") { } else if (args[0] == "Unbundle") { if (File.Exists(args[1])) { FileInfo infile = new FileInfo(args[1]); DirectoryInfo indir = infile.Directory; var b = new Bundle(infile.FullName); foreach (var item in b.Items) { string outfile = Path.Combine(indir.FullName, item.DepotPath); DirectoryInfo outdir = new FileInfo(outfile).Directory; Directory.CreateDirectory(outdir.FullName); item.Extract(outfile); } } } else if (args[0] == "ExtractCache") { if (File.Exists(args[1])) { FileInfo infile = new FileInfo(args[1]); DirectoryInfo indir = infile.Directory; var c = new TextureCache(infile.FullName); foreach (var item in c.Items) { string outfile = Path.Combine(indir.FullName, item.DepotPath); outfile.TrimEnd('m', 'b', 'x', '.'); outfile += ".dds"; DirectoryInfo outdir = new FileInfo(outfile).Directory; Directory.CreateDirectory(outdir.FullName); item.Extract(outfile); } } } else if (args[0] == "Metadatastore") { DirectoryInfo indir = new DirectoryInfo(args[1]); var ms = new Metadata_Store(indir.FullName); ms.Write(indir.FullName); } else { } }