Board index FlightGear Support Multiplayer

Php Script to read callsigns from MpMap

Trouble getting online, setting up a server?
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- copy&paste your commandline.

Please, also see Requesting Technical Help.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Php Script to read callsigns from MpMap

Postby omega95 » Sat Oct 08, 2011 10:21 am

I don't really know if this is the right place to post this but I didn't find anywhere else.

Anyway, what I'm looking for is a php script to read callsigns, altitudes and aircraft from the mpservers for separate use.
It'd also be great if you just tell me how the mpmap does it.

I want to use the script to read callsigns with MIA in it so I can create a live schedule board (unlike the fake ones most use) that reads from bids.

Hope you can help :wink:
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: Php Script to read callsigns from MpMap

Postby Tuxklok » Sat Oct 08, 2011 7:05 pm

You can simply make a tcp connection to the mpserver on (usually) port 5001. It will then dump a list of mp users with names, positions, altitudes, etc down the line. It is also possible to use same mechanism the mpmap[s] use via a http request if you don't have access to raw sockets in your hosting environment, but because I don't know how the mpmap hosts would feel about people using/abusing their framework/hosting, I'll leave that as an exercise to any interested parties. The mpmap source is of course, completely available, if you want to see how it all works.

May also be possible to do an http request directly to the mpserver on port 5001 and get a usable response that way, but I don't think I ever tried, and results may very...

cheers
The Austria Scenery Project - more info
fg-scenery-tools - gitorious | videos
fgcomgui - Open source, cross platform, gui front end for fgcom. more info

More random musings and doings can be found on my personal site. (work in progress)
User avatar
Tuxklok
 
Posts: 1320
Joined: Tue Apr 21, 2009 7:04 pm
Location: Orlando, FL
Callsign: Tuxklok / N1292P
OS: GNU/Linux

Re: Php Script to read callsigns from MpMap

Postby Hooray » Mon Jan 02, 2012 10:33 pm

You can simply make a tcp connection to the mpserver on (usually) port 5001. It will then dump a list of mp users with names, positions, altitudes, etc down the line.

FWIW, PHP code to do this, was also posted here: http://code.google.com/p/flightgear-bug ... ail?id=450
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 2 guests