Git Product home page Git Product logo

Comments (23)

noxifoxi avatar noxifoxi commented on August 23, 2024

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.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024
<?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.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

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.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

I think, this is an issue of the server. I'm not sure if this is fixable.

from minecraft-server-status.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

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.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

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.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

Currently I haven't much time but later mabe.

from minecraft-server-status.

Ruok2bu avatar Ruok2bu commented on August 23, 2024

Does that site i linked you provide any clues on how to fix the script?

from minecraft-server-status.

VeoPVM avatar VeoPVM commented on August 23, 2024

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.

noxifoxi avatar noxifoxi commented on August 23, 2024

Unfortunately I have still no idea why this isn't working, sorry guys.

from minecraft-server-status.

VeoPVM avatar VeoPVM commented on August 23, 2024

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.

mongy910 avatar mongy910 commented on August 23, 2024

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.

ZackBoe avatar ZackBoe commented on August 23, 2024

Is this possibly related to this issue?

from minecraft-server-status.

noxifoxi avatar noxifoxi commented on August 23, 2024

it seems so... I will check this.

from minecraft-server-status.

VeoPVM avatar VeoPVM commented on August 23, 2024

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.

ZackBoe avatar ZackBoe commented on August 23, 2024

MC-10984 has been marked as resolved, which should fix this issue.

from minecraft-server-status.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.