Online players
PHP Code:
Code
<?
$file = file ("c:\RF_Server\SystemSave\ServerDisplay.ini");
foreach($file as $line)
{
if(strspn($line, "[") != 1)
parse_str($line);
}
function statuscheck($serverip, $port)
{
$sockres = @fsockopen($serverip, $port, $errno, $errstr, 1);
if (!$sockres) {
return "<img src=/images/off.gif>";
}
else {
@fclose($sockres);
return "<img
src=/images/on.gif>";
}
}
//MSSQL settings
$dbuser = 'sa';
$dbpasswd = '******'; // пароль к базе
$base =
"RF_WORLD";
$dbhost = "127.0.0.1\SQLEXPRESS,61433";
$conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
$selected=mssql_select_db('RF_World', $conn);
$query ='SELECT
t1.Name,t1.Lv,
t1.Serial,t2.PvpPoint,t2.[Kill],t2.Death,t3.OnlineStatus,t3.Map
FROM tbl_base AS t1, tbl_pvporderview AS t2, tbl_general AS t3
WHERE t1.Serial = t2.Serial and t2.Serial = t3.Serial and DeleteName =
"*" and AccountSerial < "2000000000" and
t3.OnlineStatus>=dateadd(minute,-5,getdate())
ORDER BY
t2.PvpPoint DESC, t1.Lv desc';
$query2 ='SELECT t1.Name,t1.Lv,
t1.Serial,t2.PvpPoint,t2.[Kill],t2.Death,t3.OnlineStatus
FROM
tbl_base AS t1, tbl_pvporderview AS t2, tbl_general AS t3
WHERE
t1.Serial = t2.Serial and t2.Serial = t3.Serial and DeleteName = "*" and
AccountSerial < "2000000000" and
t3.OnlineStatus>=dateadd(minute,-5,getdate())
ORDER BY
t2.PvpPoint DESC, t1.Lv desc';
//$result=mssql_query("SELECT
TOP 50 Serial,TotalPlayMin,PvpPoint,GuildSerial FROM
Rf_world.dbo.tbl_general where
OnlineStatus>=dateadd(minute,-5,getdate())ORDER BY PvpPoint DESC");
$result = mssql_query($query);
$result2 = mssql_query($query2);
$top_pvp_users=array();
for($x=0;$top_pvp_users[$x]=mssql_fetch_assoc($result2);$x++)
echo '
';
echo "
\n";
echo "\n";
echo '
';
echo '<font face=Lucinda>';
echo
'<center><table border=2 border-style= solid bordercolor=lime
cellSpacing=0 align=center';
echo '<tr><td width="100"
><center><font face=Lucinda size=2
color=#768a62><b>Кора</td></b><td width="100"
><center><font face=Lucinda size=2
color=#aa9286><b>Акретия</td><td width="100"
><center><font face=Lucinda size=2
color=#768a62><b>Беллато</td></b></font>';
{
echo '<tr><td width=100 ><center><font
face=Lucinda size=2 color=#86b2ba>';
echo $C_Num;
echo
'</font></td><td width=100><center><font
face=Lucinda size=2 color=#86b2ba><b><tb>';
echo
$A_Num;
echo '</font></td><td width=100
><center><font face=Lucinda size=2
color=#86b2ba><b><tb>';
echo $B_Num;
}
echo '</table>';
echo '';
echo '
';
echo '
';
echo '<font face=Lucinda>';
echo
'<center><table border=2 border-style= solid bordercolor=lime
cellSpacing=0 align=center';
echo '<tr><td width="100"
><center><font face=Lucinda size=2
color=#768a62>Место</td><td><font face=Lucinda size=2
color=#aa9286><b>Ник</td><td><font face=Lucinda
size=2 color=#768a62><b>Очки PvP</td><td><font
face=Lucinda size=2
color=#aa9286><b>Kill</td><td><font face=Lucinda
size=2
color=#768a62><b>Уровень</a></td></b></font>';
for($i=0;$i < count($top_pvp_users)-1;++$i)
{
$row = mssql_fetch_row($result);
echo '<tr><td
width=100 ><center><font face=Lucinda size=2
color=#86b2ba>';
echo $i + 1;
echo
'</font></td><td width=100><font face=Lucinda
size=2 color=#86b2ba><b><tb>';
echo $row[0];
echo '</font></td><td width=100 ><font face=Lucinda
size=2 color=#86b2ba><b><tb>';
echo (int)$row[3];
echo '</font></td><td width=100 ><font
face=Lucinda size=2 color=#86b2ba><b><tb>';
echo
$row[4];
echo '</b></font></td><td
width=100 ><b><font face=Lucinda size=2 color=#86b2ba>';
echo $row[1];
echo'</td></tr>';
echo
'<tr><td height=1></td><td></td><td
></td><td ></td><td><td ><td
></td>';
}
echo '</table>';
echo '';
echo '
';
echo '';
echo '';
echo
'<br>';
Server
status.
Code:
Code
<?php
$serverip = "127.0.0.1"; # ВАШ IP
$online='<font
color="green">Online</font>';
$offline='<font
color="red">Offline</font>';
function
statuscheck($serverip, $port) {
$sockres = @fsockopen($serverip,
$port, $errno, $errstr, 1);
if (!$sockres) {
return $offline;;
} else {
@fclose($sockres);
return $online;
}
}
echo "Login Server: ". statuscheck($serverip, "10001");
echo
"<br>World Server: " . statuscheck($serverip, "27780");
?>
$conn=mssql_close();
?>
We show the banned.
Code:
Code
<?
$sql_user = 'логин'; // SQL ID
$sql_pwd = 'пасс';
// SQL PASSWORD (change it to your password mssql)
$base =
"RF_User"; // SQL BASE name (don't change it's by default)
$host =
"127.0.0.1"; // SQL HOST (change it to your IP ex : gamenet.perm.ru)
$conn=mssql_connect($dbhost,$dbuser,$dbpasswd) or
die("<center><b>Критическая
ошибка</b><br>Невозможно подключиться к
базе<br></center>");
@mssql_select_db($base, $conn) or
die("<center><b>Критическая ошибка</b><br>База
не существует, либо нет доступа<br></center>");
if(!isset($_GET['type'])){
$type = "> 1";
}
elseif(isset($_GET['type']) && $_GET['type'] == "temporary"){
$type = "< 999";
} elseif(isset($_GET['type']) &&
$_GET['type'] == "permanent"){
$type = "> 998";
}
$data = mssql_query("SELECT * FROM tbl_UserBan WHERE nPeriod $type ORDER
BY dtStartDate DESC") or die('SELECT INVALID');
?>
<table width="100%" border="0" cellspacing="2" cellpadding="1"
align="center">
<tr bgcolor="#000000"><td
width="15%">Аккаунт</td>
<td
width="22%">Начало</td>
<td
width="13%">Срок</td>
<td width="13%"
align="center">Тип бана</td>
<td
width="21%">Причина</td>
<td
width="10%">Забанил/Изменил</td>
</tr>
<?
$i = 0;
$c1 = "#000000";
$c2 = "#000000";
while ($row =
mssql_fetch_row($data)){
$account_query = mssql_query("SELECT
[Name]
FROM [rf_world].[dbo].[tbl_base] WHERE
[rf_world].[dbo].[tbl_base].[AccountSerial] = $row[0] and DCK='0'");
$account = mssql_fetch_row($account_query);
if(!empty($account[0])){
$color = (($i % 2) == 0) ? $c1 : $c2 ;
$i++ ;
echo "<tr bgcolor='".$color."'>
<td>$account[0]</td>
<td>$row[1]</td>
<td>";
switch ($row[2]){
case (999):
$period =
"бессрочно";
break;
case (336):
$period = "2 недели";
break;
case (168):
$period = "неделя";
break;
case (23):
$period = "сутки";
break;
case (24):
$period = "сутки";
break;
case (12):
$period = "12
часов";
break;
case (6):
$period = "6 часов";
break;
case (1):
$period = "1 час";
break;
}
echo
$period;
echo "</td>
<td align=\"center\">";
if($row[3] == 0) {
echo "аккаунт";
}
else echo "чат";
echo "</td>
<td>$row[4]</td>
<td>$row[5]</td>
</tr>";
}
}
?>
</table>
</p>
</p>
<?
ob_end_flush();
?>
Показ текущих
патриархов
Код:
<?php
# Private by Freelance
Design Center
# Script for GamerGrad Server
define("_HOST_", "localhost");# host
define("_HOSTUSER_", "sa");#
login
define("_HOSTPASS_", "");#password
define("_WORLD_",
"rf_world");#world
$msconnect=mssql_connect(_HOST_,_HOSTUSER_,_HOSTPA SS_);
$res =
mssql_query("SELECT * FROM "._WORLD_.".dbo.tbl_racebattle_log ORDER BY
idx DESC ");
$row = mssql_fetch_assoc($res);
$resulty1 =
mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial =
'".$row[bossserial0]."'");
$Name0 =
trim(@MSSQL_RESULT($resulty1,0,"Name"));
$resulty1 =
mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial =
'".$row[bossserial1]."'");
$Name1 =
trim(@MSSQL_RESULT($resulty1,0,"Name"));
$resulty1 =
mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial =
'".$row[bossserial2]."'");
$Name2 =
trim(@MSSQL_RESULT($resulty1,0,"Name"));
echo "
<big>Представители
расы</big></p>";
echo "
Федерация Беллато:
<b>".$Name0.'</b></p>';
echo "
Альянс
Кора: <b>".$Name1.'</b></p>';
echo "
Империя
Акретия: <b>".$Name2.'</b></p>';
?>
Counter ChipVara with the configuration
Code:
Code
<?php
$conf_gmt=0; //Поправка по GMT, если время на
веб-сервере отличается от времени на игровом сервере. Если время
совпадает - указываем 0
$conf_ygmt=2; //GMT ВАШЕГО пояса. Украина
+2, Россия +3
$conf_cw1=5; //Время первого ЧВ
$conf_cw2=13; //Время второго ЧВ
$conf_cw3=21; //Время третьего ЧВ
//Дальше трогать ничего не нужно
$h=Date(H);
$datem=date(i);
$h=$h+$conf_gmt;
if ($h>=25) {
$h=$h-24;
}
if($h < $conf_cw2 && $h >=
$conf_cw1)
{ $hh=2;$hc=$conf_cw2; }
if($h >= $conf_cw2
&& $h < $conf_cw3)
{ $hh=3;$hc=$conf_cw3; }
if($h
>= $conf_cw3 && $h <= 23)
{ $hh=1;$hc=$conf_cw1; }
if($h >= 00 && $h < $conf_cw1)
{
$hh=1;$hc=$conf_cw1; }
if($h >= $conf_cw1 && $h <=
$conf_cw2)
{ $hh=2;$hc=$conf_cw2; }
if ($h==24)
{
$hh=1;$hc=$conf_cw1; }
if ($h==0)
{ $hh=1;$hc=$conf_cw1; }
$inh=($hc-$h)-2;
$inm=60-$datem;
$chipwar1="<div>".$hh." ChipWar at ".$hc.":00<br>";
$chipwar3="Time left: ".$inh.":".$inm."<br>Server time:
".$h.":".$datem."<br>(GMT
+".$conf_ygmt.")<br><br>".$conf_cw1.":00 - ".$conf_cw2.":00 -
".$conf_cw3.":00</div>";
$chipwar=$chipwar1.$chipwar3;
echo $chipwar;
?>
|
Komentar
Posting Komentar
Silahkan berkomentar