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>";
}
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>";
}