Witam jak moge zrobic skrypt php zeby pobieral mi nazwe serwera oraz rozgrywana mape w grze conter-strike 1.6?
jesli jest opcja gotowego skryptu byl bym bardzo wdzieczny, pozdrawiam!
<?php /** * pobiera informacje z serwera i zwraca tablice z tymi danymi * * @param string $intServerIP Adres IP serwera * @param integer $intServerPort Port serwera * @return array */ function RetriveInfo ( $strServerIP = '127.0.0.1', $intServerPort = 27015 ) { fwrite( $connection, sprintf( '%c%c%c%c%s%c', 0xFF, 0xFF, 0xFF, 0xFF, \"infostring\", 0x00 ) ); fread( $connection, 24 ); $status = socket_get_status( $connection ); if ( $status[\"unread_bytes\"] != 0 ) { $return = \"\"; while ( $status[\"unread_bytes\"] != 0 ) { $return .= fread( $connection, 1 ); $status = socket_get_status( $connection ); } $return = explode( '', $return ); $arr = array(); $arr['ip'] = $intServerIP; $arr['port'] = $intServerPort; $arr['hostname'] = $return[19]; $arr['game'] = $return[17]; $arr['players'] = $return[5]; $arr['maxplayers'] = $return[11]; $arr['system'] = ( $return[25] == \"w\" ) ? \"Windows\" : \"Linux\"; $arr['game_dir'] = $return[15]; $arr['map'] = $return[21]; $arr['password'] = ( $return[25] == \"0\" ) ? false : true; $arr['secure'] = $return[29]; return $arr; } else { // blad? return $arr; } } ?>