server info on webpages

Post here if you need help setting up your server, etc.
Post Reply
zoidberg
On Lightcycle Grid
Posts: 25
Joined: Thu Mar 13, 2008 2:45 am

server info on webpages

Post by zoidberg »

can anyone point me in the right direction for getting server info (like the players online) onto a webpage? I'm guessing it requires a program that will connect to each server and request a list of players and stuff right? or is there open source available for that already?
User avatar
DDMJ
Reverse Outside Corner Grinder
Posts: 1882
Joined: Thu Jun 08, 2006 12:15 am
Location: LA, CA, USA, NA
Contact:

Post by DDMJ »

This already has all the info that you need.

If you need some help, you can just find me on AIM/MSN/etc
zoidberg
On Lightcycle Grid
Posts: 25
Joined: Thu Mar 13, 2008 2:45 am

Post by zoidberg »

nice, so I can just grab that output with a cgi script on the webpage?
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

There's the source code for the ct version here if you want to unravel it.
mainpage.php is the summary displayed at the base of the ct forums.
serverbrowser.php is the ct server browser
getservers.sh is the script running to pull the info periodically off wrtlprnft's server.

There's many other server browsers, but this should get you started.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Re: server info on webpages

Post by wrtlprnft »

zoidberg wrote:I'm guessing it requires a program that will connect to each server and request a list of players and stuff right? or is there open source available for that already?
Such a program exists, actually there's two different ones.
Tank's script was written by reverse engineering the protocol, it has some problems with special characters on occasion, the source is available at the bottom of the page.
My version is based on arma's source code and reads some more information from the servers, and it can connect to a server like a client to get even more info.

If you just need a list of all players and servers I suggest you just use the XML feed Durka linked to to reduce the load on the servers and to avoid the relatively lengthy process of polling all servers.
There's no place like ::1
zoidberg
On Lightcycle Grid
Posts: 25
Joined: Thu Mar 13, 2008 2:45 am

Post by zoidberg »

awesome.
Thanks guys :)

you don't mind if I just use those scripts with some minor modifications do you ed?
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

zoidberg wrote:you don't mind if I just use those scripts with some minor modifications do you ed?
Do what you like with them.
zoidberg
On Lightcycle Grid
Posts: 25
Joined: Thu Mar 13, 2008 2:45 am

Post by zoidberg »

okay,
I got a happy little perl parser done for anyone who wants it.
It highlights player names with .dBd| tags and has a sort of sloppy HTML output but if you know even a little about perl you can go in and change all that.

Here it is for anyone in the future who wants it

all one needs to do is plug the HTML output into a webpage.
Attachments
armaSXMLParser.zip
XML parser that generates HTML output from serverxml.php arma server stats file. This includes the script that gets the xml file as well.
(3.78 KiB) Downloaded 246 times
Post Reply