public static void ConsToGp4(string conPath, string buildDir, bool eu, string id, string desc) { var songs = new List <DLCSong>(); foreach (var conFilename in Directory.EnumerateFiles(conPath)) { var file = GameArchives.Util.LocalFile(conFilename); var stfs = STFSPackage.IsSTFS(file); STFSPackage conFile; if (stfs != GameArchives.PackageTestResult.YES || null == (conFile = STFSPackage.OpenFile(file)) || conFile.Type != STFSType.CON) { Console.WriteLine($"Skipping \"{conFilename}\": not a CON file"); continue; } songs.AddRange(ConvertDLCPackage(conFile.RootDirectory.GetDirectory("songs"))); } if (songs.Count > 1) { if ((id?.Length ?? 0) < 16) { throw new Exception("You must provide a 16 char ID if you are building a custom package with multiple songs"); } } var pkgId = eu ? $"EP8802-CUSA02901_00-{id}" : $"UP8802-CUSA02084_00-{id}"; DLCSongsToGP4(songs, pkgId, desc ?? "", buildDir, eu); }
public static void ConsToGp4(string conPath, string buildDir, bool eu, string id, string desc) { var songs = new List <DLCSong>(); foreach (var conFilename in Directory.EnumerateFiles(conPath)) { var file = GameArchives.Util.LocalFile(conFilename); var stfs = STFSPackage.IsSTFS(file); STFSPackage conFile; if (stfs != GameArchives.PackageTestResult.YES || null == (conFile = STFSPackage.OpenFile(file)) || conFile.Type != STFSType.CON) { Console.WriteLine($"Skipping \"{conFilename}\": not a CON file"); continue; } songs.AddRange(ConvertDLCPackage(conFile.RootDirectory.GetDirectory("songs"))); } var identifier = id ?? GenId(songs.Select(s => s.SongData).ToList()); var pkgId = eu ? $"EP8802-CUSA02901_00-{identifier}" : $"UP8802-CUSA02084_00-{identifier}"; var pkgDesc = desc ?? GenDesc(songs.Select(s => s.SongData).ToList()); DLCSongsToGP4(songs, pkgId, pkgDesc, buildDir, eu); }