1 Attachment(s)
[RELEASE] Very Simple Server Status Script
Ok, this is a very simple script that i made for gunz server status.
you can download it from the attachments.
the README.txt Contains this.
Made by XZeenon.
Please do not claim this as your own.
Instructions.
Open Index.php with your favorite text reader.
then edit 127.0.0.1 to your server's IP adress.
Secondly edit your port to be excact same as your gunz server port.
Save it upload it to your host and your done!
Please thank me. XZeenon.
P.S. You may use the images I have made.
Basically when the server is offline it has an image and something that says online or offline
like this
http://24.80.77.29/test/alive.jpg
and this
http://24.80.77.29/test/dead.jpg
so here it is download from attachments.
Re: [RELEASE] Very Simple Server Status Script
Sorry for double post but people please give me feed back?
Re: [RELEASE] Very Simple Server Status Script
Looks cool gonne try this
Re: [RELEASE] Very Simple Server Status Script
that's easy as pie XD i knew how to do that
Re: [RELEASE] Very Simple Server Status Script
Quote:
Originally Posted by
holdenms
that's easy as pie XD i knew how to do that
umm that's why i said it was a simple script...
what isn't easy to make for you probobally is the graphix.
so HA HA
Re: [RELEASE] Very Simple Server Status Script
$f = @fsockopen("myip",port);
if($f) echo 'Server online';
else echo 'Server offlie';
ez
Re: [RELEASE] Very Simple Server Status Script
Wow, don't people read?
W/e, The thing about this is that i made it have pics.
Re: [RELEASE] Very Simple Server Status Script
Graphics - it's a joke [ for people like me ]
Re: [RELEASE] Very Simple Server Status Script
Quote:
Originally Posted by
Z3ZO
Graphics - it's a joke [ for people like me ]
Huh? That made no sence at all.
Re: [RELEASE] Very Simple Server Status Script
wtf ho wdo i put the onlien stats and ofline were do i put it?
Re: [RELEASE] Very Simple Server Status Script
its shit, please close this topic
Re: [RELEASE] Very Simple Server Status Script
wow its not shit, many people just wait for this ( most of them the noob ucoz servers lol )
and lol aziz and xzeenon in 1 topic... xD
Re: [RELEASE] Very Simple Server Status Script
i'm using sqlExpress2005 + iis + php5 with php_pdo_odbc enabled (php_mssql just dies on my priv.serv.)
so i just moded simple status/statistic for use with ODBC;
this code-part can be used as module in site ;)
it shows : server status, total accounts, total chars, current online and top10 of chars (by exp);
if it useful to someone - just say thx =)
p.s. sorry for my bad english :)
PHP Code:
<?
$hostname = '127.0.0.1';
$servers = Array('DeathMatch'=>6000, 'TestServer'=>6002);
$odbclogin = 'sa'; // you can change it to any user allowed to access your DB
$odbcpass = 'pass'; // pass for your DB user
$odbcdriver = 'SQL Native Client'; // see it in odbc administration utility; example is for my sql-express2005 instance ;)
$odbc_dsn = 'game'; // just name of odbc-instance in your "system dsn" for your game-server; i use it both for matchserver and website; name of default database configured in odbc instance;
function gt($a) {
// this only for simple time formating ;)
$hours=floor($a/3600);
$mins=floor(($a-($hours*3600))/60);
return "$hours h/$mins mins";
}
$status='';
foreach($servers as $sname => $port)
{
$connection = @fsockopen($hostname, $port, $errno, $errstr, 0.003);
if(!$connection) $status = '<span class="OFFLINE">ONLINE</span>'; else $status = '<span class="ONLINE">ONLINE</span>';
$status.= $sname . ' - ' . $status . '<br />';
}
try {
$conn = new PDO("odbc:dsn=$odbc_dsn;driver=$odbcdriver", $odbclogin,$odbcpass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) { $data = "ODBC error: " . $e->getMessage(); $error=1; }
$cmd="select count(*) as total from login";
$accounts=0;
try {
$query = $conn->prepare($cmd);
$query->execute();
} catch (PDOException $e) { die("ODBC error: ".$e->getMessage()); };
if ($query->columnCount()>0) { while ($in=$query->fetch()) $accounts=$in['total'];}
$query=null;
$cmd="select top 1 * from ServerStatus";
$online=0;
try {
$query = $conn->prepare($cmd);
$query->execute();
} catch (PDOException $e) { die("ODBC error: ".$e->getMessage()); };
if ($query->columnCount()>0) { while ($in=$query->fetch()) $online=$in[1];}
$query=null;
$cmd="select count(*) as total from Character";
$chars=0;
try {
$query = $conn->prepare($cmd);
$query->execute();
} catch (PDOException $e) { die("ODBC error: ".$e->getMessage()); };
if ($query->columnCount()>0) { while ($in=$query->fetch()) $chars=$in['total'];}
$query=null;
$char=array();
$toplist='';
$cmd="select top 10 * from Character where DeleteFlag=0 order by XP desc";
$cnt=0;
try {
$query = $conn->prepare($cmd);
$query->execute();
} catch (PDOException $e) { die("ODBC error: ".$e->getMessage()); };
if ($query->columnCount()>0) {
$toplist='<table align="center" style="border:3px double #aaa;padding:3px;">
<tr><td colspan="6"><h3>TOP 10 Characters</h3></td></tr>
<tr><td>Char Name</td><td>Level</td><td>XP</td><td>Game Time</td><td>Kills</td><td>Dies</td></tr>';
while ($in=$query->fetch()) {
$char=$in;
if ($char['Sex']==0) $cl='male'; else $cl='female';
$toplist.="<tr><td class='$cl'>".$char['Name']."</td><td><b>".$char['Level']."</b></td><td>".$char['XP']."</td><td>".gt($char['PlayTime'])."</td><td>".$char['KillCount']."</td><td>".$char['DeathCount']."</td></tr>";
}
$toplist.='</table>';
}
$query=null;
$conn=null;
echo "
<style type='text/css'>
<!--
td { padding:2pt; text-align:center;}
td.male { color: blue; }
td.female { color: magenta; }
-->
</style>
<div style='padding:5pt;text-align:center;'>
<b>Server status:</b> $status<br/>
<b>Total accounts:</b> $accounts<br/>
<b>Total characters:</b> $chars<br/>
<b>Current online:</b> $online<br/>
<br/>
<br/>
".$toplist."</div>";
?>
Re: [RELEASE] Very Simple Server Status Script
Darkagent, I suggest you should make your own topic and post it.
Re: [RELEASE] Very Simple Server Status Script
Quote:
Originally Posted by
tagerinator
Darkagent, I suggest you should make your own topic and post it.
and clone same subjs for many times ) i don't pretend to be an original code writer, i'm just took somethin and moded it.