hunterpankey / RockSnifferGui

Simple GUI to display RockSniffer data instead of having to read and display the text files from vanilla RockSniffer.
MIT License
5 stars 2 forks source link

Not working on latest Rocksmith update #4

Open Wildenhaus opened 1 year ago

Wildenhaus commented 1 year ago

Describe the bug It seems that this year's random update that broke CDLC also broke this app.

To Reproduce Steps to reproduce the behavior: Try running the GUI with the latest version of Rocksmith 2014. It sees the game is running but doesn't pull data.

Expected behavior For it to pull data from the game.

Desktop (please complete the following information): Windows 10

[2/11/2023 6:39:25 PM] GameProcessWatcher: Shutting down game process watcher worker thread.
[2/11/2023 6:39:25 PM] Error while reading memory: System.InvalidOperationException No process is associated with this object.
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.get_HasExited()
   at RockSnifferLib.RSHelpers.RSMemoryReader.FollowPointers(Int32 entryAddress, Int32[] offsets) in D:\source\personal\github\RockSniffer\RockSnifferLib\RSHelpers\RSMemoryReader.cs:line 139
   at RockSnifferLib.RSHelpers.RSMemoryReader.DoReadout() in D:\source\personal\github\RockSniffer\RockSnifferLib\RSHelpers\RSMemoryReader.cs:line 47
   at RockSnifferLib.Sniffing.Sniffer.<DoMemoryReadout>d__33.MoveNext() in D:\source\personal\github\RockSniffer\RockSnifferLib\Sniffing\Sniffer.cs:line 181
Wildenhaus commented 1 year ago

I was able to fix this with a few steps.

private void Sniffer_OnStateChanged( object sender, OnStateChangedArgs e )
{
  var newState = e.newState;
  var oldState = e.oldState;

  if ( ( oldState == SnifferState.IN_MENUS || oldState == SnifferState.SONG_SELECTED ) &&
      newState == SnifferState.SONG_STARTING )
  {
    OnSongStarted?.Invoke( this, new OnSongStartedArgs { song = currentCDLCDetails } );
  }
  else if ( newState == SnifferState.IN_MENUS &&
      oldState != SnifferState.NONE )
  {
    OnSongEnded?.Invoke( this, new OnSongEndedArgs { song = currentCDLCDetails } );
  }
}
apelliciari commented 1 year ago

@Wildenhaus can you release it as an .exe? thanks