PDA

View Full Version : Help: sendQuery($socket,"pl");


UWS_CIA
10-06-2005, 01:51
Hi, i'm trying to get the IP out of this query and i was wondering if anyone else has had the same problem... with it give out 0.0.0.0

I'm, writing a VB and or PHP app for TS & Counter Strike Auto swap player to channel by client ip but can't get client ip from the query

I was thinking of using loginname or nickname but they can be chnaged by the client and arn't relyable...

thanks in advance for any help.

sendQuery($socket,"pl");
// read player info
$playerList = array();

//Skip the first line. It only contains header labels
fgets($socket);
while (true)
{
//Read the next line from the socket
$line = fgets($socket);

//Break it up on the tab delimiter
$playerinfo = explode("\t", $line);

//Bail out if only one element
if (count($playerinfo) == 1)
{
//Only one element means the OK has been encountered.
//The list is done.
break;
}

//Stuff the array values into variables
list($playerid, $channelid, $receivedpackets, $receivedbytes, $sentpackets, $sentbytes, $d, $d, $totaltime, $idletime, $d, $d, $d, $ip, $playername, $loginname) = $playerinfo;

$playerList[$playerid] = array("playerid" => $playerid,
"channelid" => $channelid,
"receivedpackets" => $receivedpackets,
"receivedbytes" => $receivedbytes,
"sentpackets" => $sentpackets,
"sentbytes" => $sentbytes,
"totaltime" => $totaltime,
"idletime" => $idletime,
"playername" => str_replace("\"", "", $playername));
echo $loginname." IP = ".$ip."<br>";
}

Cyrus
10-06-2005, 13:26
This is not a problem or bug or something like that. The only thing is you have to Login with a Serveradmin or Superadmin-Account first. Then you get the real Client-IP instead of 0.0.0.0 It's the same thing as in the client.

PS: If you need some prepared PHP things look at CyTS in my signature, may be useful for you

UWS_CIA
10-06-2005, 23:17
Thanks, that'll get me started anyway...
You wouldn't happen to know where to find a query for login...
And if you could look at this list of queries and let me know if i'm missing any...
cl
dbserverlist
gi
login - this is for normal login i assume
msg
msgall
pl
sel
serverstart
serverstop
serveradd
serverdel
serverset
si
slogin - so this would be the superadmin login i'll be needing?

Thanks again for the help...

Cyrus
11-06-2005, 10:31
Hmm you need the following things I think

login - For authenticating as a server admin to get the Client IPs and later to move the players
pl - to get the players and their IDs
cl - you may need this to get the channeldata
mptc - moving players to channels

If you need a complete list of all commands that are available connect through telnet to any server e.g.
telnet voice.teamspeak.org 51234
and type
help

UWS_CIA
11-06-2005, 19:22
Thanks again, I got it working last night...
just need to setup query scripts for CS:S