[HELP]Server Status Total acc/char players online code

02/13/2010 11:05 paralyzer2#1
HELP I need a Server Status, Total account, Total Character and Total Players Online code for 5165 using appserver NON-HAMACHI HELP!
02/13/2010 13:33 salem rey#2
/players maybe that will help you.
02/13/2010 15:05 Hanibal#3
This is what my status.php looks like

Code:
<title>Server Status</title>
<a href="http://status.blackout-gaming.net/" target="_blank">Server Status: <img src="http://status.blackout-gaming.net/status.php?dns=YOURIPHERE&port=9958&style=7" alt="Powered by Blackout Gaming Status Checker" border="0" /></a></a>
</tr><p>

<b><font color=#FFCF84><font SIZE="2">					
<li class="style11"><?php	
$directory = "C://OldCODB/Users/";
$howmuchacc = count(glob("" . $directory . "*.usr"));

echo "Total Accounts: $howmuchacc ";
?></li>
<li class="style11"><?php	
$directory = "C://OldCODB/Users/Characters/";
$howmuchchar = count(glob("" . $directory . "*.chr"));

echo "Total Characters: $howmuchchar ";
?></li>
<li class="style11">Players Online: <b><?php echo (exec('netstat -a -n |find "5816"  |find "ESTABLISHED" /c')-0); ?></b><br />
<p /></li>
02/13/2010 16:08 paralyzer2#4
THANK YOU BUT:

The server online allways ses offline and the Players online comes out with dubble the players online if its just me online it said 2 ppl and if 2ppl are online it said that 4ppl are online!


Help with be much helpful
02/13/2010 17:13 salem rey#5
hmmm... idk the problem with you server :D ty asking else who know it. :D sorry friend
02/13/2010 19:27 irritantgassie#6
here this will help ya:

Code:
<?php
require ("connect.php");

$res = mysql_query("SELECT count(*) FROM accounts;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Accounts Created: ".$val[0]."</div>";

$res = mysql_query("SELECT count(*) FROM characters;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Characters Created: ".$val[0]."</div>";

$ip = "Your Server Ip";
$port = "9958"; //keep this what it is!!
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=red>Offline</b></FONT>";
else{
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=lime>Online</b></FONT>";
fclose($sock);
}

$res = mysql_query("SELECT count(*) FROM accounts WHERE online=1;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Total Players Online: ".$val[0]."</div>";
?>
Then make a connect.php

Code:
<?php

$error = "<body bgcolor='black'><font color='white'>Problem connecting to database, Please try again later.</font>";

$connect = mysql_connect("localhost", "root", "password") or die($error);
mysql_select_db("coproj") or die($error);

?>
02/13/2010 20:30 paralyzer2#7
Sorry I dont do Mysql
02/13/2010 21:24 paralyzer2#8
Got my answer

#Request Close