From 534cc13be020b6ce6c23ef777fb4420ce36da4af Mon Sep 17 00:00:00 2001 From: zhongjin Date: Mon, 7 Nov 2022 16:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/MultiPlayer/multiplay?= =?UTF-8?q?mgr.cxx'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MultiPlayer/multiplaymgr.cxx | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 065698c..2e34b6e 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -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("");