array(0=>array(0=>'amxmodx_version',1=>'Wersja amxx:'),1=>array(0=>'amxbans_version',1=>'Wersja amxbans:'),2=>array(0=>'mp_timelimit',1=>'Czas mapy:')), 'csgo'=>array(0=>array(0=>'sourcemod_version',1=>'Wersja SourceMod:'),1=>array(0=>'mp_maxrounds',1=>'Liczba rund:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')), 'cssource'=>array(0=>array(0=>'sourcemod_version',1=>'Wersja SourceMod:'),1=>array(0=>'mp_maxrounds',1=>'Liczba rund:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')), 'tf2'=>array(0=>array(0=>'mp_allowNPCs',1=>'NPC Włączone:'),1=>array(0=>'mp_timelimit',1=>'Czas mapy:'),2=>array(0=>'deathmatch',1=>'DeathMatch:')), 'ventrilo'=>array(0=>array(0=>'version',1=>'Wersja:'),1=>array(0=>'channelcount',1=>'Liczba kanałów:'),2=>array(0=>'uptime',1=>'Czas online:')), 'ts3'=>array(0=>array(0=>'virtualserver_version',1=>'Wersja:'),1=>array(0=>'virtualserver_channelsonline',1=>'Liczba kanałów:'),2=>array(0=>'virtualserver_uptime',1=>'Czas online:')), 'cod2'=>array(0=>array(0=>'g_gametype',1=>'Typ gry:'),1=>array(0=>'shortversion',1=>'Wersja:'),2=>array(0=>'scr_friendlyfire',1=>'FriendlyFire:')), 'cod4'=>array(0=>array(0=>'g_gametype',1=>'Typ gry:'),1=>array(0=>'shortversion',1=>'Wersja:'),2=>array(0=>'_Mod',1=>'Mod:')), ); $games[]=array( 'cs'=>'Counter Strike 1.6', 'csgo'=>'Counter Strike: Global Offensive', 'cssource'=>'Counter Strike: Source', 'tf2'=>'Team Fortress 2', 'ventrilo'=>'Ventrilo', 'ts3'=>'Team Speak 3', 'cod2'=>'Call of Duty 2', 'cod4'=>'Call of Duty 4', ); $serwers[]=array( 'nazwa'=>'BF2 [CS]', 'ip'=>'31.186.83.163:27066', 'game'=>'cs', 'hltv'=>'', 'on'=>1, 'new'=>0, 'offline'=>0); $serwers[]=array( 'nazwa'=>'4fun [CS]', 'ip'=>'91.210.128.55:27020', 'game'=>'cs', 'hltv'=>'', 'on'=>1, 'new'=>0, 'offline'=>0); $serwers[]=array( 'nazwa'=>'PB [CS]', 'ip'=>'31.186.82.137:27466', 'game'=>'cs', 'hltv'=>'', 'on'=>1, 'new'=>0, 'offline'=>0); $serwers[]=array( 'nazwa'=>'Elite COD [CS]', 'ip'=>'91.203.223.45:27045', 'game'=>'cs', 'hltv'=>'', 'on'=>1, 'new'=>0, 'offline'=>0); $serwers[]=array( 'nazwa'=>'[TS3] - Cs-Patrioci.pl', 'ip'=>'5.231.56.101', 'game'=>'ts3', 'hltv'=>'', 'on'=>1, 'new'=>0, 'offline'=>0); function logErrors($title, $content) { $dir='log'; if(!file_exists($dir) && !file_exists('status/log')) mkdir($dir); else if(!file_exists($dir) && file_exists('status/log')) $dir='status/log'; if(strstr($content,'(Connection timed out)')) return false; $plik = $dir."/".date('dmy').".log"; $open = fopen( $plik, "a"); flock( $open, 2); fputs( $open, "\n$title\n$content\n"); flock( $open, 1); fclose( $open ); } function error($errCode, $errString, $errFile, $errLine) { if(!defined('E_STRICT')) define('E_STRICT', 2048); $user = $_SERVER['REMOTE_ADDR']; $uri = $_SERVER['REQUEST_URI']; $content = "[".date("d.m.Y h:i:s")."]\n"; $content .= "Błąd skryptu '$errFile' w linii $errLine "; $content .= "wywołany żądaniem '$uri' przez użytkownika $user ( "; $content .= @gethostbyaddr($user); $content .= " )\n$errString"; switch($errCode) { case E_USER_ERROR: case E_ERROR: case E_COMPILE_ERROR: case E_CORE_ERROR: echo logErrors("Błąd krytyczny", $content); exit(1); break; case E_USER_WARNING: case E_CORE_WARNING: case E_COMPILE_WARNING: case E_WARNING: echo logErrors("Ostrzeżenie", $content); break; case E_STRICT: case E_NOTICE: case E_USER_NOTICE: case E_PARSE; echo logErrors("Uwaga", $content); break; default: echo logErrors("Nieznany błąd - $errCode", $content); break; } return true; } set_error_handler('error'); function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } function fetch_server_info($ip, $port) { $socket = @fsockopen($ip, $port, $errno, $errstr, 0.5); if ($socket === false) { return false; } fwrite($socket, "\xfe"); $data = fread($socket, 256); if (substr($data, 0, 1) != "\xff") { return false; } $data = explode('§', mb_convert_encoding(substr($data, 3), 'UTF-16', 'UCS-2')); return array( 'motd' => $data[0], 'players' => intval($data[1]), 'max_players' => intval($data[2]), ); var_dump($data); } ?>