Solved A bug with the website getting info about server status

Discussion in 'Plugin Development' started by Kamilkime, Nov 18, 2015.

Thread Status:
Not open for further replies.
  1. Well, I've recently written a plugin, that changes a bit the way a server is displayed in the MC multiplayer server list - using ProtocolLib I change things like numPlayers, maxPlayers, motd, etc.

    And there's the problem - when I load the plugin, the website, that is getting server status, immediatelly stops receiving correct server status info. All the time it shows that the server is off, when it acctually is on and the plugin is working. Is there anything I can do with these? I've already tried things like changing query-port to be other than server-port.

    I use this code to modify the packet (also uses PacketWrapper): http://pastebin.com/9YWvDqSR
    And on this site we are showing server status: http://mc-lossantos.pl/index.php
    In polish 'wyłączony' means 'off', server is on all the time, with the KSlots (packet manipulating) plugin running :/
     
  2. @Kamilkime
    Hrm, that's weird. Basicly what most server status websites do, is ping to a server using the so called "legacy ping". This was the old way of getting a server's status, now it's using a different method. The legacy ping is not using the ServerInfo packet, so it's odd that the status is affected by this.
     
  3. Offline

    stefvanschie

    @Kamilkime
    I know a little bit about PHP. I think the upper file is correct, I don't know about the second one though. It seems correct, but I've never worked with server lists so maybe you need to display information different.
     
  4. @Kamilkime
    I tested the used API with your server, and got
    Code:
    {
    "error": "ord() expected a character, but string of length 0 found"
    }
    
    as response. Try disabling the fake protocol, as it can sometimes result in errors like this.
     
  5. @megamichiel
    I tested this plugin by disabling all its components one by one, also the fake protocol - only when i disabled the plugin completely the site was working correctly :/

    @stefvanschie,@megamichiel

    Thanks for help, even if it wasn't much - I manager to change the php file, so it takes data like maxPlayers from querry, not from server ping :)
    If someone is interested how it looks now - http://pastebin.com/K17yv9Vr

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 19, 2015
Thread Status:
Not open for further replies.

Share This Page