Skip to content
Permalink
Browse files

- fix invalid artifact naming so that unpacker can extract recoverabl…

…e data
  • Loading branch information...
cozy1 committed Apr 15, 2019
1 parent e43e756 commit 8c0983e6cacdcea3b038698256b1919d3b526e6c
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("e99dc5a5")]
[assembly: AssemblyInformationalVersion("e43e7565")]
[assembly: AssemblyConfiguration("")]
@@ -1,5 +1,6 @@
Rocksmith Toolkit Release Notes

- fix invalid artifact naming so that unpacker can extract recoverable data
- prevent Unpacker CLI from redirecting standard output for dds to png conversions
- added error handler for TreeViewOfd exceptions
- added additional flexibility to Quick Add feature
@@ -568,6 +568,15 @@ public static DLCPackageData LoadFromFolder(string unpackedDir, Platform targetP
var xmlName = attr.SongXml.Split(':')[3];
var xmlFile = Directory.EnumerateFiles(unpackedDir, xmlName + ".xml", SearchOption.AllDirectories).FirstOrDefault();

if (!File.Exists(xmlFile))
{
throw new DataException(Environment.NewLine + Environment.NewLine + "*** READ ME *** READ ME *** READ ME ***" + Environment.NewLine + Environment.NewLine +
"<WARNING> CDLC artifact file naming is corrupt ..." + Environment.NewLine +
"1) Open the artifacts folder: " + Path.Combine(unpackedDir, "EOF") + Environment.NewLine +
"2) Look for and rename any artifact file names that contain the '~' tilde character" + Environment.NewLine +
"3) (re)Author the CDLC like from an EOF project using: >CDLC Creator>Add>Edit>Generate" + Environment.NewLine + Environment.NewLine);
}

if (attr.Phrases != null)
{
if (data.SongInfo == null)
@@ -582,15 +591,15 @@ public static DLCPackageData LoadFromFolder(string unpackedDir, Platform targetP
// Fill SongInfo
data.SongInfo = new SongInfo
{
JapaneseArtistName = attr.JapaneseArtistName,
JapaneseSongName = attr.JapaneseSongName,
SongDisplayName = attr.SongName,
SongDisplayNameSort = attr.SongNameSort,
Album = attr.AlbumName,
AlbumSort = attr.AlbumNameSort,
SongYear = attr.SongYear ?? 0,
Artist = attr.ArtistName,
ArtistSort = attr.ArtistNameSort,
JapaneseArtistName = attr.JapaneseArtistName,
JapaneseSongName = attr.JapaneseSongName,
SongDisplayName = attr.SongName,
SongDisplayNameSort = attr.SongNameSort,
Album = attr.AlbumName,
AlbumSort = attr.AlbumNameSort,
SongYear = attr.SongYear ?? 0,
Artist = attr.ArtistName,
ArtistSort = attr.ArtistNameSort,
AverageTempo = (int)attr.SongAverageTempo
};
}
@@ -20,6 +20,7 @@
using RocksmithToolkitLib.Ogg;
using RocksmithToolkitLib.DLCPackage.Manifest;
using RocksmithToolkitLib.XmlRepository;
using System.Drawing;


namespace RocksmithToolkitLib.DLCPackage
@@ -644,16 +645,14 @@ private static string ExtractPSARC(string srcPath, string destPath, Stream input
// InflateEntries - compatible with RS1 and RS2014 files
foreach (var entry in psarc.TOC)
{
var inputPath = Path.Combine(destPath, entry.Name);

// for dev debugging invalid symbol usage in CDLC
// inputPath = inputPath.Replace("?", "i");
// inputPath = Path.Combine(destPath, StringExtensions.GetValidFileName(entry.Name));
// remove invalid characters from entry.Name so CDLC can be unpacked
var validEntryName = entry.Name.Replace("?", "~");
var inputPath = Path.Combine(destPath, validEntryName);

if (Path.GetExtension(entry.Name).ToLower() == ".psarc")
{
psarc.InflateEntry(entry);
var outputPath = Path.Combine(destPath, Path.GetFileNameWithoutExtension(entry.Name));
var outputPath = Path.Combine(destPath, Path.GetFileNameWithoutExtension(validEntryName));
ExtractPSARC(inputPath, outputPath, entry.Data, platform, false);
}
else
@@ -665,7 +664,7 @@ private static string ExtractPSARC(string srcPath, string destPath, Stream input
entry.Data.Dispose();
}

if (!String.IsNullOrEmpty(psarc.ErrMSG))
if (!String.IsNullOrEmpty(psarc.ErrMSG))
throw new InvalidDataException(psarc.ErrMSG);

progress += step;
@@ -27,5 +27,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("e99dc5a5")]
[assembly: AssemblyInformationalVersion("e43e7565")]
[assembly: AssemblyConfiguration("")]
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("e99dc5a5")]
[assembly: AssemblyInformationalVersion("e43e7565")]
[assembly: AssemblyConfiguration("")]
@@ -1,3 +1,3 @@
2.9.2.0
e99dc5a5
e43e7565

0 comments on commit 8c0983e

Please sign in to comment.
You can’t perform that action at this time.