Skip to content

Comments

Add Pilots endpoint - connected pilots on VATSIM/IVAO#96

Open
ZeroKaa wants to merge 6 commits intoflybywiresim:stagingfrom
ZeroKaa:onlinePilots
Open

Add Pilots endpoint - connected pilots on VATSIM/IVAO#96
ZeroKaa wants to merge 6 commits intoflybywiresim:stagingfrom
ZeroKaa:onlinePilots

Conversation

@ZeroKaa
Copy link
Contributor

@ZeroKaa ZeroKaa commented Jun 22, 2021

No description provided.

Copy link
Member

@nistei nistei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package-lock.json file should not be removed.

Comment on lines +12 to +27
const arr: PilotInfo[] = [];
for (const p of data.pilots) {
arr.push({
callsign: p.callsign,
aircraft: p.flight_plan?.aircraft,
arrival: p.flight_plan?.arrival,
departure: p.flight_plan?.departure,
heading: p.heading,
altitude: p.altitude,
groundspeed: p.groundspeed,
name: p.name,
latitude: p.latitude,
longitude: p.longitude,
});
}
return arr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use the Array.map() method.

Comment on lines +32 to +53
const arr: PilotInfo[] = [];
for (const c of data) {
if (c.indexOf(':PILOT:') > -1) {
const split = c.split(':');
arr.push(
{
callsign: split[0],
aircraft: split[9],
arrival: split[13],
departure: split[11],
heading: parseInt(split[45]),
altitude: parseInt(split[7]),
groundspeed: parseInt(split[8]),
name: '',
latitude: parseFloat(split[5]),
longitude: parseFloat(split[6]),
},
);
}
}

return arr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use the Array.map() method.

@NathanInnes
Copy link
Member

@ZeroKaa Do you plan on returning to this? If not I can step in and look into finishing this PR

@ZeroKaa
Copy link
Contributor Author

ZeroKaa commented Sep 20, 2022

@ZeroKaa Do you plan on returning to this? If not I can step in and look into finishing this PR

Hello. No plan for the moment. Go ahead. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants