Jump to content
The simFlight Network Forums

How do I know, the sim has exited?


Recommended Posts

Hi,

Let's say I'm reading two offsets (like fs version and framerate) again and again. By checking FSUIPCConnection.IsOpen I know if FSUIPC is still there. But how do I know, if the user has by chance closed MSFS and left just FSUIPC running? In such case I'm still getting values from last process, but can't tell if it just didn't change or if the sim has been closed.
Already tried Offset.Reconnect() hoping to force FSUIPC to read from the sim and give me f.e. 0 for the fs version or maybe 0 for the framerate, but that didn't do the trick. Somehow I'm stuck...

Link to comment
Share on other sites

Versions prior to FSUIPC7 all ran inside the Flight Sim process, so FSUIPC could never be left running on its own, so this was never a problem.

I don't know if John has added an offset to FSUIPC7 to know if the Flight Sim connection has been lost. I can't see anything on the spreadsheet. It might be a good feature to request.

For now, you could try something like reading offset 0x0230 (Double) which is a timestamp in seconds. If this doesn't change for a while then you know the connection to MSFS has been lost.

Paul

Link to comment
Share on other sites

Thank you, Paul. 0x0230 is a good workaround. Not perfect tho, as it stops sometimes - f.e. when the FS is paused, it delivers no change to the value, but still way better than anything I could find.
I think with a combination of timestamp and framerate I'll be able to find out if FS is running or not. An offset that tells us the actual status of the connection between FSUIPC and MSFS would be indeed a niceToHave. 🙂

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.