|
#define | INFO_AI_CONTROL "Have control now over AI/Multiplayer planes" |
|
#define | INFO_AI_CONTROL_ENDS "Released control of AI/Multiplayer planes" |
|
#define | INFO_REMOTE_CLIENT_AI "XPMP2 Remote Client controls TCAS. We don't need control as our planes will show up there." |
|
#define | WARN_NO_AI_CONTROL "%s controls TCAS / AI. %s could NOT acquire control, our planes might NOT appear on TCAS or 3rd party apps." |
|
#define | DEBUG_AI_SLOT_ASSIGN "Aircraft %llu: ASSIGNING AI Slot %d (%s, %s, %s)" |
|
#define | DEBUG_AI_SLOT_RELEASE "Aircraft %llu: RELEASING AI Slot %d (%s, %s, %s)" |
|
#define | MSG_ADD_DATAREF 0x01000000 |
| Message to DRE/DRT to inform about dataRefs. More...
|
|
#define | SET_DR(ty, dr) XPLMSetData##ty(drTcas##dr, v##dr.data(), 1, (int)v##dr.size()) |
|
#define | FIND_PLANE_DR(membVar, dataRefTxt, PlaneNr) |
|
#define | SHARE_PLANE_DR(membVar, dataRefTxt, PlaneNr) |
|
#define | UNSHARE_PLANE_DR(membVar, dataRefTxt, PlaneNr) |
|
|
constexpr float | XPMP2::FAR_AWAY_VAL_GL = 9999999.9f |
| Don't dare using NAN...but with this coordinate for x/y/z a plane should be far out and virtually invisible. More...
|
|
constexpr float | XPMP2::AISLOT_CHANGE_PERIOD = 15.0f |
| How often do we reassign AI slots? [seconds]. More...
|
|
constexpr int | XPMP2::AI_PRIO_MULTIPLIER = 10 * M_per_NM |
| How much distance does each AIPrio add? More...
|
|
float | XPMP2::F_NULL [10] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f} |
| A constant array of zero values supporting quick array initialization. More...
|
|
constexpr int | XPMP2::XPLM_PHASE_AIRPLANES = 25 |
| The drawing phase "xplm_Phase_Airplanes" is deprecated in XP11.50 upwards, but we need it in earlier versions to fake TCAS. More...
|
|
const char * | XPMP2::DATA_REF_EDITORS [] |
|
std::vector< std::string > | XPMP2::vecDREdataRefStr |
| list of dataRef strings to be send to the editors More...
|
|
constexpr size_t | XPMP2::SDR_CSLMODEL_TXT_SIZE = 40 |
| Number of characters to be allowed for CSL model text. More...
|
|
Implementation of serving TCAS target dataRef updates.
Updates the up to 63 slots of X-Plane's defined TCAS targets, which are in turn synced with the 19 "legacy" multiplayer slots, which in turn many other plugins (like TCAS implementations or map tools) read to learn about any multiplayer aircraft.
Also serves shared dataRefs for publishing text information, which is not X-Plane standard but originally suggested by FSTramp. However, the post and file, in which he suggested this addition, is no longer available on forums.x-plane.org. Still, XPMP2 fullfills the earlier definition.
- See also
- X-Plane 11.50 Beta 8 introduced a new way of informing X-Plane of TCAS targets, see here a blog entry for details: https://developer.x-plane.com/article/overriding-tcas-and-providing-traffic-information/
- Author
- Birger Hoppe
- Copyright
- (c) 2020 Birger Hoppe
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
const char* XPMPMultiplayerEnable |
( |
void(*)(void *) |
_callback = nullptr , |
|
|
void * |
_refCon = nullptr |
|
) |
| |
Tries to grab control of TCAS targets (formerly known as AI/multiplayer) from X-Plane.
Only one plugin can have TCAS targets control at any one time. So be prepared to properly handle an non-empty response that indicates that you did not get control now. The returned message includes the name of the plugin currently having control.
If successful, XPMP2's aircraft will appear on TCAS and are available to 3rd-party plugins relying on TCAS tagrtes or multiplayer dataRefs.
Typically, a plugin calls this function just before the first aircraft are created. But it could also be bound to a menu item, for example.
- Parameters
-
_callback | (optional) You can provide a callback function, which is called directly by X-Plane when control of TCAS targets is not successful now but becomes available later. |
_refCon | (optional) A value just passed through to the callback. |
- See also
- X-Plane SDK documentation on XPLMAcquirePlanes for more details about the callback.
- Returns
- Empty string on success, human-readable error message otherwise, includes name of plugin currently having TCAS tagrets control