Статус Сервера
Код:
function rf_server_test($name,$ip,$port){ $fp=fsockopen($ip, $port, &$errno, &$errmsg,1); if(!$fp){ if(stristr($errmsg,'refused')){ return "$name: $errmsg. "; }else{ return "$name: $errmsg. "; }; }else{ return "$name: Online. "; }; }; //--SERVER INFORMATION-- //////////////////////-- $server_names=array('Patch Server', 'Login Server', 'Novus Server', 'GameCP Server'); $server_ips=array('127.0.0.1','127.0.0.1','127.0.0.1','127.0.0.1'); $server_ports=array('8080','10001','27780','80'); //--HTML BELOW HERE-- //////////////////////-- echo ""; echo ""; echo "Patch Servers "; echo rf_server_test($server_names[0],$server_ips[0],$server_ports[0]); echo " "; echo "Login Servers "; echo rf_server_test($server_names[1],$server_ips[1],$server_ports[1]); echo " "; echo "Game Servers "; echo rf_server_test($server_names[2],$server_ips[2],$server_ports[2]); echo " "; echo "Web Servers "; for($i=3;$i<4;$i++){ echo rf_server_test($server_names[$i],$server_ips[$i],$server_ports[$i]); }; echo ""; ?>
Кто Где?!
Код:
<!-- Online Status --> <tr><td><center><table border=0> <? $file = file ("D:\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>"; } } //Вывод на экран статус сервера и онлайн рас $serverip = "WAN IP"; echo "<b><font size=4 color=#9193a6>"; echo " Login: " . statuscheck($serverip, "10001"); echo " Server: " . statuscheck($serverip, "27780"); echo "<tr><td><font color=#768a62>Кора:<td><font color=lime> $C_Num <td style=padding-left:15px><font color=#aa9286>Акретия:<td><font color=lime> $A_Num <td style=padding-left:15px><font color=#86b2ba>Беллато:<td><font color=lime> $B_Num"; echo "<tr><td><font color=#768a62> Генштаб Кора: <td><font color=lime> $NeutralC <td style=padding-left:15px><font color=#aa9286> Генштаб Акретия: <td><font color=lime> $NeutralA <td style=padding-left:15px><font color=#86b2ba>Генштаб Беллато: <td><font color=lime> $NeutralB <br>"; echo "<tr><td><font color=#768a62> Харам:<td><font color=lime> $NeutralCS1 <td style=padding-left:15px><font color=#aa9286> 213-Застава: <td><font color=lime> $NeutralAS1 <td style=padding-left:15px><font color=#86b2ba> Солус: <td><font color=lime> $NeutralBS1 <br>"; echo "<tr><td><font color=#768a62> Нумерус: <td><font color=lime> $NeutralCS2 <td style=padding-left:15px><font color=#aa9286> 117-Застава: <td><font color=lime> $NeutralAS2 <td style=padding-left:15px><font color=#86b2ba> Анакада: <td><font color=lime> $NeutralBS2 <p>"; echo "<tr><td>"; echo "<tr><td>"; echo "<tr><td>"; echo "<tr><td>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Шахты: <td><font color=lime> $resources <br>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Этер: <td><font color=lime> $Platform01 <br>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Сеттовы Пустыни: <td><font color=lime> $Sette <br>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Вулкан: <td><font color=lime> $Cauldron01 <br>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Элан: <td><font color=lime> $Elan <br>"; echo "<tr><td><td><td style=padding-left:15px><font color=#ffffff> Данж: <td><font color=lime> $Dungeon00 <p>"; ?>
Патреархи Рас
Код:
<?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_,_HOSTPASS_); $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 "<p><big>Представители расы</big></p>"; echo "<p>Федерация Беллато: <b>".$Name0.'</b></p>'; echo "<p>Альянс Кора: <b>".$Name1.'</b></p>'; echo "<p>Империя Акретия: <b>".$Name2.'</b></p>';
Онлайн ников в игре
Код:
#!/usr/bin/perl -w use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; $ms_dbh = DBI->connect("dbi:Sybase:server=Server;language=ru_russian;charset=CP1251", 'xxx', 'xxx', {PrintError => 0}); die "\nWARNING!!! Unable for connect to server $DBI::errstr" unless $ms_dbh; $result = $ms_dbh->prepare("use RF_User"); $result->execute; $result = $ms_dbh->prepare("SELECT serial as serial, CONVERT(varchar,id) as login FROM tbl_UserAccount where lastlogintime > lastlogofftime"); $result->execute; while (my $ln = $result->fetchrow_hashref()) { $logins.=$ln->{serial}.";"; } $result = $ms_dbh->prepare("use RF_WORLD"); $result->execute; $content.="Ники игроков:<br>\n"; @LOGIN=split(/;/, $logins); for ($i=0; $i<=$#LOGIN; $i++){ $result = $ms_dbh->prepare("SELECT TOP 1 Name FROM tbl_base WHERE AccountSerial = '".$LOGIN[$i]."' ORDER BY LastConnTime DESC"); $result->execute; while (my $ln = $result->fetchrow_hashref()) { $content.=$ln->{Name}."<br>\n"; } } print "content-type: text/html\n\n"; print (' <html> <head> <meta http-equiv="Content-Language" content="ru"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <title>Список игроков которые онлайн</title> </head> <body>'); print $content; print ('</body></html>'); $ms_dbh->disconnect(); #print "Disconnect from MS SQL Server.\n";