-->

Tutorial membuat RF Private Server (Part 14)




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 "";
} else {
@fclose($sockres);
return "";
}
}

//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 '';
echo '

echo '
Кора
Акретия Беллато

';




{

echo ' ';
echo $C_Num;
echo ' ';
echo $A_Num;
echo ' ';
echo $B_Num;
}

echo '

';

echo '';

echo '







';




echo '







';

echo '';
echo ' echo '
Место
НикОчки PvPKillУровень
';




for($i=0;$i < count($top_pvp_users)-1;++$i)

{

$row = mssql_fetch_row($result);




echo ' ';
echo $i + 1;
echo '

';
echo $row[0];
echo '';
echo (int)$row[3];
echo '';
echo $row[4];

echo '';
echo $row[1];
echo' ';




echo ' ';

}

echo ' ';

echo '';

echo '







';




echo '';

echo '';

echo '

';




Server status.

Code:
Code

$serverip = "127.0.0.1"; # ВАШ IP
$online='Online';
$offline='Offline';

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 "
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("
Критическая ошибка
Невозможно подключиться к базе
");
@mssql_select_db($base, $conn) or die("
Критическая ошибка
База не существует, либо нет доступа
");

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');
?>









$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 "






";
}
}
?>
АккаунтНачалоСрокТип банаПричинаЗабанил/Изменил
$account[0]$row[1]";
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 "
";
if($row[3] == 0) {
echo "аккаунт";
}
else echo "чат";
echo "
$row[4]$row[5]















ob_end_flush();

?>




Показ текущих патриархов

Код:




# 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 "




Представители расы";

echo "




Федерация Беллато: ".$Name0.'';

echo "




Альянс Кора: ".$Name1.'';

echo "




Империя Акретия: ".$Name2.'';

?>

Counter ChipVara with the configuration

Code:
Code

$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="
".$hh." ChipWar at ".$hc.":00
";
$chipwar3="Time left: ".$inh.":".$inm."
Server time: ".$h.":".$datem."
(GMT +".$conf_ygmt.")

".$conf_cw1.":00 - ".$conf_cw2.":00 - ".$conf_cw3.":00
";

$chipwar=$chipwar1.$chipwar3;

echo $chipwar;
?> 

Nico Kambing
Nothing to display

Related Posts

Post a Comment

Subscribe Our Newsletter