Your fucking browser doesn't support JavaScript, so you can't post here.
VBsupport перешел с домена .ORG на родной .RU
Ура!
Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей
Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
for English speaking users:
You may be surprised with restriction of access to the attachments of the forum. The reason is the recent change in vbsupport.org strategy:
- users with reputation < 10 belong to "simple_users" users' group
- if your reputation > 10 then administrator (kerk, Luvilla) can decide to move you into an "improved" group, but only manually
Main idea is to increase motivation of community members to share their ideas and willingness to support to each other. You may write an article for the subject where you are good enough, you may answer questions, you may share vbulletin.com/org content with vbsupport.org users, receiving "thanks" equal your reputation points. We should not only consume, we should produce something.
- you may:
* increase your reputation (doing something useful for another members of community) and being improved
* purchase temporary access to the improved category:
10 $ for 3 months. - this group can download attachments, reputation/posts do not matter.
20 $ for 3 months. - this group can download attachments, reputation/posts do not matter + adds eliminated + Inbox capacity increased + files manager increased permissions.
Please contact kerk or Luvilla regarding payments.
Important!:
- if your reputation will become less then 0, you will be moved into "simple_users" users' group automatically.*
*for temporary groups (pre-paid for 3 months) reputation/posts do not matter.
Уважаемые пользователи!
На форуме открыт новый раздел "
Каталог фрилансеров "
и отдельный раздел для платных заказов "
Куплю/Закажу "
Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже:
Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба : при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
04-18-2009, 11:16 PM
В Черном списке
Join Date: Mar 2008
Posts: 1,317
Версия vB: 3.8.4
Reputation:
Professional 475
Репутация в разделе: 370
Monitoring CS 1.6 47/48
4
Так, не нашёл готового решения под 47\48 протокол, поэтому наваял. Код не смотрите, там быдло-детектед.
Демо
PHP Code:
<?php define ( 'INCLUDED' , true ); function url ( $a ) { if ( $a [ 'nowplayers' ] > 0 ) { return '<a href="index.php?area=monitoring&id=' . $a [ 'id' ]. '" class="Monitoring" title="Подробнее..">' . $a [ 'hostname' ]. '</a>' ;} else {return $a [ 'hostname' ];} } function img ( $a ) { $b = 'путь_к_изображениям_карт' . $a . '.jpg' ; if (!( file_exists ( $b ))) { $b = 'путь_к_картинке_если_карта_неизвеста.gif' ; } return $b ; } $s = array ( array( 'ip-сервера №2' , порт ', ' название '), array(' сервер №1 ', ' порт ', название' ), // это первый в списке! ); include_once( 'csmon.php' ); $m =& new hl ; $c = count ( $s ); while ( $c ) { $c --; $host = gethostbyname ( $s [ $c ][ 0 ]); $server = $m -> getstream ( $host , $s [ $c ][ 1 ]); if ( $server === true ) { $a = "" ; $srv_rules = $m -> getrules ( $a ); $srv_rules [ 'id' ] = $c ; ?> <tr> <td> <div style="float:right;"><img height=60 width=80 border=0 src=<?php print img ( $srv_rules [ 'mapname' ]); ?> title=<?php print $srv_rules [ 'mapname' ]; ?> ></div> <b><font color=white><?php print $s [ $c ][ 2 ]; ?> <br> <?php echo "<a href='steam://connect/" . $s [ $c ][ 0 ]. ":" . $s [ $c ][ 1 ]. "'>" . $s [ $c ][ 0 ]. ":" . $s [ $c ][ 1 ]. "</a>" ; ?> </b> <br /> Карта: <b><?php print $srv_rules [ 'mapname' ]; ?> </b><br /> Игроки: <b><?php print $srv_rules [ 'nowplayers' ]; ?> </b>/<?php print $srv_rules [ 'maxplayers' ]; ?> </font><br /><br /> </td> </tr> <?php } } ?>
Файл csmon.php
"csmon.php
<?php
defined('INCLUDED') or exit('Доступ закрыт!');
class hl {
var $maxlen = 2048;
var $q_info = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
var $q_num = "\xFF\xFF\xFF\xFF\x57";
var $q_rules = "\xFF\xFF\xFF\xFF\x56";
var $q_player = "\xFF\xFF\xFF\xFF\x55";
var $s_info = false;
var $response = false;
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function get_challenge($socket) {
socket_set_timeout($socket, 1);
$time_begin = $this->microtime_float();
fwrite($socket, $this->q_num);
$challenge = fread($socket, $this->maxlen);
$time_end = $this->microtime_float();
$this->response = $time_end - $time_begin;
$this->response = ($this->response * 1000);
$this->response = (int)$this->response;
$challenge = substr($challenge, 5, 4);
return $challenge;
}
function get_info($socket) {
// get server info data
socket_set_timeout($socket, 1);
fwrite($socket, $this->q_info);
$this->s_info['info'] = fread($socket, $this->maxlen);
}
function get_rules($socket) {
// get server rules data
$challenge = $this->get_challenge($socket);
$this->q_rules = $this->q_rules
. $challenge;
socket_set_timeout($socket, 1);
fwrite($socket, $this->q_rules);
$this->s_info['rules'] = fread($socket, $this->maxlen);
}
function get_players($socket) {
// get server player data
//$challenge = $this->get_challenge($socket);
$this->q_player = $this->q_player . $challenge;
socket_set_timeout($socket, 1);
fwrite ($socket, $this->q_player);
//$this->s_info['player'] = fread($socket, $this->maxlen);
}
function getstream($host, $port) {
// get the full info data from server
$socket = fsockopen('udp://'. $host, $port, $errno, $errstr, 1);
if ($socket === false) {
echo "Error: $errno - $errstr<br>\n";
}
else {
$this->get_info($socket);
$this->get_players($socket);
}
fclose($socket);
if ($this->s_info['info']) {
return true;
}
else {
return false;
}
}
function getvalue_byte($def) {
// get value (byte) from raw data
$tmp = $this->s_info[$def][0];
$this->s_info[$def] = substr($this->s_info[$def], 1);
return ord($tmp);
}
function getvalue_string($def) {
// get value (string) from raw data
$tmp = '';
$index = 0;
while (ord($this->s_info[$def][$index]) != 0) {
$tmp .= $this->s_info[$def][$index];
$index++;
}
$this->s_info[$def] = substr($this->s_info[$def], $index+1);
return $tmp;
}
function getvalue_sint($def) {
// get value (int16) from raw data
$tmp = substr($this->s_info[$def], 0, 2);
$this->s_info[$def] = substr($this->s_info[$def], 2);
$array = @unpack('Sshort', $tmp);
return $array['short'];
}
function getvalue_lint($def) {
// get value (int32) from raw data
$tmp = substr($this->s_info[$def], 0, 4);
$this->s_info[$def] = substr($this->s_info[$def], 4);
$array = @unpack('Lint', $tmp);
return $array['int'];
}
function getvalue_float($def) {
// get value (float) from raw data
$tmp = substr($this->s_info[$def], 0, 4);
$this->s_info[$def] = substr($this->s_info[$def], 4);
$array = @unpack('ffloat', $tmp);
return $array['float'];
}
function getrules($a) {
$srv_rules['sets'] = false;
// response time
$srv_rules['response'] = $this->response . ' ms';
// game setting pics
$sets['pass'] = '<img src="' . $a . 'privileges/pass.gif" alt="pw">';
// set array key to info
$def = 'info';
// get the servertype (hl1 or source)
$servertype = $this->s_info['info'][4];
// filter the not needed code
$this->s_info['info'] = substr($this->s_info['info'], 5);
// if server running hl1 game get the following values
if ($servertype == 'm') {
$srv_rules['gameip'] = $this->getvalue_string($def);
$srv_rules['hostname'] = $this->getvalue_string($def);
$srv_rules['mapname'] = $this->getvalue_string($def);
$srv_rules['gamedir'] = $this->getvalue_string($def);
$srv_rules['gametype'] = $this->getvalue_string($def);
$srv_rules['nowplayers'] = $this->getvalue_byte($def);
$srv_rules['maxplayers'] = $this->getvalue_byte($def);
$srv_rules['netver'] = $this->getvalue_byte($def);
$srv_rules['dedicated'] = $this->getvalue_byte($def);
$srv_rules['os'] = $this->getvalue_byte($def);
$srv_rules['password'] = $this->getvalue_byte($def);
$srv_rules['is_mod'] = $this->getvalue_byte($def);
$srv_rules['url_info'] = $this->getvalue_string($def);
$srv_rules['url_down'] = $this->getvalue_string($def);
$srv_rules['unused'] = $this->getvalue_string($def);
$srv_rules['mod_version'] = $this->getvalue_lint($def);
$srv_rules['mod_size'] = $this->getvalue_lint($def);
$srv_rules['sv_only'] = $this->getvalue_byte($def);
$srv_rules['cus_cl'] = $this->getvalue_byte($def);
$srv_rules['secure'] = $this->getvalue_byte($def);
$srv_rules['bots'] = $this->getvalue_byte($def);
// path to map picture
$srv_rules['map_path'] = 'maps/hl';
}
if ($servertype == 'I') {
$srv_rules['netver'] = $this->getvalue_byte($def);
$srv_rules['hostname'] = $this->getvalue_string($def);
$srv_rules['mapname'] = $this->getvalue_string($def);
$srv_rules['gamedir'] = $this->getvalue_string($def);
$srv_rules['gametype'] = $this->getvalue_string($def);
$srv_rules['app_id'] = $this->getvalue_sint($def);
$srv_rules['nowplayers'] = $this->getvalue_byte($def);
$srv_rules['maxplayers'] = $this->getvalue_byte($def);
$srv_rules['bots'] = $this->getvalue_byte($def);
$srv_rules['dedicated'] = $this->getvalue_byte($def);
$srv_rules['os'] = $this->getvalue_byte($def);
$srv_rules['password'] = $this->getvalue_byte($def);
$srv_rules['secure'] = $this->getvalue_byte($def);
$srv_rules['version'] = $this->getvalue_string($def);
// path to map picture
$srv_rules['map_path'] = 'maps/hl2';
}
// set default map picture
$srv_rules['map_default'] = 'default.jpg';
// set gamename with gametype value (because no gametype info in hl data
$srv_rules['gamename'] = $srv_rules['gametype'] . '<br>';
// privileges pictures
if ($srv_rules['password'] == 1) {
$srv_rules['sets'] = $sets['pass'];
}
if ($srv_rules['sets'] === false) {
$srv_rules['sets'] = '-';
}
// server general info
$srv_rules['htmlinfo'] =
'<tr><td align="left">Mapname:</td><td align="left">'
. $srv_rules['mapname']
. '</td></tr>' ."\n"
. '<tr><td align="left">Players:</td><td align="left">'
. $srv_rules['nowplayers'] . ' / ' . $srv_rules['maxplayers']
. '</td></tr>' . "\n"
. '<tr><td align="left">Response:</td><td align="left">'
. $srv_rules['response']
. '</td></tr>' . "\n"
. '<tr><td align="left">Privileges:</td><td align="left">'
. $srv_rules['sets']
. '</td></tr>' . "\n";
// server detail info
$srv_rules['htmldetail'] =
'<tr valign="top"><td align="left">Gamename:</td><td align="left">'
. $srv_rules['gamename']
. '</td></tr>' . "\n"
. '<tr valign="top"><td align="left">Gamedir:</td><td align="left">'
. $srv_rules['gamedir']
. '</td></tr>' . "\n"
. '<tr valign="top"><td align="left">Mapname:</td><td align="left">'
. $srv_rules['mapname']
. '</td></tr>' . "\n"
. '<tr valign="top"><td align="left">Players:</td><td align="left">'
. $srv_rules['nowplayers'] . ' / ' . $srv_rules['maxplayers']
. '</td></tr>' . "\n"
. '<tr valign="top"><td align="left">Response:</td><td align="left">'
. $srv_rules['response']
. '</td></tr>' . "\n"
. '<tr valign="top"><td align="left">Privileges:</td><td align="left">'
. $srv_rules['sets']
. '</td></tr>' . "\n";
// return all server rules
return $srv_rules;
}
function getplayers() {
$players = array();
// set array key to player
$def = 'player';
// set html thead
$thead = "<tr><th>Rank</th><th>Name</th><th>Frags</th><th colspan=2>Time</th></tr>";
// filter the not needed code
$this->s_info[$def] = substr($this->s_info[$def], 5);
// how many player must search
$nowplayers = $this->getvalue_byte($def);
// get the data of each player
while ($nowplayers != 0) {
$index = $this->getvalue_byte($def);
$nick = $this->getvalue_string($def);
$frags = $this->getvalue_lint($def);
$time = $this->getvalue_float($def);
$minutes = floor($time / 60);
$h = floor($minutes / 60);
$seconds = floor($time - ($minutes * 60));
$minutes = $minutes - ($h * 60);
$time = sprintf("%02s:%02s:%02s", $h, $minutes, $seconds);
// scan connecting players
if ($time == '00:00:00') {
$nick = 'new connection';
$frags = '-';
}
$players[$nowplayers] = $frags . " " . $time . " " . "\"$nick\"";
$nowplayers--;
}
// check the connected players and sort the ranking
if ($players) {
sort($players, SORT_NUMERIC);
}
else {
$thead .= "<tr align=center><td>--</td><td>--</td><td>--</td><td colspan=2>--</td></tr>\n";
}
// store the html table line to the info array
$srv_player = $thead;
// check how many players scanned
$clients = count($players);
$clients = $clients - 1;
// manage the player data in the following code
$index = 1;
while ($clients != -1) {
list ($cache[$index], $player[$index]) = split ('\"', $players[$clients]);
list ($points[$index], $ping[$index]) = split(' ', $cache[$index]);
// strip html code from player name
$player[$index] = htmlentities($player[$index]);
$tdata = "<tr align=center><td>$index.</td><td>$player[$index]</td><td>$points[$index]</td><td colspan=2>$ping[$index]</td></tr>\n";
$srv_player = $srv_player . $tdata;
$clients--;
$index++;
}
return $srv_player;
}
}
?>
Yandex Bot
05-27-2009, 02:24 PM
Продвинутый
Join Date: May 2008
Location: Санкт-Петербург
Posts: 220
Версия vB: 3.8.x
Пол:
Reputation:
Опытный 94
Репутация в разделе: 55
что куда пихать надо то? я чёта непонял :( объясните пожалуйста
05-28-2009, 12:33 PM
В Черном списке
Join Date: Mar 2008
Posts: 1,317
Версия vB: 3.8.4
Reputation:
Professional 475
Репутация в разделе: 370
RombI4 , создай файл csmon.php и скопируй в него:
PHP Code:
<?php defined ( 'INCLUDED' ) or exit( 'Доступ закрыт!' ); class hl { var $maxlen = 2048 ; var $q_info = "\xFF\xFF\xFF\xFFTSource Engine Query\x00" ; var $q_num = "\xFF\xFF\xFF\xFF\x57" ; var $q_rules = "\xFF\xFF\xFF\xFF\x56" ; var $q_player = "\xFF\xFF\xFF\xFF\x55" ; var $s_info = false ; var $response = false ; function microtime_float () { list( $usec , $sec ) = explode ( " " , microtime ()); return ((float) $usec + (float) $sec ); } function get_challenge ( $socket ) { socket_set_timeout ( $socket , 1 ); $time_begin = $this -> microtime_float (); fwrite ( $socket , $this -> q_num ); $challenge = fread ( $socket , $this -> maxlen ); $time_end = $this -> microtime_float (); $this -> response = $time_end - $time_begin ; $this -> response = ( $this -> response * 1000 ); $this -> response = (int) $this -> response ; $challenge = substr ( $challenge , 5 , 4 ); return $challenge ; } function get_info ( $socket ) { // get server info data socket_set_timeout ( $socket , 1 ); fwrite ( $socket , $this -> q_info ); $this -> s_info [ 'info' ] = fread ( $socket , $this -> maxlen ); } function get_rules ( $socket ) { // get server rules data $challenge = $this -> get_challenge ( $socket ); $this -> q_rules = $this -> q_rules . $challenge ; socket_set_timeout ( $socket , 1 ); fwrite ( $socket , $this -> q_rules ); $this -> s_info [ 'rules' ] = fread ( $socket , $this -> maxlen ); } function get_players ( $socket ) { // get server player data //$challenge = $this->get_challenge($socket); $this -> q_player = $this -> q_player . $challenge ; socket_set_timeout ( $socket , 1 ); fwrite ( $socket , $this -> q_player ); //$this->s_info['player'] = fread($socket, $this->maxlen); } function getstream ( $host , $port ) { // get the full info data from server $socket = fsockopen ( 'udp://' . $host , $port , $errno , $errstr , 1 ); if ( $socket === false ) { echo "Error: $errno - $errstr <br>\n" ; } else { $this -> get_info ( $socket ); $this -> get_players ( $socket ); } fclose ( $socket ); if ( $this -> s_info [ 'info' ]) { return true ; } else { return false ; } } function getvalue_byte ( $def ) { // get value (byte) from raw data $tmp = $this -> s_info [ $def ][ 0 ]; $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], 1 ); return ord ( $tmp ); } function getvalue_string ( $def ) { // get value (string) from raw data $tmp = '' ; $index = 0 ; while ( ord ( $this -> s_info [ $def ][ $index ]) != 0 ) { $tmp .= $this -> s_info [ $def ][ $index ]; $index ++; } $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], $index + 1 ); return $tmp ; } function getvalue_sint ( $def ) { // get value (int16) from raw data $tmp = substr ( $this -> s_info [ $def ], 0 , 2 ); $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], 2 ); $array = @ unpack ( 'Sshort' , $tmp ); return $array [ 'short' ]; } function getvalue_lint ( $def ) { // get value (int32) from raw data $tmp = substr ( $this -> s_info [ $def ], 0 , 4 ); $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], 4 ); $array = @ unpack ( 'Lint' , $tmp ); return $array [ 'int' ]; } function getvalue_float ( $def ) { // get value (float) from raw data $tmp = substr ( $this -> s_info [ $def ], 0 , 4 ); $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], 4 ); $array = @ unpack ( 'ffloat' , $tmp ); return $array [ 'float' ]; } function getrules ( $a ) { $srv_rules [ 'sets' ] = false ; // response time $srv_rules [ 'response' ] = $this -> response . ' ms' ; // game setting pics $sets [ 'pass' ] = '<img src="' . $a . 'privileges/pass.gif" alt="pw">' ; // set array key to info $def = 'info' ; // get the servertype (hl1 or source) $servertype = $this -> s_info [ 'info' ][ 4 ]; // filter the not needed code $this -> s_info [ 'info' ] = substr ( $this -> s_info [ 'info' ], 5 ); // if server running hl1 game get the following values if ( $servertype == 'm' ) { $srv_rules [ 'gameip' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'hostname' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'mapname' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'gamedir' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'gametype' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'nowplayers' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'maxplayers' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'netver' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'dedicated' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'os' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'password' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'is_mod' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'url_info' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'url_down' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'unused' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'mod_version' ] = $this -> getvalue_lint ( $def ); $srv_rules [ 'mod_size' ] = $this -> getvalue_lint ( $def ); $srv_rules [ 'sv_only' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'cus_cl' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'secure' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'bots' ] = $this -> getvalue_byte ( $def ); // path to map picture $srv_rules [ 'map_path' ] = 'maps/hl' ; } if ( $servertype == 'I' ) { $srv_rules [ 'netver' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'hostname' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'mapname' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'gamedir' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'gametype' ] = $this -> getvalue_string ( $def ); $srv_rules [ 'app_id' ] = $this -> getvalue_sint ( $def ); $srv_rules [ 'nowplayers' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'maxplayers' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'bots' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'dedicated' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'os' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'password' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'secure' ] = $this -> getvalue_byte ( $def ); $srv_rules [ 'version' ] = $this -> getvalue_string ( $def ); // path to map picture $srv_rules [ 'map_path' ] = 'maps/hl2' ; } // set default map picture $srv_rules [ 'map_default' ] = 'default.jpg' ; // set gamename with gametype value (because no gametype info in hl data $srv_rules [ 'gamename' ] = $srv_rules [ 'gametype' ] . '<br>' ; // privileges pictures if ( $srv_rules [ 'password' ] == 1 ) { $srv_rules [ 'sets' ] = $sets [ 'pass' ]; } if ( $srv_rules [ 'sets' ] === false ) { $srv_rules [ 'sets' ] = '-' ; } // server general info $srv_rules [ 'htmlinfo' ] = '<tr><td align="left">Mapname:</td><td align="left">' . $srv_rules [ 'mapname' ] . '</td></tr>' . "\n" . '<tr><td align="left">Players:</td><td align="left">' . $srv_rules [ 'nowplayers' ] . ' / ' . $srv_rules [ 'maxplayers' ] . '</td></tr>' . "\n" . '<tr><td align="left">Response:</td><td align="left">' . $srv_rules [ 'response' ] . '</td></tr>' . "\n" . '<tr><td align="left">Privileges:</td><td align="left">' . $srv_rules [ 'sets' ] . '</td></tr>' . "\n" ; // server detail info $srv_rules [ 'htmldetail' ] = '<tr valign="top"><td align="left">Gamename:</td><td align="left">' . $srv_rules [ 'gamename' ] . '</td></tr>' . "\n" . '<tr valign="top"><td align="left">Gamedir:</td><td align="left">' . $srv_rules [ 'gamedir' ] . '</td></tr>' . "\n" . '<tr valign="top"><td align="left">Mapname:</td><td align="left">' . $srv_rules [ 'mapname' ] . '</td></tr>' . "\n" . '<tr valign="top"><td align="left">Players:</td><td align="left">' . $srv_rules [ 'nowplayers' ] . ' / ' . $srv_rules [ 'maxplayers' ] . '</td></tr>' . "\n" . '<tr valign="top"><td align="left">Response:</td><td align="left">' . $srv_rules [ 'response' ] . '</td></tr>' . "\n" . '<tr valign="top"><td align="left">Privileges:</td><td align="left">' . $srv_rules [ 'sets' ] . '</td></tr>' . "\n" ; // return all server rules return $srv_rules ; } function getplayers () { $players = array(); // set array key to player $def = 'player' ; // set html thead $thead = "<tr><th>Rank</th><th>Name</th><th>Frags</th><th colspan=2>Time</th></tr>" ; // filter the not needed code $this -> s_info [ $def ] = substr ( $this -> s_info [ $def ], 5 ); // how many player must search $nowplayers = $this -> getvalue_byte ( $def ); // get the data of each player while ( $nowplayers != 0 ) { $index = $this -> getvalue_byte ( $def ); $nick = $this -> getvalue_string ( $def ); $frags = $this -> getvalue_lint ( $def ); $time = $this -> getvalue_float ( $def ); $minutes = floor ( $time / 60 ); $h = floor ( $minutes / 60 ); $seconds = floor ( $time - ( $minutes * 60 )); $minutes = $minutes - ( $h * 60 ); $time = sprintf ( "%02s:%02s:%02s" , $h , $minutes , $seconds ); // scan connecting players if ( $time == '00:00:00' ) { $nick = 'new connection' ; $frags = '-' ; } $players [ $nowplayers ] = $frags . " " . $time . " " . "\" $nick \"" ; $nowplayers --; } // check the connected players and sort the ranking if ( $players ) { sort ( $players , SORT_NUMERIC ); } else { $thead .= "<tr align=center><td>--</td><td>--</td><td>--</td><td colspan=2>--</td></tr>\n" ; } // store the html table line to the info array $srv_player = $thead ; // check how many players scanned $clients = count ( $players ); $clients = $clients - 1 ; // manage the player data in the following code $index = 1 ; while ( $clients != - 1 ) { list ( $cache [ $index ], $player [ $index ]) = split ( '\"' , $players [ $clients ]); list ( $points [ $index ], $ping [ $index ]) = split ( ' ' , $cache [ $index ]); // strip html code from player name $player [ $index ] = htmlentities ( $player [ $index ]); $tdata = "<tr align=center><td> $index .</td><td> $player [ $index ] </td><td> $points [ $index ] </td><td colspan=2> $ping [ $index ] </td></tr>\n" ; $srv_player = $srv_player . $tdata ; $clients --; $index ++; } return $srv_player ; } } ?>
затем создай файл и пропиши в него:
PHP Code:
<?php define ( 'INCLUDED' , true ); function url ( $a ) { if ( $a [ 'nowplayers' ] > 0 ) { return '<a href="index.php?area=monitoring&id=' . $a [ 'id' ]. '" class="Monitoring" title="Подробнее..">' . $a [ 'hostname' ]. '</a>' ;} else {return $a [ 'hostname' ];} } function img ( $a ) { $b = 'путь_к_изображениям_карт' . $a . '.jpg' ; if (!( file_exists ( $b ))) { $b = 'путь_к_картинке_если_карта_неизвеста.gif' ; } return $b ; } $s = array ( array( 'ip-сервера №2' , порт ', ' название '), array(' сервер №1 ', ' порт ', название' ), // это первый в списке! ); include_once( 'csmon.php' ); $m =& new hl ; $c = count ( $s ); while ( $c ) { $c --; $host = gethostbyname ( $s [ $c ][ 0 ]); $server = $m -> getstream ( $host , $s [ $c ][ 1 ]); if ( $server === true ) { $a = "" ; $srv_rules = $m -> getrules ( $a ); $srv_rules [ 'id' ] = $c ; ?> <tr> <td> <div style="float:right;"><img height=60 width=80 border=0 src=<?php print img ( $srv_rules [ 'mapname' ]); ?> title=<?php print $srv_rules [ 'mapname' ]; ?> ></div> <b><font color=white><?php print $s [ $c ][ 2 ]; ?> <br> <?php echo "<a href='steam://connect/" . $s [ $c ][ 0 ]. ":" . $s [ $c ][ 1 ]. "'>" . $s [ $c ][ 0 ]. ":" . $s [ $c ][ 1 ]. "</a>" ; ?> </b> <br /> Карта: <b><?php print $srv_rules [ 'mapname' ]; ?> </b><br /> Игроки: <b><?php print $srv_rules [ 'nowplayers' ]; ?> </b>/<?php print $srv_rules [ 'maxplayers' ]; ?> </font><br /><br /> </td> </tr> <?php } } ?>
05-29-2009, 01:25 AM
Продвинутый
Join Date: May 2008
Location: Санкт-Петербург
Posts: 220
Версия vB: 3.8.x
Пол:
Reputation:
Опытный 94
Репутация в разделе: 55
ну создал, а что дальше? что куда.. какой код куда пихать
05-29-2009, 04:38 PM
В Черном списке
Join Date: Mar 2008
Posts: 1,317
Версия vB: 3.8.4
Reputation:
Professional 475
Репутация в разделе: 370
PHP Code:
<?php include 'название файла.php' ; ?>
в нужное место на странице
05-30-2009, 02:18 AM
Продвинутый
Join Date: May 2008
Location: Санкт-Петербург
Posts: 220
Версия vB: 3.8.x
Пол:
Reputation:
Опытный 94
Репутация в разделе: 55
а что мне надо вставить в содержимое при создании бб кода модуля vbcmps? просто у вас на сайте, вроде именно так и сделано)
05-30-2009, 03:32 AM
Front-End Developer
Join Date: Apr 2008
Posts: 10,366
Версия vB: 3.8.x
Пол:
Reputation:
Гуру 6238
Репутация в разделе: 3186
RombI4 , на сайте самописная страница)
03-25-2010, 01:17 AM
Простоузер
Join Date: Jul 2007
Posts: 28
Версия vB: 3.8.7
Reputation:
Novice 2
Репутация в разделе: 1
что то не очень хочет работать(
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +4. The time now is 08:34 AM .