Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Getting number of online/max players on another server

Comments in 'Plugin Development' started by Kvetinac97, Jul 7, 2015.

  1. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Hi.

    How can I get online json feed from any server IP and port? (some program, or getting it from plugin...)

    I know that some servers offer that, but some doesn't :(
  2. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    This one didn't really work for me(Server was online, but it said it's offline, slots didn't work), it can only tell you the currently online Players.
  4. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    It work for me, I had to add "".$playerNumber instead of just $playerNumber or it don't display it
    Andrey Nazarchuk likes this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Minecraft Query isn't JSON. What do you mean?
  6. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you can query the number of players from the server directly, why use a third party tool that is both slower and less reliable?
  8. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Yes, but can this part of the plugin be shorter than one-line code?
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Shorter code doesn't mean it is good. You are relying on a third party tool while you don't need to. This is highly discouraged, because once the third party tool misbehaves or gets down, it will directly destroy your plugin. Meanwhile, you can achieve 100% success rate if you query directly. And I haven't counted the longer time to server -> API -> target -> API -> server instead of server ->target -> server yet.

    Also, it seems that you should be using AsyncTask for this.

    BTW, wasn't it you who asked?
    CraftYourBukkit likes this.
  10. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    If you only want the player count, consider using motd instead of ut3 query. To get the motd you only have to send 1 packet, for query you need to send 2 packets. This makes getting the motd twice as fast as normal querying.
    Andrey Nazarchuk and PEMapModder like this.
  11. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97

    Good idea, thanks
  12. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    @wies How do you get the motd of a different server?
    iiDeathStrokeii likes this.
  13. matthww
    Offline

    matthww Active Member

    Joined:
    May 13, 2014
    Posts:
    91
    Minecraft User:
    Matthww
    Can somebody make a plugin for this?
  14. matthww
    Offline

    matthww Active Member

    Joined:
    May 13, 2014
    Posts:
    91
    Minecraft User:
    Matthww
    Or make a tutorial on how to do this? (mysql or query)

Share This Page

Advertisement