Teamspeak Status
Auteur: Boaz den Besten - 02 januari 2005 - 16:00 - Gekeurd door: Dennisvb - Hits: 9153 - Aantal punten: 4.00 (1 stem)
een handig script waarmee je kan zien wie er in een teamspeak server zitten.
|
Code: |
//tsfuncties.php\\
<?
###################################
## Gemaakt door: Boaz den Besten ##
## Gemaakt op: 07/09/2004 ##
###################################
//Player Status
function pl_status($pl_status)
{
echo "<img src=\"image/ts/bullet_" . $pl_status . ".gif\"> ";
}
//Player Flags
function pl_flags($pl_flags,$ch_flags)
{
if($pl_flags == 13)
{
echo "R SA";
}
elseif($pl_flags == 5)
{
echo "R SA";
}
elseif($pl_flags == 4)
{
echo "R";
}
else
{
echo "U";
}
if($ch_flags == 1)
{
echo " CA";
}
}
//Channel Flags
function ch_flags($nr)
{
$ch_flags[0] = " (R)";
$ch_flags[1] = " (U)";
$ch_flags[2] = " (RM)";
$ch_flags[3] = " (UM)";
$ch_flags[4] = " (RP)";
$ch_flags[5] = " (UP)";
$ch_flags[6] = " (RMP)";
$ch_flags[7] = " (UMP)";
$ch_flags[8] = " (RS)";
$ch_flags[9] = " (US)";
$ch_flags[10] = " (RMS)";
$ch_flags[11] = " (UMS)";
$ch_flags[12] = " (RPS)";
$ch_flags[13] = " (UPS)";
$ch_flags[14] = " (RMPS)";
$ch_flags[15] = " (UMPS)";
$ch_flags[16] = " (RD)";
$ch_flags[18] = " (RMD)";
$ch_flags[20] = " (RPD)";
$ch_flags[22] = " (RMPD)";
$ch_flags[24] = " (RSD)";
$ch_flags[26] = " (RMSD)";
$ch_flags[28] = " (RPSD)";
$ch_flags[30] = " (RMPSD)";
echo $ch_flags[$nr];
}
?>
//tsfuncties.php\\ <? ################################### ## Gemaakt door: Boaz den Besten ## ## Gemaakt op: 07/09/2004 ## ################################### //Player Status function pl_status($pl_status) { echo "<img src=\"image/ts/bullet_" . $pl_status . ".gif\"> "; } //Player Flags function pl_flags($pl_flags,$ch_flags) { if($pl_flags == 13) { } elseif($pl_flags == 5) { } elseif($pl_flags == 4) { } else { } if($ch_flags == 1) { } } //Channel Flags function ch_flags($nr) { $ch_flags[0] = " (R)"; $ch_flags[1] = " (U)"; $ch_flags[2] = " (RM)"; $ch_flags[3] = " (UM)"; $ch_flags[4] = " (RP)"; $ch_flags[5] = " (UP)"; $ch_flags[6] = " (RMP)"; $ch_flags[7] = " (UMP)"; $ch_flags[8] = " (RS)"; $ch_flags[9] = " (US)"; $ch_flags[10] = " (RMS)"; $ch_flags[11] = " (UMS)"; $ch_flags[12] = " (RPS)"; $ch_flags[13] = " (UPS)"; $ch_flags[14] = " (RMPS)"; $ch_flags[15] = " (UMPS)"; $ch_flags[16] = " (RD)"; $ch_flags[18] = " (RMD)"; $ch_flags[20] = " (RPD)"; $ch_flags[22] = " (RMPD)"; $ch_flags[24] = " (RSD)"; $ch_flags[26] = " (RMSD)"; $ch_flags[28] = " (RPSD)"; $ch_flags[30] = " (RMPSD)"; } ?>
//tsinfo.php\\
<?
###################################
## Gemaakt door: Boaz den Besten ##
## Gemaakt op: 09/09/2004 ##
## Versie: 1.2 ##
## Weizigingen sinds 1.1: ##
## * Kleine dingetjes verbeterd. ##
## Versie: 1.1 ##
## Wijzigingen sinds 1.0: ##
## * Functie pagina verbeterd. ##
## * Een klein foutje opgelost ##
## als de server leeg is. ##
###################################
//Variablen die nodig zijn voor de connectie...
$ts['ip'] = "hier het ip van de server"; //Server IP
$ts['queryport'] = 51234; //Query Port deze poort moet wel toegankelijk zijn via het internet, is die dat niet, dan kan je dit script niet gebruiken.
$ts['port'] = "8767"; //Server Port
$ts['name'] = "hier de naam van de server"; // Server name
######################################
## HIER ONDER NIET MEER WIJZIGEN!!! ##
######################################
include("tsfuncties.php");
$chhashid = 0;
$plhashid = 0;
$subchhashid = 0;
//Connectie maken met de server...
$cmd = "cl " . $ts['port'] . "\nquit\n";
$connection = @fsockopen ($ts['ip'], $ts['queryport'], &$errno, &$errstr, 1);
if (!$connection)
{
echo "Could not connect to the server.";
}
else
{
@fputs($connection,$cmd, strlen($cmd));
while($channeldata = @fgets($connection, 4096))
{
$channeldata = explode(" ", $channeldata);
if(isset($channeldata[5]) AND $channeldata[5] !== "name")
{
if($channeldata[2] > -1)
{
//Sub-Channel hash maken...
$subchhash[$subchhashid] = $channeldata[3] . ";" . $channeldata[5] . ";" . $channeldata[6] . ";" . $channeldata[0] . ";" . $channeldata[2];
$subchhashid++;
}
else
{
//Channel hash maken...
$chhash[$chhashid] = $channeldata[3] . ";" . $channeldata[5] . ";" . $channeldata[6] . ";" . $channeldata[0];
$chhashid++;
}
//Connectie maken met de server...
$int_cmd = "pl " . $ts['port'] . "\nquit\n";
$int_connection = @fsockopen ($ts['ip'], $ts['queryport'], &$errno, &$errstr, 1);
if (!$int_connection)
{
echo "Could not connect to the server.";
}
else
{
@fputs($int_connection,$int_cmd, strlen($int_cmd));
while($userdata = @fgets($int_connection, 4096))
{
$userdata = explode(" ", $userdata);
if(isset($userdata[14]) AND $userdata[1] == $channeldata[0])
{
//Player hash maken...
$plhash[$plhashid] = $userdata[11] . ";" . $userdata[10] . ";" . $userdata[14] . ";" . $userdata[12] . ";" . $userdata[1];
$plhashid++;
}
}
@fclose($int_connection);
}
}
}
@fclose($connection);
}
#############
## DISPLAY ##
#############
if(isset($chhash))
{
rsort($chhash);
sort($chhash,SORT_NUMERIC);
}
if(isset($plhash))
{
sort($plhash);
rsort($plhash,SORT_NUMERIC);
}
if(isset($subchhash))
{
rsort($subchhash);
sort($subchhash,SORT_NUMERIC);
}
echo "<img src='image/ts/bullet_server.gif'> " . $ts['name'] . "<br>\n";
for($i=0;$i<$chhashid;$i++)
{
$chhashdata = explode(";", $chhash[$i]);
//Informatie echo'en...
echo "<img src='image/ts/bullet_channel.gif'> " . trim($chhashdata[1], "\x22\x27");
ch_flags($chhashdata[2]);
echo "<br>\n";
//Sub-Channel Data
for($sub_i=0;$sub_i<$subchhashid;$sub_i++)
{
$subchhashdata = explode(";", $subchhash[$sub_i]);
if($chhashdata[3] == $subchhashdata[4])
{
//Sub-Channel Informatie echo'en...
echo "<img src='image/ts/bullet_subchannel.gif'> " . trim($subchhashdata[1], "\x22\x27");
echo "<br>\n";
//Playerdata in subchannel...
for($int_i=0;$int_i<$plhashid;$int_i++)
{
$plhashdata = explode(";", $plhash[$int_i]);
//Informatie echo'en...
if($plhashdata[4] == $subchhashdata[3])
{
echo " ";
pl_status($plhashdata[3]);
echo addslashes(htmlspecialchars(trim($plhashdata[2], "\x22\x27")));
echo " (";
pl_flags($plhashdata[0],$plhashdata[1]);
echo ")";
echo "<br>\n";
}
}
}
}
//Playerdata...
for($int_i=0;$int_i<$plhashid;$int_i++)
{
$plhashdata = explode(";", $plhash[$int_i]);
//Informatie echo'en...
if($plhashdata[4] == $chhashdata[3])
{
pl_status($plhashdata[3]);
echo addslashes(htmlspecialchars(trim($plhashdata[2], "\x22\x27")));
echo " (";
pl_flags($plhashdata[0],$plhashdata[1]);
echo ")";
echo "<br>\n";
}
}
}
?>
//tsinfo.php\\ <? ################################### ## Gemaakt door: Boaz den Besten ## ## Gemaakt op: 09/09/2004 ## ## Versie: 1.2 ## ## Weizigingen sinds 1.1: ## ## * Kleine dingetjes verbeterd. ## ## Versie: 1.1 ## ## Wijzigingen sinds 1.0: ## ## * Functie pagina verbeterd. ## ## * Een klein foutje opgelost ## ## als de server leeg is. ## ################################### //Variablen die nodig zijn voor de connectie... $ts['ip'] = "hier het ip van de server"; //Server IP $ts['queryport'] = 51234; //Query Port deze poort moet wel toegankelijk zijn via het internet, is die dat niet, dan kan je dit script niet gebruiken. $ts['port'] = "8767"; //Server Port $ts['name'] = "hier de naam van de server"; // Server name ###################################### ## HIER ONDER NIET MEER WIJZIGEN!!! ## ###################################### include("tsfuncties.php"); $chhashid = 0; $plhashid = 0; $subchhashid = 0; //Connectie maken met de server... $cmd = "cl " . $ts['port'] . "\nquit\n"; $connection = @fsockopen ($ts['ip'], $ts['queryport'], &$errno, &$errstr, 1); if (!$connection) { echo "Could not connect to the server."; } else { while($channeldata = @fgets($connection, 4096)) { $channeldata = explode(" ", $channeldata); if(isset($channeldata[5]) AND $channeldata[5] !== "name") { if($channeldata[2] > -1) { //Sub-Channel hash maken... $subchhash[$subchhashid] = $channeldata[3] . ";" . $channeldata[5] . ";" . $channeldata[6] . ";" . $channeldata[0] . ";" . $channeldata[2]; $subchhashid++; } else { //Channel hash maken... $chhash[$chhashid] = $channeldata[3] . ";" . $channeldata[5] . ";" . $channeldata[6] . ";" . $channeldata[0]; $chhashid++; } //Connectie maken met de server... $int_cmd = "pl " . $ts['port'] . "\nquit\n"; $int_connection = @fsockopen ($ts['ip'], $ts['queryport'], &$errno, &$errstr, 1); if (!$int_connection) { echo "Could not connect to the server."; } else { while($userdata = @fgets($int_connection, 4096)) { $userdata = explode(" ", $userdata); if(isset($userdata[14]) AND $userdata[1] == $channeldata[0]) { //Player hash maken... $plhash[$plhashid] = $userdata[11] . ";" . $userdata[10] . ";" . $userdata[14] . ";" . $userdata[12] . ";" . $userdata[1]; $plhashid++; } } } } } } ############# ## DISPLAY ## ############# { sort($chhash,SORT_NUMERIC ); } { rsort($plhash,SORT_NUMERIC ); } { sort($subchhash,SORT_NUMERIC ); } echo "<img src='image/ts/bullet_server.gif'> " . $ts['name'] . "<br>\n"; for($i=0;$i<$chhashid;$i++) { $chhashdata = explode(";", $chhash[$i]); //Informatie echo'en... echo "<img src='image/ts/bullet_channel.gif'> " . trim($chhashdata[1], "\x22\x27"); ch_flags($chhashdata[2]); //Sub-Channel Data for($sub_i=0;$sub_i<$subchhashid;$sub_i++) { $subchhashdata = explode(";", $subchhash[$sub_i]); if($chhashdata[3] == $subchhashdata[4]) { //Sub-Channel Informatie echo'en... echo "<img src='image/ts/bullet_subchannel.gif'> " . trim($subchhashdata[1], "\x22\x27"); //Playerdata in subchannel... for($int_i=0;$int_i<$plhashid;$int_i++) { $plhashdata = explode(";", $plhash[$int_i]); //Informatie echo'en... if($plhashdata[4] == $subchhashdata[3]) { echo " "; pl_status($plhashdata[3]); pl_flags($plhashdata[0],$plhashdata[1]); } } } } //Playerdata... for($int_i=0;$int_i<$plhashid;$int_i++) { $plhashdata = explode(";", $plhash[$int_i]); //Informatie echo'en... if($plhashdata[4] == $chhashdata[3]) { pl_status($plhashdata[3]); pl_flags($plhashdata[0],$plhashdata[1]); } } } ?>
Download code (.txt)
|
|
Stemmen |
Niet ingelogd. |
|