Closed Pomax closed 10 months ago
For some reason the airport handling is all kinds of broken, where "written as its own script" it will find all airports:
import { Protocol, open } from "node-simconnect"; const { handle } = await open(`airport test`, Protocol.KittyHawk); const AIRPORT_TYPE = 0; const list = []; const requestId = 1; await new Promise((resolve) => { const handler = (data) => { if (data.requestID === requestId) { const { airports, entryNumber, outOf } = data; list.push(...airports); if (entryNumber >= outOf -1) { handle.off("airportList", handler); resolve(); } } }; handle.on("airportList", handler); handle.requestFacilitiesList(AIRPORT_TYPE, requestId); }); console.log(`found ${list.length} airports`); handle.close();
However, the same code used in the airports.js file stops receiving result sets after the first two.
safe to say this got addressed with the new airport code.
For some reason the airport handling is all kinds of broken, where "written as its own script" it will find all airports:
However, the same code used in the airports.js file stops receiving result sets after the first two.