Comments (23)
Can you please add your code with which you call the class "MinecraftServerStatus"? I have an idea, but I'm not quite sure.
from minecraft-server-status.
I used the example code you provided:
PHP im using is 5.4.4 and sockets support is enabled (im testing locally with a random minecraft server).
from minecraft-server-status.
I tried some requests, everytime I got no errors, but sometimes the query failed and the script uses the fallback (MinecraftServerStatusSimple). Make sure you have the "MinecraftServerStatusSimple.class.php" file in the same place as the "MinecraftServerStatus.class.php" file. I will commit some changes which maybe can help to solve the problem.
Can you test the script somewhere else (e.g. your webspace). I can not reproduce the error.
from minecraft-server-status.
<?php
require_once('MinecraftServerStatus.class.php');
$Server = new MinecraftServerStatus('23.29.119.86');
header('Content-Type: text/plain');
print_r($Server->Get());
?>
Output:
Array
(
[hostname] => Server Website: hc-craft.com
[gametype] => SMP
[game_id] => MINECRAFT
[version] => 1.3.1
[map] => Hcw
[numplayers] => 160
[maxplayers] => 300
[hostport] => 25565
[hostip] => 0.0.0.0
[software] => CraftBukkit on Bukkit Unknown-Version
[online] => 1
)
from minecraft-server-status.
Aha, now it works for me too. I didnt have the simple class before :X
Player list now generates a new error (for that server):
Warning: Invalid argument supplied for foreach() in W:\XAMPP\htdocs\test.php on line 7
test.php looks like:
Get()); foreach($Server->Get('players') as $Player) echo $Player.''; ?>
from minecraft-server-status.
Normaly you don't need the simple class, it's only a fallback for some issues.
This should fix your warning:
if($Server->Get('players')) {
foreach($Server->Get('players') as $Player)
echo $Player;
}
If there are too much players the script will stop reading the players and return none. You can increase the limit of the fread lenght by editing the following line: https://github.com/NoxNebula/Minecraft-Server-Status/blob/master/MinecraftServerStatus.class.php#L140 (2048). Maybe this could help. Maybe I will add an attribute for it to set it without editing.
from minecraft-server-status.
That fixed it, but player list still isint displaying. Even if i set that fread value to something big like 999999
from minecraft-server-status.
I think, this is an issue of the server. I'm not sure if this is fixable.
from minecraft-server-status.
Hmm, here's a server that has over 200 people connected, and that site is able to display them all: http://www.gametracker.com/server_info/68.233.235.26:25565/
from minecraft-server-status.
My script based on this documentation: http://dinnerbone.com/blog/2011/10/14/minecraft-19-has-rcon-and-query/. The tool from the minecraft developer doesn't work either on query 68.233.235.26: http://dinnerbone.com/minecraft/tools/status/. I don't know how gametracker.com can handle this :(
from minecraft-server-status.
I found this: http://wiki.vg/Query#Full_stat
Does that help you fix the issue?
Also, i asked gametracker which protocol they use to get those player lists and they said its the GS4 one. Still no idea how they do it though.
Here's an idea; are you able to split the packet up so the player list would be transferred gradually?
from minecraft-server-status.
I will check http://wiki.vg/Query later, I think it should help.
The GS4 Status Listener is the build-in Minecraft query server, the same one my script also query.
Splitting the packages doesn't work, there is no way to tell the server to send the status in parts.
I will do a bit research with http://wiki.vg/Query.
from minecraft-server-status.
Do you do any paid projects? I'm looking for PHP status scripts (that show the player list of a server) for the following games:
Killing Floor
Call of Duty 4: Modern Warfare 3
Call of Duty 4: Modern Warfare 2
Battlefield 3
Battlefield: Bad Company
Battlefield 2
Call of Duty: Black Ops
DayZ
Super Monday Night Combat
Arma 2
I know a few already exist for some of these games, but they're all really old and don't work anymore.
from minecraft-server-status.
Currently I haven't much time but later mabe.
from minecraft-server-status.
Does that site i linked you provide any clues on how to fix the script?
from minecraft-server-status.
Any news on this? When servers have lots of players on, it seems to return no player names. All the other stuff seems to work, it is just the online players list that doesn't.
from minecraft-server-status.
Unfortunately I have still no idea why this isn't working, sorry guys.
from minecraft-server-status.
I don't fully understand the protocol, so I can't work out a fix myself. Do you have any idea what it might be?
from minecraft-server-status.
This is working perfectly for me for some servers, but for others like pvp.gontroller.com
it thinks that its offline? Any idea why?
from minecraft-server-status.
Is this possibly related to this issue?
from minecraft-server-status.
it seems so... I will check this.
from minecraft-server-status.
It is the same problem, I switched from the NoxNebula class to the xPaw class assuming that it would fix it, but no such luck :(
from minecraft-server-status.
MC-10984 has been marked as resolved, which should fix this issue.
from minecraft-server-status.
Related Issues (11)
- Cant load SimpleClass Fallback on different root
- Notice: Undefined offset: 1 in /var/www/html/Minecraft-Server/apis/MinecraftServerStatus.class.php on line 77
- the value of online appears to always be 1 when using query HOT 2
- Getting error at line 23 and foreach loop for players HOT 2
- Notice: Undefined offset: 1 HOT 2
- 'Failed to write on socket' - Minecraft Status Checker HOT 2
- Online assertion
- Throwing exceptions
- Bug in Zeile12 HOT 3
- Parse error: syntax error, unexpected '[' in /home/u337092315/public_html/MinecraftServerStatus.class.php on line 23 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraft-server-status.