Skip to content
Permalink
Browse files

- improved tone name error handling

  • Loading branch information...
cozy1 committed Sep 27, 2019
1 parent 013e9e8 commit 1926e1bbb3ed5c0f35e0ece2da7ee983be68e8b0
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("7486b460")]
[assembly: AssemblyInformationalVersion("013e9e81")]
[assembly: AssemblyConfiguration("")]
@@ -1,5 +1,6 @@
Rocksmith Toolkit Release Notes

- improved tone name error handling
- unpacker audio naming fixes
- restored missing toolkit CLI executables
- added DDC Unit Testing to RocksmithToolkitGUI.Tests
@@ -91,7 +91,7 @@ public Arrangement(Attributes2014 attr, string xmlSongFile, bool fixMultiTone =
var song = Song2014.LoadFromFile(xmlSongFile);
this.SongFile = new SongFile { File = "" };
// TODO: monitor this change
this.SongXml = new SongXML { File = xmlSongFile , Version = song.Version};
this.SongXml = new SongXML { File = xmlSongFile, Version = song.Version };

//Properties
Debug.Assert(attr.ArrangementType != null, "Missing information from manifest (ArrangementType)");
@@ -201,7 +201,11 @@ public Arrangement(Attributes2014 attr, string xmlSongFile, bool fixMultiTone =
isDirty = true;
}
else
throw new InvalidDataException("Tone data is missing in CDLC and multitones will not change properly in game." + Environment.NewLine + "Please re-author XML arrangements in EOF and repair multitones name and time changes.");
{
throw new InvalidDataException("Tone data is missing, and multitones will not change properly in game." + Environment.NewLine +
"Please re-author XML arrangement '" + attr.ArrangementName + "' in EOF, and repair multitone names and time changes." + Environment.NewLine +
"NOTE: toolkit can fix this error by converting to single tone if you check: tookit>General Config>Fix Multitone Errors" + Environment.NewLine);
}
}
}

