|
|
|
|
//$st_ip = "85.147.12.131"; //ip van de server
$st_ip = $host; //ip van de server
$st_port = 28960; //De poort van de server standaard is: 28960
function color($text)
{
$text = eregi_replace('\^0', '',$text);
$text = eregi_replace('\^1', '',$text);
$text = eregi_replace('\^2', '',$text);
$text = eregi_replace('\^3', '',$text);
$text = eregi_replace('\^4', '',$text);
$text = eregi_replace('\^5', '',$text);
$text = eregi_replace('\^6', '',$text);
$text = eregi_replace('\^7', '',$text);
$text = eregi_replace('\^8', '',$text);
$text = eregi_replace('\^9', '',$text);
return $text;
}
function tel($text)
{
$texta = explode("^", $text);
$aantal = count($texta);
return $aantal-1;
}
if(!$_GET["ip"])
{
$s_port = $st_port;
$s_ip = $st_ip;
}
elseif(!$_GET["port"])
{
$ex = explode(":",$_GET["ip"]);
if($ex[1] == ""){$ex[1] = 28960;}
$s_port = $ex[1];
$s_ip = $ex[0];
}
else
{$s_port = $_GET["port"];
$s_ip = $_GET["ip"];
}
$s_con = fsockopen("udp://".$s_ip, $s_port, $errno, $errstr, 10);
if (!s_con){
echo "Connectie error : $errno ($errstr) \n";}
else
{
stream_set_timeout($s_con, 5);
fwrite($s_con, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00));
fread($s_con, 4);
$status = socket_get_status($s_con);
// Geen verbinding
if($status["unread_bytes"] == 0)
{
drawborder(400,"Server status","De server ($host) is down...","Probeer een van de andere servers..");
}
else
{
$empfangen = "";
do
{
$empfangen .= fread($s_con, 1);
$status = socket_get_status($s_con);
}
while($status["unread_bytes"] != 0);
fclose($s_con);
$daten = explode("\n", $empfangen);
$rules = explode("\\",$daten[1]);
$find_pos = array_search ("sv_hostname", $rules);
$hostname = $rules[$find_pos+1] . "\n";
$aantal = tel($hostname);
$hostname = color($hostname);
$find_pos = array_search ("mapname", $rules);
$mapname = $rules[$find_pos+1];
$mapname = strtolower($mapname);
$playercount = count ($daten);
$playercount = $playercount-3;
$find_pos = array_search ("sv_maxclients", $rules);
$maxplayers = $rules[$find_pos+1] . "\n";
$find_pos = array_search ("g_gametype", $rules);
$gametype = $rules[$find_pos+1] . "\n";
if ($gametype == "ctfb\n"){$gametype = "Capture the Flag Back";}
if ($gametype == "ctbb\n"){$gametype = "Capture the Beer Back";}
if ($gametype == "ctf\n"){$gametype = "Capture the Flag";}
if ($gametype == "ctb\n"){$gametype = "Capture the Beer";}
if ($gametype == "dm\n"){$gametype = "Deathmatch";}
if ($gametype == "tdm\n"){$gametype = "Team Deathmatch";}
if ($gametype == "sd\n"){$gametype = "Search & Destroy";}
$find_pos = array_search ("scr_killcam", $rules);
$killcam = $rules[$find_pos+1] . "\n";
if($killcam == 1){$killcam = "on";}
else{$killcam = "off";}
$find_pos = array_search ("shortversion", $rules);
$version = $rules[$find_pos+1] . "\n";
$find_pos = array_search ("pswrd", $rules);
$password = $rules[$find_pos+1] . "\n";
if($password == 1){$password = "Yes";}
else{$password = "No";}
$find_pos = array_search ("sv_punkbuster", $rules);
$punkbuster = $rules[$find_pos+1] . "\n";
if($punkbuster == 1){$punkbuster = "On";}
else{$punkbuster = "Off";}
?>
if ($host == "85.147.12.131")
{
$naampje = "Andy's";
}
else
{
$naampje = $host;
}
echo "$naampje Call of Duty 2 Server Stats:";
echo "Servername: " . $hostname . " ";
for ($i=0; $i<$aantal; $i++)
{
echo "";
}
echo "Server-IP: " . $s_ip . ":" . $s_port . " ";
echo "Gametype: " . $gametype . " ";
echo "Killcam: " . $killcam . " ";
echo "Version: " . $version . " ";
echo "Password: " . $password . " ";
echo "Punkbuster: " . $punkbuster . " ";
echo "Players: " . $playercount . "/" . $maxplayers . " ";
echo "Current map: " . $mapname . "
";
if (file_exists("image/" . $mapname . ".jpg"))
{
echo " " . $mapname . "
";
}
else
{
echo " A Custom Map
";
}
echo " | ";
// Speler informatie
echo " ";
if ($playercount !=0){
echo "";
echo "Nickname | ";
echo "Score | ";
echo "Ping | ";
echo " ";
$x = 1;
while ($x <= $playercount)
{
$x++;
$playerinfo = explode('"',$daten[$x]);
$aantal = tel($playerinfo[1]);
$playerinfo[1] = color($playerinfo[1]);
$gegevens = explode(" ",$playerinfo[0]);
$score = $gegevens[0];
$ping = $gegevens[1];
echo "";
echo "" . $playerinfo[1] . "";
for ($i=0; $i<$aantal; $i++)
{
echo "";
}
echo " | ";
echo "" . $score . " | ";
echo "" . $ping . " | ";
echo " ";
}
echo " ";
}
else
{
echo " No players are on this server | | ";
echo " ";
}
if($_GET["ip"])
{
echo "";
}
else
{
echo "";
}
echo " ";
}}
drawborder(380,"Andere gameservers","Niemand in onze gameserver? Probeer dan één van de volgende!
| ","Gebruik het commando /connect in COD2 om naar de server te gaan");
echo " ";
drawborder(380,"CALENDER","Een vetgedrukte datum is een event, kun je op klikken..
",' Klik hier om een item toe te voegen','amiga');
echo " ";
echo " | ";
?>
Totaal aantal hits sinds 17-2-2006 : =$total?>
|
Vragen en/of suggesties? Laat het weten!
Verstuur een email naar Sen-Sai:
drawborder(380,"INFO",'LET OP! Deze website zal een week offline zijn. (van 3-3 t/m 10-3).
In de calender links onderin staan de geplande dagen voor onze COD2 training ;-) Heb je zelf nog events die je wilt toevoegen, klik dan op het ikoontje onderaan de calender (login en pass : gast).
Heb je zelf files die je wilt delen met de andere, zet ze dan op de server (http://files.designburo.nl/files - login en pass : cod2). Als je in de cod2 map zit, heb je aan de volledig rechterkant een grote pijl omhoog. Als je daar op klikt kun je files uploaden. Max 16MB. Als dat een probleem is zal ik de grote wijzigen..');
?>
drawborder(380,"SHOUTBOX",'');
?>
|