SimConnect Managed code BUG ?

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
User avatar
Simbol
Posts: 908
Joined: Thu Sep 07, 2017 10:24 pm
Location: UK
Contact:

SimConnect Managed code BUG ?

Post by Simbol »

Hello,

it seems that the required data structure of SIMCONNECT_RECV_ATTACHPOINT_DATA is always returning dwObjectID=0 for the SimConnect.RecvAttachpointDataEventHandler.

Example:

AddHandler p3d_simconnect.OnRecvAttachpointData, New SimConnect.RecvAttachpointDataEventHandler(AddressOf p3d_simconnect_OnRecvAttachpointData)

p3d_simconnect.RequestAttachPointData(DataRequests.Request_2, UserObjectID, "attachpt_landing_01", False)

On the previous call the userid = 2 and the loaded plane is the default Money Bravo.

Event Handler:

Private Sub p3d_simconnect_OnRecvAttachpointData(ByVal sender As SimConnect, ByVal data As SIMCONNECT_RECV_ATTACHPOINT_DATA)
Dim EffectPos As SIMCONNECT_DATA_XYZ

Select Case data.dwRequestID
Case DataRequests.Request_2

DisplayText("ID= " + data.dwObjectID.ToString())
DisplayText("X= " + data.xyzLocalOffset.x.ToString())
DisplayText("Y= " + data.xyzLocalOffset.y.ToString())
DisplayText("Z= " + data.xyzLocalOffset.z.ToString())

Case Else
DisplayText("Unknown request ID: " + data.dwRequestID.ToString())
End Select

End Sub

The positions and offset results are returned correctly in feet's as per SDK documentation but the dwObjectID returned is always zero (note that the ObjectID send to RequestAttachPointData is different from zero), I tried the function against others Simconnect objects using different IDs but the result are always the same: I get the correct positions for the attachment points but the IDs are always being returned as ZERO.

Any idea why? Can somebody at LM can have a look at confirm if this is a bug?

Best Regards,
Simbol
Image
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
User avatar
WarpD
Posts: 1469
Joined: Mon Feb 14, 2011 5:29 am

Re: SimConnect Managed code BUG ?

Post by WarpD »

I was always understood that the user aircraft's ID was always 0.
Ed Wilson
Senior Developer
Mindstar Aviation
User avatar
Simbol
Posts: 908
Joined: Thu Sep 07, 2017 10:24 pm
Location: UK
Contact:

Re: SimConnect Managed code BUG ?

Post by Simbol »

Hi Ed,

Thanks for your help, I am also using the ID of AI planes and the evenhanlder function always return dwObjectID=Zero which cannot be true as it should be the SimObject ID for that plane, no?

Regards,
Simbol
Image
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: SimConnect Managed code BUG ?

Post by Clifton Crane »

Hi Simbol,

Thanks for the report. We'll open a ticket to investigate the issue.
Clifton Crane
Prepar3D® Software Engineer Sr.
User avatar
Simbol
Posts: 908
Joined: Thu Sep 07, 2017 10:24 pm
Location: UK
Contact:

Re: SimConnect Managed code BUG ?

Post by Simbol »

Clifton,

Many thanks for your quick response.

Best Regards,
Simbol
Image
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: SimConnect Managed code BUG ?

Post by Clifton Crane »

Hi Simbol,

The SimConnect_RequestAttachPointData will now correctly return the object id within the resulting struct. Developers can also now use SIMCONNECT_OBJECT_ID_USER as the object id parameter.

These changes will be available in the next release.

Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
User avatar
Simbol
Posts: 908
Joined: Thu Sep 07, 2017 10:24 pm
Location: UK
Contact:

Re: SimConnect Managed code BUG ?

Post by Simbol »

Clifton Crane wrote: Tue Dec 05, 2017 10:07 pm Hi Simbol,

The SimConnect_RequestAttachPointData will now correctly return the object id within the resulting struct. Developers can also now use SIMCONNECT_OBJECT_ID_USER as the object id parameter.

These changes will be available in the next release.

Thanks.
Clifton,

Many thanks for taking the time to report this back to me, I really appreciate it, this is a "key" function (you could say the most important) that I am currently using for my next payware, I had to put a lot of "way around code" to handle this particular bug making my current source code very in-efficient, so knowing that you guys have fixed this issue are superb news.

Would it be possible to have an estimation of when the next release with the fix will be available? as you might appreciate depending of the date I might decide to hold of my AI Lights Reborn Professional edition release date in order to be able to adapt my source code accordingly with this fix.

I understand you cannot reveal dates in public so I am more than happy to receive this privately and sing any NDA as required, all of course if this is posible.

Best Regards,
Simbol
Image
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
Locked