XPMP2-Sample/XPMP2-Sample.cpp
void CBPlaneNotifier(XPMPPlaneID            inPlaneID,
                     XPMPPlaneNotification  inNotification,
                     void *                 /*inRefcon*/)
{
    XPMP2::Aircraft* pAc = XPMP2::AcFindByID(inPlaneID);
    if (pAc) {
        LogMsg("XPMP2-Sample: Plane of type %s, airline %s, model %s, label '%s' %s",
               pAc->acIcaoType.c_str(),
               pAc->acIcaoAirline.c_str(),
               pAc->GetModelName().c_str(),
               pAc->label.c_str(),
               inNotification == xpmp_PlaneNotification_Created ? "created" :
               inNotification == xpmp_PlaneNotification_ModelChanged ? "changed" : "destroyed");
    }
}
/// This is the callback for the plane notifier function, which just logs some info to Log.txt
/// @note Plane notifier functions are completely optional and actually rarely used,
///       because you should know already by other means when your plugin creates/modifies/deletes a plane.
///       So this is for pure demonstration (and testing) purposes.

This is the callback for the plane notifier function, which just logs some info to Log.txt
This is the callback for the plane notifier function which just logs some info to Log . txt
void CBPlaneNotifier(XPMPPlaneID            inPlaneID,
                     XPMPPlaneNotification  inNotification,
                     void *                 )
{
    XPMP2::Aircraft* pAc = XPMP2::AcFindByID(inPlaneID);
    if (pAc) {
        LogMsg("XPMP2-Sample: Plane of type %s, airline %s, model %s, label '%s' %s",
               pAc->acIcaoType.c_str(),
               pAc->acIcaoAirline.c_str(),
               pAc->GetModelName().c_str(),
               pAc->label.c_str(),
               inNotification == xpmp_PlaneNotification_Created ? "created" :
               inNotification == xpmp_PlaneNotification_ModelChanged ? "changed" : "destroyed");
    }
}
void CBPlaneNotifier ( XPMPPlaneID inPlaneID , XPMPPlaneNotification inNotification , void * ) { XPMP2 :: Aircraft * pAc = XPMP2 :: AcFindByID ( inPlaneID ) ; if ( pAc ) { LogMsg ( " " , pAc -> acIcaoType . c_str ( ) , pAc -> acIcaoAirline . c_str ( ) , pAc -> GetModelName ( ) . c_str ( ) , pAc -> label . c_str ( ) , inNotification == xpmp_PlaneNotification_Created ? " " : inNotification == xpmp_PlaneNotification_ModelChanged ? " " : " " ) ; } }
This is the callback for the plane notifier function, which just logs some info to Log.txt
This is the callback for the plane notifier function which just logs some info to Log . txt
/*inRefcon*/