Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: staging
Choose a base branch
from

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