Jump to content
The simFlight Network Forums

Paul Henty

  • Posts

  • Joined

  • Days Won


Everything posted by Paul Henty

  1. Hi Pete, Access to datarefs would only be possible if they are supported by XPUIPC (mirroring the LVAR facilities in FSUIPC). I'm guessing that's not the case, so unfortunately there is no way to access datarefs with my DLL. This .NET library (available on NuGet) uses a direct connection to XPlane (rather than via XPUIPC). Its features include: You can send commands and subscribe to DataRef. An event OnDataRefReceived is fired every time the value of a subscribed DataRef changes. https://www.nuget.org/packages/XPlaneConnector Paul
  2. Great, thanks for letting me know. Yes I'll continue to support this. It's good to know people are using it and finding it useful. Paul
  3. Okay. It sounds like there might be a problem in the server code. I'll run this tomorrow and see if I can reproduce the disconnection. Paul
  4. Hi Manuel, The server doesn't close the socket after a single request. It remains open for multiple requests until you close it. If you're seeing the socket being closed then it's probably your code that's closing it unintentionally. Look for places in your code that you calling ws.close(). Check that this isn't being called by mistake when your handling the response from the server. (e.g. is a case statement falling through with no 'break'?) It might help if you post your code so I can try it here. Paul
  5. Hi Andy, Sorry for the delay in replying. I've been away. I've looked through your bullet point requirements. Items 1 & 4 can be done with FsTaxiway object at the moment as it tells you if the player is on a particular taxiway or not. The others all rely on intersections of taxiways. These are not currently in the FsTaxiway object but I think it's fairly simple to calculate these and add them to the class. Each taxiway will have a list of intersections. Each intersection will include the position of the intersection and a pointer to the taxiway/runway it intersects with. This will give you a network of taxiways rather than a flat list like it is now. Going through the remaining bullet points, these all seem possible if you know the intersection points. It's just a case of testing how far they are from the player and in which direction. I'll add this over the next week or 2. Paul
  6. Hi Markus, If you're using my .NET Client DLL then please download the Example Code Application from the website (A VB.NET Version is available): http://fsuipc.paulhenty.com/#downloads There are helper classes in the DLL that can assist you with repositioning the aircraft and calculating Longitude/Latitude points. This examples for these are in the section called "Lon/Lat Helper Classes". You will also need to know the locations of airports and runway headings etc. If you don't have your own database for this the DLL has an Airport Database facility. Examples are in the section called "Airport\Runways Database". Paul
  7. Hi Paulus, Your application must be running at the same privilege level as FSUIPC7. For example if you start FSUIPC7 'as administrator' then you must also start your application (or Visual Studio if you are coding/debugging) 'as administrator'. Or you can run both not 'as administrator'. The most likely cause of this error is that one is 'as administrator' but the other isn't. Paul
  8. Yes you can create 2 offsets (best done in a separate declare request). They must be in this order: 0x3114 - uint 4 - Parameter 0x3110 - uint 4 - Control In the offfset.write request, set your control number (e.g. 66241) and any parameter. (set 0 if there is no parameter like for TOGGLE_MASTER_BATTERY). Yes, I think you assign them to free offsets and then use the offsets and normal. For FSUIPC4,5 and 6 I would need to update the websocket server for LVars as the offset trick is not available for those version. Paul
  9. Not really. You can try reading that offset looking for 59. But you might miss it if you read it too slowly, or if the aircraft software resets the value to 0 too quickly. Also, if the user presses the Init button in the sim, that isn't going to show up at all in that offset. Generally, when reading data from the Sim , you're reading the effects of pressing the button, not the buttons themselves. e.g. you're detecting the autopilot being switched on/off, not the pilot pressing the autopilot toggle button. Paul
  10. Not via offsets. The best you can do is the local time at the players location. If you use the Airports Database built into the DLL you can get the Lon/Lat of the airport. With this you can use a NuGet package called GeoTimeZone to get the time zone at that location. https://github.com/mattjohnsonpint/GeoTimeZone You can then use another NuGet package called TimeZoneConverter to convert this to the normal .NET TimeZoneInfo class. https://github.com/mattjohnsonpint/TimeZoneConverter You can then use that to work out the local time from the UTC Simulator time from the DLL: (FSUIPCConnection.UTCDateTime). Something like this: string timeZoneIANA = TimeZoneLookup.GetTimeZone(apLat, apLon).Result; TimeZoneInfo tzInfo = TZConvert.GetTimeZoneInfo(timeZoneIANA); DateTime airportLocalTime = TimeZoneInfo.ConvertTimeFromUtc(FSUIPCConnection.UTCDateTime, tzInfo); Paul
  11. Ah, great news. Thanks for your help with testing and getting the error messages. Paul
  12. Hi Steve, I found 2 problems, including the delegate potentially being garbage collected (as per the error message). Can you try 3.2.6-beta please? (You'll need to tick the box 'include prerelease' to see it). Thanks, Paul
  13. Yes, that one is much better. Thanks. I'll look at this this evening. Paul
  14. Thanks for the report. I think I've found the problem. Please try 3.2.5, now available on NuGet. Paul
  15. Hi everyone, John made some very useful changes to the WAPI DLL. This has enabled me to improve the way the MSFSVariableServices works. See version 3.2.3-Beta of my DLL. Note that you will need version 0.5.0 or later of the FSUIPC_WAPID.dll. (See the first post for the location of the download). The first post in this thread has been updated to include the new changes and also a quick-start example. The main change is that RefreshData() has now been removed. You don't need to call this anymore because it's now purely event-driven. The MSFSVariableServices module will now automatically maintain the current LVar values in the background (according to the LVARUpdateFrequency property). Two new events are now available: OnVariablesReadyChanged will tell you when the variable have been discovered by the WASM module and it's ready to use. (Check the OnVariablesReady property). OnValuesChanged will tell you when at least one of the LVar values has been changed. I can't test here so please report success/failure here. Thanks, Paul
  16. Hello, I don't know, sorry. I don't use FSUIPC7 so I'm not following it's development. I can only suggest trying it. If John has added LVAR access via offset 0x0D70 then the ReadLVar() method will just start working again. I remember you having problems with MSFSVariableServices. Have you given up with it? John is upgrading his WASM API soon which will allow me to make considerable improvements to MSFSVariableServices. Mainly, it will let you know when the LVars are ready to read (so no more waiting random seconds) and also it will move to a purely event-driven model. i.e. No need for RefreshData() anymore. Hopefully this will solve the problems people are having with timings and variable discovery. Paul
  17. Try flying without the tools. If it doesn't crash then one of the tools is the problem. Add back your tools one at a time until you find the problem tool. If it still crashes without tools then it could be the P3D installation itself, or hardware issues, or driver (e.g. graphics card) issues. You should also make sure you are running the latest updates to P3D, your tools, aircraft, graphics drivers etc. It would be better to ask about your problem on the P3D support forums. They also have troubleshooting guides there. I can't help you any further here as this is a programming forum and I don't have P3D. I don't know sorry. I don't have any problems but only write in English. Paul
  18. The message in your picture is from an application that uses FSUIPC to communicate with P3D. When your P3D crashes, this application cannot get a reply from FSUIPC so it shows this error. You need to find out why P3D is crashing. This message if not from P3D or FSUIPC. Paul
  19. Very strange. I notice that your example code application is out of date. Can you please try with the latest version, and update it's copy of the client dll to the latest stable or beta version. Paul
  20. Thanks. I still can't think what could be causing this. Please can you try using a different FSUIPC client. I suggest FSInterrogate2std.exe from the FSUIPC SDK: Read the Aircraft Info in that program to see if's working there: 1. Goto the Interrogate Tab 2. Type in an offset range from 3130 to 3177 3. Press [Setup fields] 4. Press [Select all] on the toolbar 5. Press [Read buffer-1] to get the values (They should appear in the last column). If this program also doesn't get the values then there's something wrong with FSUIPC itself or maybe FS2004. Paul
  21. I've tried here with FS2004, the latest version (3.2.2-Beta) of my FSUIPC Client DLL and FSUIPC 3.999z9b and it works fine. To check if the problem is with my DLL or not, can you please log the following two offsets in FSUIPC: E004 (U16) and F004 (U16). These will show how many ground and airborne AI planes FSUIPC is seeing. Let me know the results. Thanks, Paul
  22. It crashes because that HVar doesn't exist. You can see the list of LVARs and HVARs found by using LogHVars() and LogLVars(). What do they show? Remember that you need to wait a few seconds after Start() before the WASM module is ready. Paul
  23. There seems to be a problem somewhere other than your code/my dll then. The best thing to do would be to ask John about this in the MSFS support forum under a new topic. If you tell him the WASMClient.exe is connecting but not finding any LVARs he may be able to suggest things to check, Paul
  24. Your code looks okay now. Can you please try running John's WASMClient.exe program to check if that is returning any LVars. You can find it in the FSUIPC-WASMv0.4.10.Zip file. Paul
  • 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.