Closed ikkennigij121 closed 1 year ago
Additional note: as soon as the status changes from AC_OFF to AC_LIVE the exception is thrown.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=AssettoCorsaSharedMemory
StackTrace:
at AssettoCorsaSharedMemory.AssettoCorsa.OnGraphicsUpdated(GraphicsEventArgs e) in D:\Texture Pack\assettocorsasharedmemory-master\AssettoCorsa.cs:line 223
D:\Texture Pack\ is just the location I saved the sharedmemory masterfile where the referenced DLL is located.
@ikkennigij121 there is an issue with this library, where it assumes the event "GameStatusChanged" of type "GameStatusChangedHandler" has a subscriber.
My recommendation would be to comment out the line GameStatusChanged(this, new GameStatusEventArgs(gameStatus));
And obtain the game status directly from the Graphics like you are doing.
@ikkennigij121 I fixed this in https://github.com/mdjarv/assettocorsasharedmemory/pull/15
@ikkennigij121 I fixed this in #15
Cheers!
Hello,
I'm trying to figure out how to get the status of the race by using AC_STATUS in following manner. Bare in mind it's very simplistic as I'm discovering how it works:
I'm getting a null reference exception pointing to following code:
The console writes one line of the status, after which it throws the exception.
any idea what can be the cause?
Kind regards