I have this problem in the Delta Best plugin code. I have come to realize I don't know when the user enters or exits a session. That is, if I start rF2, click "Race" and then go from the monitor screen to driving, I get the "Enter Realtime" event. Then if I type "ESC" to exit and go back to the monitor, I don't get any "Exit Realtime" event. Moreover, if I go back to the car/track selection screen, choose car/track and click Race again and then drive, I don't get any other "Start Session" or "Enter Realtime" events... Ideally I would need that to reset the current best lap and start clean in the new session. I figured I could do the same checking the current track/car name in the UpdateScoring() method, but those enter/exit events are there for a reason. Any ideas?
From my side, i use also the EndSession API method to clean my data. For information, when you are in a session, and you do ESC + Restart Session -> the endSission is not called, just the StartSession is called. So, i clean information in the StartSession, and the EndSession API method. If it is not suffisant for you, you can check ScreenInfoV01 and if info.mOptionsLocation < 2 you are before a track is loaded
Gerald, I do clean up my data in StartSession. The problem is that I can load a different car/track and start driving and no StartSession event will be generated (that I can see, maybe I'm doing something wrong). I'll definitely check out ScreenInfoV01 and mOptionsLocation. Thanks for that!
hi, from my test this W.E. the exit real time was called when going back to "pits" , i.e. when player was hitting ESC.