@@ -621,7 +621,7 @@ public static DLCPackageData LoadFromFolder(string unpackedDir, Platform targetP
var tuningName = TuningDefinitionRepository.Instance.Detect(attr.Tuning, GameVersion.RS2014);
data.Arrangements.Last().Tuning = tuningName.UIName;

// make a list of tone names used in arrangements
// make a list of tone names used in arrangements
var toneNames = new List<string>();
foreach (var arr in data.Arrangements)
{
@@ -18,8 +18,13 @@ public static string TuningToName(string tolkenTuning, List<TuningDefinition> tu
var jObj = JObject.Parse(tolkenTuning);
TuningStrings songTuning = jObj.ToObject<TuningStrings>();

return TuningToName(songTuning, tuningXml);
}

public static string TuningToName(TuningStrings songTuning, List<TuningDefinition> tuningXml = null)
{
// 2X speed hack ... use preloaded TuningDefinitionRepository
if (tuningXml == null)
if (tuningXml == null || tuningXml.Count == 0)
tuningXml = TuningDefinitionRepository.Instance.LoadTuningDefinitions(GameVersion.RS2014);

foreach (var tuning in tuningXml)
@@ -10,6 +10,10 @@ public class PsarcPackager : IDisposable
private string packageDir;
private bool _deleteOnClose;

/// <summary>
/// Use for reading (unpacking) and writing (packing) packages as a composite in/out operation
/// <para>Ensure proper usage of deleteOnClose: [false] for [read], and [true] for [write] operations</para>
/// </summary>
public PsarcPackager(bool deleteOnClose = false)
{
_deleteOnClose = deleteOnClose;
@@ -27,5 +27,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("7486b460")]
[assembly: AssemblyInformationalVersion("013e9e81")]
[assembly: AssemblyConfiguration("")]
@@ -20,7 +20,7 @@
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
<DefineConstants>TRACE;DEBUG;PREBUILD</DefineConstants>
<NoWarn>
</NoWarn>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -33,13 +33,15 @@
<DebugType>none</DebugType>
<NoWarn>0169, 0162</NoWarn>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DefineConstants>
</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Build CLI|x86'">
<OutputPath>bin\x86\Debug Build CLI\</OutputPath>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
<DefineConstants>TRACE;DEBUG;PREBUILD</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
@@ -297,6 +299,8 @@
<PreBuildEvent>rem Only need to make changes to version information below
rem RocksmithPreBuild.exe automatically updates Assembly.cs files and AppVeyor versioning information

if $(DefineConstants.Contains('PREBUILD')) == true (

if $(ConfigurationName) == Debug (
CD "$(SolutionDir)"

@@ -325,6 +329,8 @@ rem before issuing new release make next cmd active and comment out the others
rem cmd /c "RocksmithPreBuild.exe PREBUILD 2.9.0.0 RELEASE"
)

)

rem there are some hidden prebuild commands for OSX and Linux in the RocksmithToolkitLib.csproj these call the 'prebuild.sh' file</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
@@ -246,7 +246,7 @@ public bool IsCustomFont()
writeStruct(w, this.NLD);
writeStruct(w, this.Actions);
writeStruct(w, this.Events);
writeStruct(w, this.Tones);
writeStruct(w, this.Tones); // monitor for multitone exceptions
writeStruct(w, this.DNAs);
writeStruct(w, this.Sections);
writeStruct(w, this.Arrangements);
@@ -9,6 +9,7 @@
using MiscUtil.IO;
using MiscUtil.Conversion;
using CON = RocksmithToolkitLib.Sng.Constants;
using System.Diagnostics;


namespace RocksmithToolkitLib.Sng2014HSL
@@ -511,13 +512,9 @@ private void parseTones(Song2014 xml, Sng2014File sng)

try
{
if (String.IsNullOrEmpty(xml.ToneBase))
throw new InvalidDataException("ToneBase must be defined.");

// fix for undefined tone name (tone name should be shorter)
if (xml.ToneBase.ToLower() == tn.Name.ToLower())
t.ToneId = 0;

if (xml.ToneA.ToLower() == tn.Name.ToLower())
t.ToneId = 0;
else if (xml.ToneB.ToLower() == tn.Name.ToLower())
@@ -529,10 +526,19 @@ private void parseTones(Song2014 xml, Sng2014File sng)

sng.Tones.Tones[i] = t;
}
catch (Exception)
catch (Exception ex)
{
throw new InvalidDataException("There is tone name error in XML Arrangement: " + xml.Arrangement + " " + tn.Name + " is not properly defined." + Environment.NewLine +
"Use EOF to re-author custom tones or Notepad to attempt manual repair.");
Debug.WriteLine(ex.Message);

if (String.IsNullOrEmpty(xml.ToneBase))
throw new InvalidDataException("Missing XML <tonebase> element in arrangement '" + xml.Arrangement + "'" + Environment.NewLine +
"Use EOF to re-author arrangement custom tones, or Notepad to attempt manual repair of XML <tonebase> element ..." + Environment.NewLine);
else if (String.IsNullOrEmpty(xml.ToneA) || String.IsNullOrEmpty(xml.ToneB) || String.IsNullOrEmpty(xml.ToneC) || String.IsNullOrEmpty(xml.ToneD))
throw new InvalidDataException("Corrupt XML multitone elements in arrangement '" + xml.Arrangement + "'" + Environment.NewLine +
"Use toolkit 'CDLC Creator' to restore XML <tonea> thru <toned> elements, or re-author arrangement with EOF ..." + Environment.NewLine);
else
throw new InvalidDataException("There is tone name matching error in XML arrangement '" + xml.Arrangement + "'. Tone name '" + tn.Name + "' is not properly defined ..." + Environment.NewLine +
"Use EOF to re-author arrangement custom tones, or Notepad to attempt manual repair of XML <tonebase> thru <toned> elements ..." + Environment.NewLine);
}
}

@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("7486b460")]
[assembly: AssemblyInformationalVersion("013e9e81")]
[assembly: AssemblyConfiguration("")]
@@ -1,3 +1,3 @@
2.9.2.0
7486b460
013e9e81

0 comments on commit 1926e1b

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