For our multiplayer flying, it’s crucial for us to be able to check that multiple pilots are flying with the same weather. It should be relatively simple - we have a standardised set of WPR preset files and all our pilots install those as a Community package, and for each of our multiple multiplayer flights each week we simply specify which weather preset should be loaded.
The flights will typically be VFR cross-country flights, all pilots fly with a MSFS logger running (a C# SimConnect app). The question is how can we log which WPR preset they’ve loaded. We need the contents of the preset, i.e. the weather settings not just the title.
In SimConnect pre-MSFS, this was very simple - SimConnect has an event callback when the WPR file is loaded giving the C# the path of that file, so the logger can read the file and log it’s contents.
In MSFS the ‘WPR preset loaded’ SimConnect API died, so we’re left with the difficult workaround of using the HTML/JS API to ask for the Weather parameters (JS_WEATHER_LISTENER), format whatever we find into a JSON message, and http send that JSON the the C# logger, bypassing SimConnect entirely.
FWIW what the logger puts into the log file is as below - it’s just the contents of the WPR file AFTER it’s been digested by the sim and re-written into the internal JS API format.
LNB21 185930 WPRE SSC24 v1 091 Large Cu T8 SW15
LNB21 185930 WSET 0.00 1013.25 60.00 0.00 0.00 0.00 1
LNB21 185930 WCL1 1.00 12.00 64.00 1810.59 5755.64
LNB21 185930 WCL2 0.00 0.00 0.00 8707.90 9352.40
LNB21 185930 WCL3 5.00 0.00 0.00 15625.91 15625.91
LNB21 185930 WWL1 0.00 225.00 12.86
LNB21 185930 WWL2 500.00 225.00 2.06
LNB21 185930 WWL3 1800.00 225.00 2.06
LNB21 185930 WWL4 1900.00 225.00 0.51
LNB21 185944 LTIM 000000 140037 +045906
LNB21 185944 WTHR 2328053 0024 1.00 091
This is all really fragile, we have to poll the JS API, create a hash from the ALL the weather values that are read, detect if that hash has changed from the previous one, and if so package up the data and send it over an http connection to the logger. The data is nominally available within a different MSFS subsystem but communicating that is problematic and the MAJOR issue is we have to design/mod this into all the planes used for our multiplayer flights.
If there’s any planned work on the weather API’s, it would be really helpful if the access to WPR data were simplified for logging apps, i.e. a SimConnect event would fire when any WPR preset is selected, and the contents of that WPR file would be available via SimConnect without any obfuscation.