PHP: Retrieve raw server info


(Paul) #1

Hi all,

I got this script already to retrieve some data frome et server:

<?php
$conne = fsockopen(‘udp://IP’,‘PORT’);
fwrite($conne, chr(255) . chr(255) . chr(255) . chr(255) . chr(0x02) . ‘getstatus’ . chr(0x00));
fread($conne, 4);
$status = socket_get_status($conne);
$data = fread($conne, $status[‘unread_bytes’]);
fclose($conne);
echo $data;
?>

But this shows only current users with ping,name and xp and further some standard info like:
Cvar Value
g_fixedphysicsfps 125
g_fixedphysics 0
mod_url http://shitstorm.org
mod_version 1.2.0
g_SBCheats 0
P 1313122312122121221223122311122102112112
g_maxlivesRespawnPenalty 0
voteFlags 4063167
g_balancedteams 1
g_maxGameClients 0
g_bluelimbotime 15000
g_redlimbotime 15000
gamename noquarter
jp_insanity 396
g_skills 18
g_tyranny 1
g_heavyWeaponRestriction 20
g_gametype 4
g_antilag 1
g_voteFlags 0
g_alliedmaxlives 0
g_axismaxlives 0
g_minGameClients 0
g_needpass 0
g_maxlives 0
g_friendlyFire 1
sv_allowAnonymous 0
sv_floodProtect 1
sv_maxPing 750
sv_minPing 0
sv_maxRate 50000
sv_minguidage 0
sv_punkbuster 0
sv_maxclients 40
sv_hostname <HOSTNAME>
sv_privateClients 5
mapname castleattack_b5
protocol 84
timelimit 39
version ET 2.60b linux-i386 May 8 2006

Is there a way to get more then this?
Thx :slight_smile:


(th0rn3) #2

What do you want to get more?


(-SSF-Sage) #3

Server password? :smiley:


(kamikazee) #4

I’m not sure there is more to get - only the stuff you listed is “public”. All other server settings cannot be seen by clients unless there is some other data synchronization happening (userinfo and the likes).


(dutchmeat) #5

You can however get ‘all the other information’ if you have the rconpassword of the server. You can do this by using a q3 php class.

One class you could use(make sure you check SourceForge for q3 php stuff);
http://misc.slowchop.com/misc/wiki/q3query


(kamikazee) #6

Information which can only be gathered through rcon is not really public. For example, you don’t want your server or rcon password exposed.


(Rudi) #7

A Q3 PHP class wouldn’t really be needed all you’re doing is sending plain udp packets anyway…

Anyway kamikazee he never said about it being public data :smiley:


(dutchmeat) #8

I don’t know what Scary’s intensions are but if it’s his server, then he can retrieve every bit of info he would like using rcon.

A Q3 PHP class wouldn’t really be needed all you’re doing is sending plain udp packets anyway…

Once again, I don’t know what Scary wants, but if he is planning to ‘manage’ multiple servers, then classes are the most effecient way of programming.


(th0rn3) #9
  • Thread bump * as I want to retrieve server info, but this script doesnt work, so can anyone tell me how to retrieve raw server info to php?

(ailmanki) #10

This script works only with rconpassword…
And I guess to be able to get the info without rconpass, it needs some modifications to the connect string.


(th0rn3) #11

all I get is a white screen. Btw, server is on another host (game server host, and clan site is on web host)


(ailmanki) #12

well this is a test script for command line php, not for a website.

But the class should work fine for a webpage. Yet there it needs some special things. Also some caching mechanism, else somebody might refresh the page and keep your server busy …
I add you to my ICQ … if you like I might help.


(stealth6) #13

you could try vsp stats.
That connects to your server and downloads the server log, then gets the stats from that


(th0rn3) #14

I want vsp too, but i dont understand how to set it up for downloading log.