-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: staging
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
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; |
There was a problem hiding this comment.
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.
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; |
There was a problem hiding this comment.
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.
This reverts commit cd6840f.
@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 👍 |
No description provided.