Скрипт Status
8 ответов230 просмотровСейчас просматривают: 1
· 11.05.2008, 11:23
Прошу выложиет скрипт на стстус сервака,имеющийся у мя непоказывает онлай сервер или нет,на ява скриптах,прошу под яву скрипты статус :)
0
· 11.05.2008, 19:29
Перезаливать нечего. ТАм было так : вводишь ip, port и тебе дают скрипт и ты его просто вставляешь на сайт, на юкозе работало
0
· 12.05.2008, 04:50
CODE
<style type="text/css">
.tabela {
background: #000000;
background-color: #000000;
font-size: 12px;
}
.tabelatitle {
background-color: #000000;
font-size: 14px;
font-weight: bold;
}
body {
background-color: #000000;
color: #FFFFFF;
font-family: tahoma;
font-size: 19px;
}
</style>
<body>
<?php
////Статус сервера//////
error_reporting(0);
$IP = array(
"Login Server: " => "127.0.0.1:2108",
"Game Server: " => "127.0.0.1:7777",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo($ServerName);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo'ON<br>';
fclose($fp);
}
else {
echo'OFF<br>';
}
}
?>
<?php
require 'config.php';
mssql_connect($mssql_server,$mssql_user,$mssql_pass);
mssql_select_db($mssql_db);
$result=mssql_query("
select a.char_name, a.Lev, a.builder, a.class, a.use_time,
a.PK, a.Duel, a.gender, b.name, a.Exp, b.pledge_id
from user_data as a
left join pledge as b on a.Pledge_id=b.pledge_id
where char_name not in (".("'".join("','",$exclude_from_top)."'").") and (login>logout) and (builder>=0)");
$online_count=mssql_num_rows($result);
$result=mssql_query("
select a.char_name, a.Lev, a.builder, a.class, a.use_time,
a.PK, a.Duel, a.gender, b.name, a.Exp, b.pledge_id
from user_data as a
left join pledge as b on a.Pledge_id=b.pledge_id
where char_name not in (".("'".join("','",$exclude_from_top)."'").") and (login>logout) and (builder>=0)");
$d_count = 0;
$de_count = 0;
$e_count = 0;
$h_count = 0;
$o_count = 0;
$online_users=array();
for ($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++)
{
$hours=round($online_users[$x]['use_time']/3600,1);
$online_users[$x]['use_time_d']=floor($hours/24)." дн. ".($hours % 24)." ч.";
if ($online_users[$x]['class'] >= 0 && $online_users[$x]['class'] <= 17) $h_count++;
if ($online_users[$x]['class'] >= 18 && $online_users[$x]['class'] <= 30) $e_count++;
if ($online_users[$x]['class'] >= 31 && $online_users[$x]['class'] <= 43) $de_count++;
if ($online_users[$x]['class'] >= 44 && $online_users[$x]['class'] <= 52) $o_count++;
if ($online_users[$x]['class'] >= 53 && $online_users[$x]['class'] <= 57) $d_count++;
}
unset($online_users[count($online_users)-1]);
mssql_connect($mssql_server,$mssql_user,$mssql_pass);
mssql_select_db($CONFIG['dbdbname']) or DIE("Table unavailable");
$result=mssql_query("
select record_time, world_user
from user_count
where auth_user<>0
order by world_user desc");
$max_user=mssql_fetch_assoc($result);
$result=mssql_query("
SELECT AVG(world_user) AS avg_user
FROM user_count
WHERE (server_id = '1') AND (DATEPART(yy, record_time) = '".date("Y")."') AND (DATEPART(mm, record_time) = '".date("m")."') AND (DATEPART(dd, record_time) = '".date("d")."')");
$avg_today=mssql_fetch_assoc($result);
?>
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td class="al">Cредний Oнлайн: </td>
<td>97</td>
</tr>
<tr>
<td class="al">Мах было :</td>
<td class="t-bold al info ar"><?=$max_user["world_user"]?></td>
</tr>
<tr>
<tr>
<td class="al"><?=$max_user["record_time"]?></td>
<td></td>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
<?=$sep?>
</table>
.tabela {
background: #000000;
background-color: #000000;
font-size: 12px;
}
.tabelatitle {
background-color: #000000;
font-size: 14px;
font-weight: bold;
}
body {
background-color: #000000;
color: #FFFFFF;
font-family: tahoma;
font-size: 19px;
}
</style>
<body>
<?php
////Статус сервера//////
error_reporting(0);
$IP = array(
"Login Server: " => "127.0.0.1:2108",
"Game Server: " => "127.0.0.1:7777",
); while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo($ServerName);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
echo'ON<br>';
fclose($fp);
}
else {
echo'OFF<br>';
}
}
?>
<?php
require 'config.php';
mssql_connect($mssql_server,$mssql_user,$mssql_pass);
mssql_select_db($mssql_db);
$result=mssql_query("
select a.char_name, a.Lev, a.builder, a.class, a.use_time,
a.PK, a.Duel, a.gender, b.name, a.Exp, b.pledge_id
from user_data as a
left join pledge as b on a.Pledge_id=b.pledge_id
where char_name not in (".("'".join("','",$exclude_from_top)."'").") and (login>logout) and (builder>=0)");
$online_count=mssql_num_rows($result);
$result=mssql_query("
select a.char_name, a.Lev, a.builder, a.class, a.use_time,
a.PK, a.Duel, a.gender, b.name, a.Exp, b.pledge_id
from user_data as a
left join pledge as b on a.Pledge_id=b.pledge_id
where char_name not in (".("'".join("','",$exclude_from_top)."'").") and (login>logout) and (builder>=0)");
$d_count = 0;
$de_count = 0;
$e_count = 0;
$h_count = 0;
$o_count = 0;
$online_users=array();
for ($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++)
{
$hours=round($online_users[$x]['use_time']/3600,1);
$online_users[$x]['use_time_d']=floor($hours/24)." дн. ".($hours % 24)." ч.";
if ($online_users[$x]['class'] >= 0 && $online_users[$x]['class'] <= 17) $h_count++;
if ($online_users[$x]['class'] >= 18 && $online_users[$x]['class'] <= 30) $e_count++;
if ($online_users[$x]['class'] >= 31 && $online_users[$x]['class'] <= 43) $de_count++;
if ($online_users[$x]['class'] >= 44 && $online_users[$x]['class'] <= 52) $o_count++;
if ($online_users[$x]['class'] >= 53 && $online_users[$x]['class'] <= 57) $d_count++;
}
unset($online_users[count($online_users)-1]);
mssql_connect($mssql_server,$mssql_user,$mssql_pass);
mssql_select_db($CONFIG['dbdbname']) or DIE("Table unavailable");
$result=mssql_query("
select record_time, world_user
from user_count
where auth_user<>0
order by world_user desc");
$max_user=mssql_fetch_assoc($result);
$result=mssql_query("
SELECT AVG(world_user) AS avg_user
FROM user_count
WHERE (server_id = '1') AND (DATEPART(yy, record_time) = '".date("Y")."') AND (DATEPART(mm, record_time) = '".date("m")."') AND (DATEPART(dd, record_time) = '".date("d")."')");
$avg_today=mssql_fetch_assoc($result);
?>
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td class="al">Cредний Oнлайн: </td>
<td>97</td>
</tr>
<tr>
<td class="al">Мах было :</td>
<td class="t-bold al info ar"><?=$max_user["world_user"]?></td>
</tr>
<tr>
<tr>
<td class="al"><?=$max_user["record_time"]?></td>
<td></td>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
<?=$sep?>
</table>
ненужное удалишь просто (имею ввиду макс. онлайн и тп.)
0
· 14.05.2008, 12:03
jeka101: Мне нужен скрипт mssql который!
вот скрипт
Цитата
<tr>
<td class="navbgright"><center>
<span class="t-small">Логин сервер:</span>
<?
error_reporting(0);
if ($fp=fsockopen("127.0.0.1","2106",$ERROR_NO,$ERROR_STR,(float)0.5))
{
echo "Жив";
fclose($fp);
}
else
echo "Сдох";
?> </td>
</tr>
<tr>
<td class="navbgright"><center>
<!--
navigation/navigation_right_link
-->
<!--
navigation/navigation_right_link
-->
<span class="t-small">Гейм Сервер:</span>
<?
error_reporting(0);
if ($fp=fsockopen("127.0.0.1","7777",$ERROR_NO,$ERROR_STR,(float)0.5))
{
echo "Жив";
fclose($fp);
}
else
echo "Сдох";
?> </td>
</tr>
<td class="navbgright"><center>
<span class="t-small">Логин сервер:</span>
<?
error_reporting(0);
if ($fp=fsockopen("127.0.0.1","2106",$ERROR_NO,$ERROR_STR,(float)0.5))
{
echo "Жив";
fclose($fp);
}
else
echo "Сдох";
?> </td>
</tr>
<tr>
<td class="navbgright"><center>
<!--
navigation/navigation_right_link
-->
<!--
navigation/navigation_right_link
-->
<span class="t-small">Гейм Сервер:</span>
<?
error_reporting(0);
if ($fp=fsockopen("127.0.0.1","7777",$ERROR_NO,$ERROR_STR,(float)0.5))
{
echo "Жив";
fclose($fp);
}
else
echo "Сдох";
?> </td>
</tr>
0
Тема закрыта для ответов


