noxifoxi / minecraft-server-status Goto Github PK
View Code? Open in Web Editor NEWLightweight Minecraft server status PHP library
License: GNU General Public License v3.0
Lightweight Minecraft server status PHP library
License: GNU General Public License v3.0
So far the code is working excellently except for testing purposes I intentionally specified either the wrong port, or shut down my server and instead of $Server->Get('online'); returning false, it throws a "Failed to write on socket" exception. I ended up changing those lines to return false vs throwing an exception. Any ideas?
I use the script for a webinterface and I get this Notice: Notice: Undefined offset: 1 in /var/www/html/Minecraft-Server/apis/MinecraftServerStatus.class.php on line 77
, but I don't know why and what I can do.
That's line 77: if($Data[1])
I include the class like that: require('apis/MinecraftServerStatus.class.php');
I'm using the ip livecraft.es and it returns the information but during connection gives me the following error:
Notice: Undefined offset: 1 in /home/****/public_html/MinecraftServerStatus.class.php on line 93
Also, if I use the ip: server.minecraftgallery.com it will return the information but return an error of:
fwrite(): send of 15 bytes failed with errno=61 Connection refused
Location: MinecraftServerStatus.class.php on line 136
which if i use "error_reporting(0);" turns into "Failed to write on socket"
Thanks!
Ich hab nen Bugg in Zeile 12 :
Parse error: syntax error, unexpected '[' in /var/customers/webs/ni310218_2/MinecraftServerStatus.class.php on line 12
Vom MinecraftServerStatusSimple
i'm looping through an array of servers to check the status of each and then i build a page. when a server is online the object contains all of the fields the server offers.
when a server is offline the object still contains an empty field with the value NULL, a software field with the value "Vanilla", and an online field with a value of int(1). regardless of the server status when using query it appears the server is always online == 1.
If you are working on a different root, the script can't load the fallback file.
Add DIR constant to SimpleClass Path on Line 57 and 58.
__DIR__.'/MinecraftServerStatusSimple.class.php'
Looks like a bad way of making an array.
error is saying that '[' is not right. I changed to $Info = array(); instead. Works great.
Also, the foreach loop for getting player list is not working correctly. I get...
Warning: Invalid argument supplied for foreach()...
on that line.
Script isint working. I get the following error:
Notice: Undefined offset: 1 in W:\XAMPP\htdocs\MinecraftServerStatus.class.php on line 76
$this->Socket = @stream_socket_client('udp://'.$Host.':'.(int)$Port, $ErrNo, $ErrStr, $Timeout);
if($ErrNo || $this->Socket === false)
$this->Info['online'] = false; return;
This is not a complete check to determine if a server is offline. In many circumstances the socket will successfully open regardless of what services are using the port.
The online Info is set to true without any useful checking at the end of this function:
$this->Info['online'] = true;
Should default to false until proven by returned data. e.g. at least one other Info value set.
I was attempting to use the server status file when I noticed that everywhere I included the file, this error message followed during testing:
Parse error: syntax error, unexpected '[' in /home/u337092315/public_html/MinecraftServerStatus.class.php on line 23
Is this an error on my part? I have been studying the code I have written for days, to no avail. The server I am using currently supports Php 5. Could php versions be a problem (if the script was written in an older version of php)?
I'm getting this error when trying to use it:
Fatal error: Uncaught exception 'Exception' with message 'Failed to write on socket' in /home/****/****/lib/MinecraftServerStatus.class.php:137 Stack trace: #0 /home/****/****/lib/MinecraftServerStatus.class.php(52): MinecraftServerStatus->Send(9) #1 /home/****/****/index.php(6): MinecraftServerStatus->__construct('mc.****.com') #2 {main} thrown in /home/****/****/lib/MinecraftServerStatus.class.php on line 137
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.