View Full Version : COD4 Server Stats PHP Script (For websites)
England4eva
05-16-2008, 08:16 PM
Hi All,
I`ve converted a MOHAA Server status script over to be used with Call Of Duty 4. The purpose of the script is to display what map your server is on, the gametype, player, pings and scores.
You can then display these live stats on your clans website.
If anyone is interested you can grab the file from the following link
COD4 Server Stats (http://www.enbclan.com/download.php?f=/cod4/COD4ServerStats.rar)
Studek
05-16-2008, 09:09 PM
looks easy to use.......... (needs to be with me lol )
Will have a play.
Virus
05-17-2008, 06:55 PM
Nice...
I wrote a server scan class for the BVA site here (http://www.b-v-a.co.uk/site/servers.php) i've uploaded it if it's any use to anyone..
Returns server settings & player information in a multidimensional array so the data can be used anywhere (it's not formatted)
Example array output here (http://www.b-v-a.co.uk/cod4/test.php)
Download Here (http://www.b-v-a.co.uk/cod4/server_query.zip)
Swoopie
05-17-2008, 11:12 PM
Ohhh V, I seriously thought I wrote that for a moment looking at that writing. God I must have a twin, writes codes exactly how I would and the names wow :o !
Taught by a pr0 ey ;)
Virus
05-18-2008, 03:15 PM
Ohhh V, I seriously thought I wrote that for a moment looking at that writing. God I must have a twin, writes codes exactly how I would and the names wow :o !
Taught by a pr0 ey ;)
I'm a clone really.
lol that's actually the pants version, i lost my old one with the query strings for 10 diff games and rcon functionality when we lost the old old bva site... but it does the job i suppose ;(
Swoopie
05-18-2008, 09:47 PM
Isnt array_search time consuming? Why not use my old string thingy tht got all the var's from the server - that was good ;)
any way wer are u come msn (L)
Virus
05-19-2008, 12:10 AM
Isnt array_search time consuming? Why not use my old string thingy tht got all the var's from the server - that was good ;)
any way wer are u come msn (L)
Indeed, revised that one (i said it was old!), re-uploaded and modified test ver :) grabs all DVars from the server now too and isn't so picky!
Shaved 0.04 off the query time :P
Swoopie
05-19-2008, 08:50 AM
Ohhh V thats very sexy, But you forgot to add some other stuff *-)
test.php is now missing :P
Ohh + why not add either...
Line 32:
$vData[$server_vars[$i]] = $server_vars[$i + 1];
Change it too:
$vData[$server_vars[$i]] = $this->doCodNames($server_vars[$i + 1]);
That way, any of the strings that need colour get it (But there's a problem - This will increase the script time :$)
Ok ok, the only thing that might have colour is the hostname.. Soo...
Line 35: Add
$vData["sv_hostname"] = $this->doCodNames($vData["sv_hostname"]);
That should do the trick :] (lets hope no 1 set the var then as sv_Hostname oops :$)
oh and V.. your doCodNames won't work properly come to look at it? You haven't closed the <font> or <b> ? oopsie *-)
Virus
05-19-2008, 10:52 AM
Ohhh V thats very sexy, But you forgot to add some other stuff *-)
test.php is now missing :P
Ohh + why not add either...
Line 32:
$vData[$server_vars[$i]] = $server_vars[$i + 1];
Change it too:
$vData[$server_vars[$i]] = $this->doCodNames($server_vars[$i + 1]);
That way, any of the strings that need colour get it (But there's a problem - This will increase the script time :$)
Ok ok, the only thing that might have colour is the hostname.. Soo...
Line 35: Add
$vData["sv_hostname"] = $this->doCodNames($vData["sv_hostname"]);
That should do the trick :] (lets hope no 1 set the var then as sv_Hostname oops :$)
oh and V.. your doCodNames won't work properly come to look at it? You haven't closed the <font> or <b> ? oopsie *-)
Updated, added colouring to names.. closed tags and added basic IP validation.
Oh, and re-added test.php
Script time is between 0.00292897224426 and 0.00754499435425 (that's the highest i've had anyway)
EDIT: Example of data parsed (with extJS library) here (http://www.b-v-a.co.uk/cod4/test/)
Studek
05-19-2008, 11:52 AM
Script time is between 0.00292897224426 and 0.00754499435425 (that's the highest i've had anyway)
Way toooooooo long if you ask me ;) lol
Very nice coding indeed :D
England4eva
05-19-2008, 05:47 PM
You lot need to get out more ^^
Swoopie
05-19-2008, 10:17 PM
I'm recovering from a stroke, Doctor said take it easy :( I have an excuse ;)
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.