Minecraft status

Post here is you are having problems with any of the tutorials.
Post Reply
gotgot1995
Posts: 3
Joined: Tue Dec 06, 2011 9:16 am

Minecraft status

Post 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.
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Minecraft status

Post by Temor »

you should post all your code here so that we can take a look at it.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Minecraft status

Post by jacek »

gotgot1995 wrote:Could you make me a little .zip file and put all we need for making this works ?
No.
Image
gotgot1995
Posts: 3
Joined: Tue Dec 06, 2011 9:16 am

Re: Minecraft status

Post 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.
gotgot1995
Posts: 3
Joined: Tue Dec 06, 2011 9:16 am

Re: Minecraft status

Post by gotgot1995 »

and when my server is really online, I get a bool false ! Why ? I need to put something special on my server ?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Minecraft status

Post 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]));
Image
Post Reply