rscustom / rocksmith-custom-song-toolkit

Custom song toolkit for Rocksmith and Rocksmith 2014
http://www.rscustom.net/
343 stars 80 forks source link

psarc files are imported as xbox files when filename length is 42 and exception is thrown #358

Open kortov opened 4 years ago

kortov commented 4 years ago

I can't include a file here, but when a filename for example is Van-Halen_Aint-Talkin-Bout-Love_v4_p.psarc and I import a package then this exception is thrown.

System.Exception: Invalid Package
   at X360.STFS.STFSPackage..ctor(DJsIO xIOIn, LogRecord LogIn)
   at X360.STFS.STFSPackage..ctor(String xLocation, LogRecord LogIn)
   at RocksmithToolkitLib.DLCPackage.Packer.UnpackXBox360Package(String srcPath, String destDirPath, Platform platform) in C:\Users\Korto\RiderProjects\rocksmith-custom-song-toolkit\RocksmithToolkitLib\DLCPackage\Packer.cs:line 558
   at RocksmithToolkitLib.DLCPackage.Packer.Unpack(String srcPath, String destDirPath, Platform overridePlatform, Boolean decodeAudio, Boolean overwriteSongXml) in C:\Users\Korto\RiderProjects\rocksmith-custom-song-toolkit\RocksmithToolkitLib\DLCPackage\Packer.cs:line 134
   at RocksmithToolkitGUI.DLCPackageCreator.DLCPackageCreator.PackageImport(String srcPath, String destDir) in C:\Users\Korto\RiderProjects\rocksmith-custom-song-toolkit\RocksmithTookitGUI\DLCPackageCreator\DLCPackageCreator.cs:line 2068
   at RocksmithToolkitGUI.DLCPackageCreator.DLCPackageCreator.btnPackageImport_Click(Object sender, EventArgs e) in C:\Users\Korto\RiderProjects\rocksmith-custom-song-toolkit\RocksmithTookitGUI\DLCPackageCreator\DLCPackageCreator.cs:line 2039
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I guess it's due this line https://github.com/rscustom/rocksmith-custom-song-toolkit/blob/5a8cb74e44b15628f730ce7596d6887be526b1f8/RocksmithTookitGUI/DLCPackageCreator/DLCPackageCreator.cs#L2065

kortov commented 4 years ago

Honestly that package is weird. In Rocksmith it was played wrong (it can't zoom in zoom out). Then I tried to look at it in rstoolkit and I got here. Then I cropped filename, imported it to rstoolkit , generated a new file and now it works. Just cropping filename didn't work in Rocksmith.

L0FKA commented 4 years ago

sure, there should be && instead of || (or additional check if it's not a _p file) since xbox cdlc are mostly guid and no meaningful info other tyhan prefix or actual psarc header in file...