PDA

View Full Version : Reading ArmA Server Info in PHP for website usage



Sickboy
Nov 15 2006, 09:41
I'm Pleased to present to you the 6th Sense Advanced Server Query Script v0.5!
Full Description is available at the Wiki page.

Links:
6thSense.eu Advanced Server Query Wiki (http://trac.6thsense.eu:800/arma/trac/wiki/6thSense.eu%20AdvancedServerQuery)

<span style='color:red'>As of now, all information (incl. Downloads) regarding 6thSense.eu is to be found in our:
6th Sense Community Wiki (http://www.6thsense.eu/wiki)
ArmA Trac/Wiki Development Area (http://trac.6thsense.eu:800/arma/trac/wiki)</span>

Mirrors:
ArmaHolic.com (http://www.armaholic.com/page.php?id=243) (Thanks to Foxhound)
More mirrors kindly requested&#33;

zyklone
Nov 15 2006, 09:45
Yeah, I have it working.
The protocol ArmA is using is version 2 of the gamespy protocol.

Take a look at http://dev.kquery.com/index.php?article=42 for some documentation on it.

Sickboy
Nov 15 2006, 09:47
Yeah, I have it working.
The protocol ArmA is using is version 2 of the gamespy protocol.

Take a look at http://dev.kquery.com/index.php?article=42 for some documentation on it.
Thanks Bigtime&#33; Been searching my ass off&#33; Taking a looky looky http://forums.bistudio.com/oldsmileys/smile_o.gif

Sickboy
Nov 15 2006, 12:09
Added my Findings to first post..
Should get anyone on the move who knows basic php, or already has gamespy scripts or experience

KeyCat
Nov 15 2006, 12:46
On a (semi-) related topic... I&#39;m wondering if it&#39;s possible to access the ArmA log file while the game/server is running?

If it is the new "echo" command would make it possible to have mission status etc. live on a web-site and may come in handy for big scale missions/on-line wars.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
echo

Description&#58; Sends any text into the debugger console or the logfile.

Syntax&#58; echo text
Parameters&#58; text&#58; String
Return Value&#58; Nothing

Example 1&#58; echo &#34;Text in logfile&#34;
[/QUOTE]

/KC

Sniper Pilot
Nov 15 2006, 13:13
Just what Get-Realism needed thanks folks...

bookmarked

Daddl
Nov 15 2006, 13:33
Binary format (at least with OFP and VBS1) doesn&#39;t contain player specific information.

Sickboy
Nov 15 2006, 13:41
Binary format (at least with OFP and VBS1) doesn&#39;t contain player specific information.
But ArmA does

This is what we get back:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> gamever1.00hostname6thSense.eu 01 &#40;info @<hidden> www.6thsense.eu&#41;mapnamegametypenumplayers0numteams0maxplayers65gamemodeopenwaitingtimelimit0password1pa

ram17param20currentVersion100requiredVersion100modCAequalModRequired1gameState1dedicated1p

latformwinlanguage65541difficulty1missionplayer_team_score_deaths_[/QUOTE]

Sickboy
Nov 15 2006, 15:52
Updated first post with updated scripting, had trouble with how I did it before.

SniperAndy
Nov 15 2006, 16:30
I was just about to say "ask Daddl" but he found his way already. So I hope somebody will get this working for ArmA soon... SES server is just around the corner and it would be great to hahve the server box on the site again. http://forums.bistudio.com/oldsmileys/wink_o.gif

Daddl
Nov 15 2006, 16:52
This is what we get back:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> gamever1.00hostname6thSense.eu 01 &#40;info @<hidden> www.6thsense.eu&#41;mapnamegametypenumplayers0numteams0maxplayers65gamemodeopenwaitingtimelimit0password1pa



ram17param20currentVersion100requiredVersion100modCAequalModRequired1gameState1dedicated1p



latformwinlanguage65541difficulty1missionplayer_team_score_deaths_[/QUOTE]
That looks more like GameSpy style answer - which is just a simple string you simply analyze using regular expressions (search this forum and you&#39;ll even find a well documented description of the format). If ArmA binary format (i.e. the query the internal game browsers of OFP and VBS used) actually contained the player information, tho, that would be very nice&#33; I can&#39;t check this atm, as I ordered the German version.

Feel free to use pDSSQ (http://daddl.net/downloads/dssq/pDSSQ.zip) as a base. You might need to adapt the script somewhat. Also for a binary query the Byte sequence must be adapted to the one used by ArmA. It&#39;s used for example in my sig to query the CiA server.

Sickboy
Nov 15 2006, 17:13
That looks more like GameSpy style answer - which is just a simple string you simply analyze using regular expressions (search this forum and you&#39;ll even find a well documented description of the format). If ArmA binary format (i.e. the query the internal game browsers of OFP and VBS used) actually contained the player information, tho, that would be very nice&#33; I can&#39;t check this atm, as I ordered the German version.

Feel free to use pDSSQ (http://daddl.net/downloads/dssq/pDSSQ.zip) as a base. You might need to adapt the script somewhat. Also for a binary query the Byte sequence must be adapted to the one used by ArmA. It&#39;s used for example in my sig to query the CiA server.
Hmmm well, I was using your script as base http://forums.bistudio.com/oldsmileys/smile_o.gif

I must admit, with the gamespy or binary answers etc. etc. I really have no clue what we are talking about...

Just that at first I used your Gspy query and that didn&#39;t give any info...  Only after using your Binary method I was receiving data (Altough Not proper) http://forums.bistudio.com/oldsmileys/smile_o.gif Hence I took it for granted that this is Binary mode http://forums.bistudio.com/oldsmileys/smile_o.gif. After reading the text on the kquery.com site, I had the correct query string and voila.

Anyway... I got it working 100% since the changes readable in my first post.
Thanks for help eitherway... DSSQ rules http://forums.bistudio.com/oldsmileys/smile_o.gif Program and PHP script http://forums.bistudio.com/oldsmileys/smile_o.gif

Rambo-16AAB
Nov 15 2006, 17:22
What I would like to see comming from you guys who are clever enough to code such things is a installable script to display the server info. we have such a thing for Joint operations, you can see how the script works here:-
http://www.16aab.org.uk/server/

It displays players, map type, name of map, sever open or passworded. Something thats as easily placed into existing websites would be great.

second thing would be for some clever bloke to develop a remote server admin tool for AA so we can admin the server settings etc from your desktop without logging into an admin web page or joining the game server to admin it.

I have no idea how to create such things or i would gladly contribute.

Sickboy
Nov 15 2006, 17:36
It displays players, map type, name of map, sever open or passworded. Something thats as easily placed into existing websites would be great.

second thing would be for some clever bloke to develop a remote server admin tool for AA so we can admin the server settings etc from your desktop without logging into  an admin web page or joining the game server to admin it.

I have no idea how to create such things or i would gladly contribute.
Try DSSQ from daddl, it is already as you want it, and can even display the stuff on top of an Image, as you can see in my sig http://forums.bistudio.com/oldsmileys/wink_o.gif
You can remotely admin the server only to restart the program, auto restart it and start it through webpage by using: www.serverdoc.com  program.
Any other form of remote adminning is impossible since the serverconsole is a pretty basic text log, and that&#39;s it.

example of dssq and other data harvest facilities: http://www.6thsense.eu/default.php?page=all_online (not all (player) details are available to normal members, but the example is there&#33http://forums.bistudio.com/oldsmileys/wink_o.gif

6th Sense has an auto-administrator & statistics collector for Vietcong1, it even kicks ppl off that rejoin while teamrespawn is enabled, adds time when the time almost runs out and all that kinda stuff http://forums.bistudio.com/oldsmileys/smile_o.gif Was a pretty long project to make it do everything we wanted ... but such thing will not be possible with ArmA since the serverconsole is just a log... But I don&#39;t know if they built in any rcon (bf2) alike support.....

Rambo-16AAB
Nov 15 2006, 17:52
Hmm, the Admin stuff is pretty Poo then. How can you rotate maps, admin players ( kick, ban, change team etc ) ?

Sickboy
Nov 15 2006, 17:58
Hmm, the Admin stuff is pretty Poo  then. How can you rotate maps, admin players ( kick, ban, change team etc ) ?
Admin players... either by voteadmin (would be best, since real admins can override/rule voted-admins), or by leaving the admin password blank (but that would suck http://forums.bistudio.com/oldsmileys/tounge2.gif)
But yes, a person must be ingame that is doing it yes.

Besides, in the config files of the server you can put in which maps need to run... Everytime a player joins, the next map gets loaded if the server was empty... or when it was full.. the next map will be loaded after the finishing of this map...
Exactly the same as with OFP http://forums.bistudio.com/oldsmileys/smile_o.gif

Rambo-16AAB
Nov 15 2006, 18:09
The admin in flashpoints Poo as well though.
As a Squad we preferred non playing admins to keep an eye on things, especially players. We dont like muppets on our servers. If its the same as Flashpoint, you have to play the map when your admin = you die when your typing commands. That looks like a major oversite since the game now supports JIP. Hope BIS can patch that to improve it.

Sickboy
Nov 15 2006, 18:13
The admin in flashpoints Poo as well though.
As a Squad we  preferred non playing admins to keep an eye on things, especially players. We dont like  muppets on our servers. If its the same as Flashpoint, you have to play the map when your admin = you die when your typing commands. That looks like a major oversite since the game now supports JIP.  Hope BIS can patch that to improve it.
You can always not play the map, but be a seagull or in spectator mode, that is just easily built into a mission, that you can make a special spot for such person .. when he takes that spot, he dies at the start and can watch over by spectating or seagull.

Otherwise ur right, if rcon alike stuff really isn&#39;t in (Im pretty positive), then it&#39;s a shame and I too hope BIS will build some at some point.

HitmanFF
Nov 16 2006, 07:17
Based on your first post, I&#39;ve adapted the RTSQ from WKK&#39;s EazyOne for ArmA. It&#39;s work-in-progress, but I have a first working version.

I need to check the players part, but have no server available to check it against at the moment. When that works, I&#39;ll make a version available.

Sickboy
Nov 16 2006, 07:48
Based on your first post, I&#39;ve adapted the RTSQ from WKK&#39;s EazyOne for ArmA. It&#39;s work-in-progress, but I have a first working version.

I need to check the players part, but have no server available to check it against at the moment. When that works, I&#39;ll make a version available.
If you query the master server you should be able to receive a list of servers+ports ... maybe there are players on those... Otherwise drop me a PM by tonight, there will probably be users on by then.

I edited phpgstats battlefield vietnam module and converted it for ArmA. The players are displayed correctly now etc. etc.
Altough I myself don&#39;t use the skin around it, but integrate into our site. I could share the module probably later tonight or tomorrow.

HitmanFF
Nov 16 2006, 08:40
Yes, I&#39;m using gslist to query the master server for games running.

The RTSQ query doesn&#39;t work on all of them; I&#39;m assuming that you have to start a dedicated server (like yours?) to actually answer the query. Only two servers so far return a reply, both empty atm.

I&#39;ll keep an eye on your server tonight, to see if it&#39;s occupied http://forums.bistudio.com/oldsmileys/smile_o.gif

Btw: the phpgstats is looking good, workings are similar to the RTSQ, apart from being compatible with a lot more games of course.

zyklone
Nov 16 2006, 09:00
I don&#39;t think too many others use ruby but someone might find this code interesting.

http://www.otyglad.net/~erik/gamespy2.rb

It parses the players array correctly also.

HitmanFF
Nov 16 2006, 12:23
Ruby looks like a very powerful language, haven&#39;t come across it before.

Meanwhile I&#39;ve found a few occupied servers, so I got the RTSQ to work with player data.

[APS]Gnat
Nov 17 2006, 12:22
I could share the module probably later tonight or tomorrow.
Thanks sickboy&#33;&#33; http://forums.bistudio.com/oldsmileys/smile_o.gif That would be great.

Sickboy
Nov 17 2006, 13:51
Gnat @<hidden> Nov. 17 2006,14:22)]
I could share the module probably later tonight or tomorrow.
Thanks sickboy&#33;&#33;  http://forums.bistudio.com/oldsmileys/smile_o.gif  That would be great.
Ok, here you go: 6thSense Advanced Server Query Script v0.2 (http://www.6thsense.eu/files/6thSense-advSQ.rar)

I will not give advanced support on it, it should be pretty obvious... http://forums.bistudio.com/oldsmileys/smile_o.gif Have fun&#33;

CrashDome
Nov 17 2006, 14:03
The admin in flashpoints Poo as well though.
As a Squad we  preferred non playing admins to keep an eye on things, especially players. We dont like  muppets on our servers. If its the same as Flashpoint, you have to play the map when your admin = you die when your typing commands. That looks like a major oversite since the game now supports JIP.  Hope BIS can patch that to improve it.
You dont have to be playing in Flashpoint. All you need to do is connect. Once you log in as Admin you can execute all the commands - even if a game is in progress. Yeah, you&#39;ll show up on the player list (or waiting list), but who cares?

Although I think it would be great to have the possibility to UDP in to execute commands. Live for Speed has this ability coupled with even the ability to receive UDP packets for all the players and their data. Since the data is the same as what is sent to the actual game, you can actually create a third-party viewing program or even use the data to run external guages. Now imagine in Arma, the ability to receive UDP packets for all units (as if you were just another player - only you are not running ArmA). You could run like a topographical map program to show the location of your units to an "officer" much like JSTARS. Would be awesome.

SniperAndy
Nov 17 2006, 15:46
Quote[/b] ]Although I think it would be great to have the possibility to UDP in to execute commands. Live for Speed has this ability coupled with even the ability to receive UDP packets for all the players and their data. Since the data is the same as what is sent to the actual game, you can actually create a third-party viewing program or even use the data to run external guages. Now imagine in Arma, the ability to receive UDP packets for all units (as if you were just another player - only you are not running ArmA). You could run like a topographical map program to show the location of your units to an "officer" much like JSTARS. Would be awesome

reading UDP packets would be amazing.
I saw some nice tracking of what is going on in world war II online. The map, stats of allied and german forces and news on their site had been created out of the actual game stats etc. this would be amazing.

Imagine you launch a massive CTI on a server and you can get all the infos on a website any time...

hoz
Nov 17 2006, 15:56
Great script there sickboy. Is there a way to show the ping time? and is there anyway to display all the server in the MP browser?

hoz

Sickboy
Nov 17 2006, 17:55
Great script there sickboy. Is there a way to show the ping time? and is there anyway to display all the server in the MP browser?

hoz
Pings are not included in the GameSpy data, so I can not give you those results. Maybe Binary does? Daddl might shed some light on that?

If I get the time free I will have a look&#33;

Sickboy
Nov 18 2006, 09:59
Released v0.3, first post updated with links & info.
Main addition: Possibility to display stats as image, as like Daddl&#39;s Server Query Script, Thanks to Daddl for letting me use parts of his script&#33;

[APS]Gnat
Nov 18 2006, 14:55
hmmmm thanks sickboy, but can you put it outside your forum/webpage please.
Even though I&#39;ve registered, *sigh* it still won&#39;t let me download it.
Cheers

Sickboy
Nov 18 2006, 15:03
Gnat @<hidden> Nov. 18 2006,16:55)]hmmmm thanks sickboy, but can you put it outside your forum/webpage please.
Even though I&#39;ve registered, *sigh* it still won&#39;t let me download it.
Cheers
My bad, Sorry&#33; Problem should be solved, retry the link

Sickboy
Nov 19 2006, 13:07
Script has been updated to v0.4:
The Script now can also be setup with a filename for the image, each time the script is run, it will not output the image to the user, but to a file. If you set this up with for instance cron, run every minute... Every minute your server status gets updated into a specified image file which you can display on a website or as signature etc. Which in fact saves resources because now the script isn&#39;t triggered every page load of every page where it is displayed http://forums.bistudio.com/oldsmileys/wink_o.gif

wizzywig
Nov 19 2006, 22:29
any one have a working link to the scripts

Odie3
Nov 20 2006, 13:29
Sickboy,


Could I have some IP&#39;s where Armed Assault is running? I am a beta tester for Qtracker (http://www.qtracker.com/) and I am trying to get the author to support Armed Assault.

FYI: Qtracker
This is a game browser, say like All Seeing Eye but much better.

Sickboy
Nov 20 2006, 14:01
any one have a working link to the scripts
The website was temporary down for a couple of hours today for maintenance, site is back up

whoisrich
Dec 1 2006, 23:32
By request, I have added Arma support to LGSL.

Its PHP based query script that supports many popular games.

You can download it at http://www.greycube.com

http://forums.bistudio.com/oldsmileys/smile_o.gif

[APS]Gnat
Dec 2 2006, 01:24
By request, I have added Arma support to LGSL.
Thanks for sharing dude

Aussie Dave
Dec 2 2006, 09:26
Running ArmA LGSL (http://gsa.bur.st/arma/lgsl/)


I love Qtracker wish i never brought The All-Seeing Eye


Most of the Servers we run (http://gsa.bur.st/xdf/server/lgsl/)

Sickboy
Dec 2 2006, 16:04
Updated my Server Query Script to v0.5, mainly fixes, especially for linux users.
If any have trouble setting it up, use this thread for feedback

Foxhound
Dec 3 2006, 15:44
I missed this one.

Armaholic.com (http://www.armaholic.com) mirror updated.

Download it here (http://www.armaholic.com/page.php?id=243).

BilOlson
Dec 4 2006, 11:59
@<hidden> thanks for quick response, sorry for it being a little to vague (thought you might be a mind reader, hehe) Was due to it being pre-6am and my body not absorbing my morning caffeine and nicotine fast enough...

Ok here it goes.. to all developing, my hats off to ya&#33; I&#39;ll go ahead and ask since no one else has (I can&#39;t be the only one). btw I do have basic php and server admin knowledge.
I cant get this to work properly, it does come up with "server is not responding error", so file seems to be working, at least its outputting...

My question is could this be a problem with our host?

or arma server and/or arma host machine config problem?

or a permission problem maybe?

Someone interested in explaining how they personally chose to install it and got it to work, I don&#39;t need detailed step by step, just a semi-condensed explanation. I&#39;m sure besides helping me it&#39;ll help the hundreds others not asking but rather waiting for the answer to magically appear..

Abracadabra, p00f&#33;

Sickboy
Dec 4 2006, 12:02
Added the info from this post into the first post "FAQ" section.
Also added a section: "Quick install help". Hope it hits the spot m8, goodluck&#33;

BilOlson
Dec 4 2006, 12:23
Muchos Gracias Senor&#33;

Definitely a game server machine problem...now to convince the game server "owner", lol ..

@<hidden> look at the two you got in your sig....one says not responding and one says empty, whats causing the not responding one? Cause our server is busy as hell right now with people on it, but get "not responding" version..

Sickboy
Dec 4 2006, 17:21
Muchos Gracias Senor&#33;

Definitely a game server machine problem...now to convince the game server "owner", lol ..

@<hidden> look at the two you got in your sig....one says not responding and one says empty, whats causing the not responding one? Cause our server is busy as hell right now with people on it, but get "not responding" version..
It&#39;s not responding because it&#39;s down until wednesday.

Are you sure you selected the right ip and port in your configuration of the script? ArmaMods.net got my script running aswell
Otherwise it&#39;s probably because one of the reasons that are in the 1st post, contacting your ISP is anyway a good idea to check if the webserver supports outgoing connectiosn as some might block that for security reasons.

Send me your server ip and port in PM, then I will put that in my script and we can see if its your config/webhoster or still sth with the gameserver itself