更新 'src/MultiPlayer/multiplaymgr.cxx'

This commit is contained in:
zhongjin 2022-11-07 16:00:41 +08:00
parent aa66c3c71d
commit 534cc13be0

View File

@ -1440,7 +1440,7 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
std::string mAirportid = fgGetString("/instrumentation/comm/airport-id");
strncpy(PosMsg->airport, mAirportid.c_str(), 4);
PosMsg->airport[4 - 1] = '\0';
//PosMsg->airport[4 - 1] = '\0';
float heading = ifce.get_Psi();
@ -1452,27 +1452,32 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
PosMsg->jwhtext[2] = XDR_encode_float (roll);
SGPropertyNode* n = fgGetNode("/instrumentation/gps/indicated-ground-speed-kt",true);
float speed = n->getDoubleValue();
PosMsg->jwhtext[3] = XDR_encode_float (speed);
float xxx = n->getDoubleValue();
PosMsg->jwhtext[3] = XDR_encode_float (xxx);
/*
n = fgGetNode("/instrumentation/gps/indicated-vertical-speed");
xxx = fgGetDouble("/instrumentation/gps/indicated-vertical-speed");
PosMsg->jwhtext[4] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/airspeed-indicator/indicated-speed-kt"); //指示空速
xxx = fgGetDouble("/instrumentation/airspeed-indicator/indicated-speed-kt"); //指示空速
PosMsg->jwhtext[5] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/airspeed-indicator/true-speed-kt"); //真空速
xxx = fgGetDouble("/instrumentation/airspeed-indicator/true-speed-kt"); //真空速
PosMsg->jwhtext[6] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/gps/indicated-longitude-deg");
xxx = fgGetDouble("/instrumentation/gps/indicated-longitude-deg");
PosMsg->jwhtext[7] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/gps/indicated-latitude-deg");
xxx = fgGetDouble("/instrumentation/gps/indicated-latitude-deg");
PosMsg->jwhtext[8] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/gps/indicated-altitude-ft");
n = fgGetNode("/instrumentation/comm/airport-id"); //起飞机场
n = fgGetNode("/instrumentation/comm/frequencies/selected-mhz"); //守护频点
xxx = fgGetDouble("/instrumentation/gps/indicated-altitude-ft");
PosMsg->jwhtext[9] = XDR_encode_float (xxx);
xxx = fgGetDouble("/instrumentation/comm/frequencies/selected-mhz"); //守护频点
PosMsg->jwhtext[10] = XDR_encode_float (xxx);
n = fgGetNode("/instrumentation/transponder/id-code");
xxx = fgGetDouble("/instrumentation/transponder/id-code");
PosMsg->jwhtext[11] = XDR_encode_float (xxx);
//n = fgGetNode("");