Page 1 of 1

Minecraft status

Posted: Tue Dec 06, 2011 9:24 am
by gotgot1995
I there I have a problem with this tutorial :
http://www.youtube.com/watch?v=NssQ9u9M ... re=related

I'd like to know why do I get a bool(false) when this is my real IP adress (I also get an error, see HERE)
I downloaded the plugin minequery and I installed it (on my own server. you can get the IP HERE)
Could you make me a little .zip file and put all we need for making this works ?
Thanks !

P.S: I share my server by a port forwarding if that can help.

Re: Minecraft status

Posted: Tue Dec 06, 2011 2:12 pm
by Temor
you should post all your code here so that we can take a look at it.

Re: Minecraft status

Posted: Tue Dec 06, 2011 7:53 pm
by jacek
gotgot1995 wrote:Could you make me a little .zip file and put all we need for making this works ?
No.

Re: Minecraft status

Posted: Wed Dec 07, 2011 12:21 pm
by gotgot1995
here is the status.php :
<?php

include('core/init.inc.php');

?>
<?php

var_dump(server_online($servers[0][0]));

?>
the init.inc.php
<?php
$servers = array(array('90.49.136.43', '25565'));
include("lib/minecraft_server.inc.php");

?>
and here is the minecraft_server.inc.php
<?php
//vérifie si le serveur est en ligne
function server_online($server, $port){
	fsockopen($server, $port, $errno, $errstr, 0.5);
	
	return ($errno === 0);
	
}
?>
I'd like to not get the error "connexion timed out" I'd like to get a "Server OFFLINE" message.

Re: Minecraft status

Posted: Wed Dec 07, 2011 12:23 pm
by gotgot1995
and when my server is really online, I get a bool false ! Why ? I need to put something special on my server ?

Re: Minecraft status

Posted: Wed Dec 07, 2011 6:43 pm
by jacek
gotgot1995 wrote:and when my server is really online, I get a bool false ! Why ? I need to put something special on my server ?
Because the connection to the server is failing. It looks like you are giving the wrong port since you are not passing the second parameter on this line
var_dump(server_online($servers[0][0]));
It should be
var_dump(server_online($servers[0][0], $servers[0][1]));