PHP server monitor with sockets getstatus value


(kansas) #1

Hello,

I have a php script that show me informations off my enemy territory server on my website. The problem is that i can’t get the team of players when i do this:


$conne = fsockopen('udp://IP','PORT');
fwrite($conne, chr(255) . chr(255) . chr(255) . chr(255) . chr(0x02) . 'getstatus' . chr(0x00));

Someone can give me the value to replace in place of getstatus’ or tell me where i can find it.
Thanks.


(schnoog) #2

The playerteam is, if available on the mod which is running, responded on the getstatus query.
Take a look on the var “P”


(kansas) #3

Thank to reply, i have try:


fwrite($conne, chr(255) . chr(255) . chr(255) . chr(255) . chr(0x02) .'getstatus -P' . chr(0x00));

but the result is the same.


(schnoog) #4

“P” is, if available, a cvar returned within the answer of getstatus, just like hostname, mapname and so on.
Here the answer of a server (xml style in qstat):


                        <rule name="P">------2------1-1</rule>

which means the first playername in the answer is in allied team, the second and the third axis

  • means “empty slot”
    2 allies
    1 axis
    3 spectator

(kansas) #5

What an idiot… Its clear now and its work perfectly, thanks a lot schnoog.


(schnoog) #6

You`re welcome :slight_smile: