diff --git a/RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.cs b/RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.cs index 96802d255..a31ff5aea 100644 --- a/RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.cs +++ b/RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.cs @@ -112,19 +112,19 @@ private void PromptComplete(string destDirPath, bool actionPacking = true, strin if (actionPacking) destDirPath = Path.GetDirectoryName(destDirPath); - var actionMsg = "Packing"; + var diaMsg = "Packing"; if (!actionPacking) - actionMsg = "Unpacking"; + diaMsg = "Unpacking"; if (String.IsNullOrEmpty(errMsg)) - errMsg = actionMsg + " is complete." + Environment.NewLine + Environment.NewLine; + diaMsg = diaMsg + " is complete."; else - errMsg = actionMsg + " is complete with the following errors:" + Environment.NewLine + Environment.NewLine + + diaMsg = diaMsg + " is complete with the following errors:" + Environment.NewLine + errMsg; - errMsg += "Would you like to open the destination path? "; - - if (MessageBox.Show(errMsg, MESSAGEBOX_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) + diaMsg = diaMsg + Environment.NewLine + Environment.NewLine + "Would you like to open the destination path? "; + + if (MessageBox.Show(diaMsg, MESSAGEBOX_CAPTION, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) Process.Start(destDirPath); } @@ -686,11 +686,17 @@ public string PackSong(string srcPath, string destPath) sw.Stop(); GlobalExtension.ShowProgress("Finished packing archive (elapsed time): " + sw.Elapsed, 100); } + catch (OutOfMemoryException ex) + { + errMsg = String.Format("{0}\n{1}", ex.Message, ex.InnerException) + Environment.NewLine + + "Toolkit is not capable of repacking some large system artifact files. " + Environment.NewLine + + "Defragging the hard drive and clearing the 'pagefile.sys' may help."; + } catch (Exception ex) { - errMsg = String.Format("{0}\n{1}", ex.Message, ex.InnerException) + Environment.NewLine + Environment.NewLine + + errMsg = String.Format("{0}\n{1}", ex.Message, ex.InnerException) + Environment.NewLine + "Confirm GamePlatform and GameVersion are set correctly for" + Environment.NewLine + - "the desired destination in the toolkit Configuration settings." + Environment.NewLine + Environment.NewLine; + "the desired destination in the toolkit Configuration settings."; } if (!GlobalsLib.IsUnitTest) diff --git a/RocksmithTookitGUI/Properties/AssemblyInfo.cs b/RocksmithTookitGUI/Properties/AssemblyInfo.cs index b9493b2a9..b22381c83 100644 --- a/RocksmithTookitGUI/Properties/AssemblyInfo.cs +++ b/RocksmithTookitGUI/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // // THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT [assembly: AssemblyVersion("2.9.2.1")] -[assembly: AssemblyInformationalVersion("ef67384e")] -[assembly: AssemblyConfiguration("2020-02-18T15:58:11")] +[assembly: AssemblyInformationalVersion("4fe239f9")] +[assembly: AssemblyConfiguration("2020-02-27T18:35:45")] diff --git a/RocksmithTookitGUI/ReleaseNotes.txt b/RocksmithTookitGUI/ReleaseNotes.txt index 0cbd167df..ce6d55aaf 100644 --- a/RocksmithTookitGUI/ReleaseNotes.txt +++ b/RocksmithTookitGUI/ReleaseNotes.txt @@ -1,10 +1,11 @@ Rocksmith Toolkit Release Notes -- based on feedback changed audio/tone volume (LF) min/max range (45 to -45) +- improved large file out of memory exception handling and messages +- changed audio/tone volume (LF) min/max range (45 to -45) user suggestion - fixed update Arrangement Identification bug - updated RocksmithToolkitLib.SongAppId.xml dlc AppIds - improved auto repair of some old toolkit multitone exceptions -- volume ranges settable from 0 to -30 with better defaults +- volume ranges settable from 0 to -30 with defaults representative of odlc - fixed packer/unpacker PromptComplete now comes to front - autoconvert old template relative path format to the new format - added additional exception handling for corrupt '*.dlc.xml' templates diff --git a/RocksmithToolkitLib/PSARC/BigEndianBinaryWriter.cs b/RocksmithToolkitLib/PSARC/BigEndianBinaryWriter.cs index cb205861b..3b10b79a3 100644 --- a/RocksmithToolkitLib/PSARC/BigEndianBinaryWriter.cs +++ b/RocksmithToolkitLib/PSARC/BigEndianBinaryWriter.cs @@ -28,17 +28,17 @@ public void Flush() public void Write(byte v) { - try - { - this.BaseStream.WriteByte(v); - } - catch (Exception ex) - { - // little fish - Console.WriteLine(" Little Fish: " + ex.Message); - this.Flush(); - Thread.Sleep(200); - } + //try + //{ + this.BaseStream.WriteByte(v); + //} + //catch (Exception ex) + //{ + // // little fish + // Console.WriteLine(" Little Fish: " + ex.Message); + // this.Flush(); + // Thread.Sleep(200); + //} } public void Write(short v) @@ -124,21 +124,21 @@ public void WriteUInt40(ulong v) public void Write(byte[] val) { - try - { - for (int i = 0; i < val.Length; i++) - { - byte v = val[i]; - this.Write(v); - } - } - catch (Exception ex) + //try + //{ + for (int i = 0; i < val.Length; i++) { - // big fish - Console.WriteLine(" Big Fish: " + ex.Message); - this.Flush(); - Thread.Sleep(200); + byte v = val[i]; + this.Write(v); } + //} + //catch (Exception ex) + //{ + // // big fish + // Console.WriteLine(" Big Fish: " + ex.Message); + // this.Flush(); + // Thread.Sleep(200); + //} } public static void CopyStream(Stream input, Stream output) diff --git a/RocksmithToolkitLib/PSARC/PSARC.cs b/RocksmithToolkitLib/PSARC/PSARC.cs index f716e1363..c7b10086f 100644 --- a/RocksmithToolkitLib/PSARC/PSARC.cs +++ b/RocksmithToolkitLib/PSARC/PSARC.cs @@ -581,52 +581,52 @@ public void Write(Stream inputStream, bool encrypt = false, bool seek = true) //if (current.Name == "NamesBlock.bin") // continue; - try + //try + //{ + // use chunk write method to avoid OOM Exceptions + var z = zStreams[entry]; + var len = z.Length; + if (len > _header.BlockSizeAlloc) { - // use chunk write method to avoid OOM Exceptions - //var z = zStreams[entry]; - //var len = z.Length; - //if (len > 4096) - //{ - // using (var msInput = new MemoryStream(z)) - // using (var msExt = new MemoryStreamExtension()) - // using (var _writer2 = new BigEndianBinaryWriter(msExt)) - // { - // int bytesRead; - // int totalBytesRead = 0; - // var buffer = new byte[4096]; - // while ((bytesRead = msInput.Read(buffer, 0, buffer.Length)) > 0) - // { - // totalBytesRead += bytesRead; - // if (totalBytesRead > len) - // bytesRead = len - (totalBytesRead - bytesRead); - - // using (var msOutput = new MemoryStream()) - // { - // msOutput.Write(buffer, 0, bytesRead); - // _writer2.Write(msOutput.ToArray()); - // } - // } - - // _writer.Write(msExt.ToArray()); - // } - //} - //else + using (var msInput = new MemoryStreamExtension(z)) + using (var msExt = new MemoryStreamExtension()) + using (var _writer2 = new BigEndianBinaryWriter(msExt)) { - _writer.Write(zStreams[entry]); + int bytesRead; + int totalBytesRead = 0; + var buffer = new byte[_header.BlockSizeAlloc]; + while ((bytesRead = msInput.Read(buffer, 0, buffer.Length)) > 0) + { + totalBytesRead += bytesRead; + if (totalBytesRead > len) + bytesRead = len - (totalBytesRead - bytesRead); + + using (var msOutput = new MemoryStreamExtension()) + { + msOutput.Write(buffer, 0, bytesRead); + _writer2.Write(msOutput.ToArray()); + } + } + + _writer.Write(msExt.ToArray()); } } - catch //(Exception ex) - { - //Console.WriteLine(" _writer.Write: " + ex.Message); - _writer.Flush(); - } - finally + else { - if (entry.Data != null) - entry.Data.Close(); + _writer.Write(zStreams[entry]); } + if (entry.Data != null) + entry.Data.Close(); + //} + //catch (Exception ex) + //{ + // Console.WriteLine(" _writer.Write: " + ex.Message); + // _writer.Flush(); + // _writer.Dispose(); + // break; + //} + progress += step; GlobalExtension.UpdateProgress.Value = (int)progress; Console.WriteLine("Writing zData: " + entry.Id); diff --git a/RocksmithToolkitLib/Properties/AssemblyInfo.cs b/RocksmithToolkitLib/Properties/AssemblyInfo.cs index de1fff9bf..015aea1fe 100644 --- a/RocksmithToolkitLib/Properties/AssemblyInfo.cs +++ b/RocksmithToolkitLib/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // // THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT [assembly: AssemblyVersion("2.9.2.1")] -[assembly: AssemblyInformationalVersion("ef67384e")] -[assembly: AssemblyConfiguration("2020-02-18T15:58:11")] +[assembly: AssemblyInformationalVersion("4fe239f9")] +[assembly: AssemblyConfiguration("2020-02-27T18:35:45")] diff --git a/RocksmithToolkitUpdater/Properties/AssemblyInfo.cs b/RocksmithToolkitUpdater/Properties/AssemblyInfo.cs index cd3b370b5..4e1579a8d 100644 --- a/RocksmithToolkitUpdater/Properties/AssemblyInfo.cs +++ b/RocksmithToolkitUpdater/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // // THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT [assembly: AssemblyVersion("2.9.2.1")] -[assembly: AssemblyInformationalVersion("ef67384e")] -[assembly: AssemblyConfiguration("2020-02-18T15:58:11")] +[assembly: AssemblyInformationalVersion("4fe239f9")] +[assembly: AssemblyConfiguration("2020-02-27T18:35:45")] diff --git a/VersionInfo.txt b/VersionInfo.txt index 45de28413..f4f0ef344 100644 --- a/VersionInfo.txt +++ b/VersionInfo.txt @@ -1,3 +1,3 @@ 2.9.2.1 -ef67384e -2020-02-18T15:58:11 +4fe239f9 +2020-02-27T18:35:45