Author: Sickboy
Author Website:

Version: 0.5

Short description:

Date: 2006-12-04 00:40


Comments: (0)
Rating:



 

6th Sense Advanced Server Query Script v0.5!
By Sickboy

Changes :
- Fixed capital letter problem, probably causing failures on *nix (linux etc) systems (Thanks to SniperAndy for testing and reporting)

- Added settings for the size of the images that you use, at the moment used for some text, but in the future it might be used for dynamic choosing of right font size and positions depending on the size of the images.

- Changed tabstops to 8, which will probably make the scripts display proper on most editors.


Script Header :

6th Sense Advanced GameSpy Server Query Script v0.5 by Sickboy (sb_at_6thsense.eu)
With parts of DSSQ Server Query Script v1.1 by Daddl.

The included functions can be used for multigames,
the 6th-advSQ.php file can be copied for different server settings,
or the variables: ip, p, qp, t, sn, img, siz or rnd can be set by passing them
to the script with: ?ip=.....&p=... etc. etc.
CWD means Current Working Directory, so it's the path where the script resides/is run from
Read below for full list and explainations of settings

Some games lack certain functionality, changes and tweaks could be required here and there.

Any code from this script may be used, changed or deleted as anyone sees fit.
As long as proper credit or header is maintained.

Notes:
- BF2/Swat4 Needs Testing and probably tweaking
- Players aren't displayed for OFP & VC2. Probably fixed by updated scripting or using binary mode (need help)
- When many players are connected, in image mode, the players will probably end up outside the image pretty soon
will write an updated display soon

Written with: UltraEdit, Tabstop value 8 (Tabs may look weird in certain editors)


Old Rabble
ArmA uses gamespy, like OFP. AFAIK there is a possibility to use the Gamespy protocols or the binary format as with OFP to display server information, players, map etc. in a webpage.

Update :
Got it all working , v0.2 released

Update2 :
New functionality etc, v0.3 released

Update3 :
New functionality, v0.4 released

It is now split up in a function library include and a server file made for 1 server, which you could either edit or copy as many times as you wish to display multiple servers.
ArmA should work flawless, the rest (VC2, SWAT4, BF2, OFP) I am still implementing properly.


New functionality :
The Script now can also be setup for 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't triggered every page load of every page where it is displayed

Ability to give variables with the URL which affect settings, check the files for more info.

The script can now output in html stat output OR as image like Daddl's Server Query Script. With permission of Daddl I used functions from his script for the creation of the image, thanks again!

For those that already have a script or page and just need a Simple PHP Query:

Code Sample
$addr="ip.adress"; // e.g: 127.0.0.1
$port="port"; // e.g: 2302

$sock = fsockopen(("udp://" . $addr),$port,$errno,$errdesc,$maxwait);
$query = pack("c*",0xFE,0xFD,0x00,0x04,0x05,0x06,0x07,0xFF,0xFF,0xFF);

fwrite($sock,$query);
@socket_set_timeout($sock, 2);
$reply = @fread($sock, 2048);
  fclose($sock);

if($reply != '')
{
$Infoarray = explode(chr(0), $reply);

$querysuccess = true;
$Name = $Infoarray[4];
$Ver = $Infoarray[2];
$Status = $Infoarray[16];
$Numteams = $Infoarray[12];
$Numplayers = $Infoarray[10];
$Maxplayers = $Infoarray[14];
$Gametype = $Infoarray[8];
$Mission = $Infoarray[44];
$Players = $Infoarray[54] . $Infoarray[58] . $Infoarray[62]; // and so on and so on (Interval of 4 per player)
};





Enable javascript to be able to download from Armaholic please!



Tags: No tags