Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Server Status + Online Players Count

Skilled Illusionist
Joined
Aug 18, 2005
Messages
305
Reaction score
78
Dont ask me how to use this. If you are to stupid to figure it out you shouldnt be hosting anything at all.

Server Status:
Code:
<?php
				$fp = @fsockopen("127.0.0.1", 5051, $errno, $errstr, 1);
if($fp >= 1){ 
echo '<font color=green>Online</font>';}
else{ echo '<font color=red>Offline</font>'; } 
			?>


Online Players:
Code:
<?php

include '/config/config.php';

$query = mysql_query("SELECT * FROM user WHERE online='1'");
$numrows = mysql_num_rows($query);
echo $numrows;

?>

As for the config.php you need something that connects to the DB... I would guess you could use something like..
Code:
$server['address'] 				= 		'127.0.0.1';
$server['user'] 				= 		'root';	
$server['pass']					= 		'';
$server['port'] 				= 		'3306';

Work on this part for yourself. Trying to keep the leechers out.


Have fun.
 
Junior Spellweaver
Joined
May 23, 2013
Messages
154
Reaction score
45
Nice release, good for those new to web code, not sure about the "if you're too stupid" wording even though I agree with it's meaning the phrasing isn't so diplomatic. xD

The final part about keeping out the leeches is good lol, I don't like leeches who do nothing for themselves. Overall good job.
 
Back
Top