TwinFan / XPMP2

Multiplayer library for X-Plane 11/12 with instancing, TCAS override, and sound
https://twinfan.github.io/XPMP2/
Other
24 stars 16 forks source link

Remote Client: Transfer and populate sim/cockpit2/tcas/targets/flight_id #25

Closed TwinFan closed 3 years ago

TwinFan commented 3 years ago

Current Situation / Problem No value for flight_id is currently transferred to the Remote Client. Therefore, the dataRef sim/cockpit2/tcas/targets/flight_id is not populated.

Suggested Solution flight_id is populated with what the virtual function XPMP2::Aircraft::GetFlightId() returns. Transfer this value via message to the Remote Client in a new field. That requires a new version of the RemoteAcDetailTy message and therefore handling and testing of cross-version scenarios.

On the remote side, the value can then just be stored in XPMP2::Aircraft::acInfoTexts.flightNum, from where it will automatically be used for populating the dataRef sim/cockpit2/tcas/targets/flight_id.

Benefits dataRef sim/cockpit2/tcas/targets/flight_id filled in instances where TCAS/AI is controlled by the Remote Client.

Additional context Thread on X-Plane.org.

TwinFan commented 3 years ago

Actually...obsolete with #27 as then acInfoTexts.flightNum is transferred already, hence flight_id filled according to the standard GetFlightId() functionality. (Strictly speaking not according to a derived classes implementation...but I decide we don't need that now.)