Solved Pinging a server to check if it is online

Discussion in 'Spigot Plugin Development' started by Flyin, Jan 31, 2016.

  1. I have been working on a custom /server command but have hit a wall. I need to get a list of all the servers registered to bungee then get a list of the online ones. I have looked through the docs but have not been able to get anything to work. If anyone knows how I could get this info, sharing it would be much appreciated.

    EDIT: Still looking for help.

    Thanks in advance,
    ~ Flyin
     
    #1 Flyin, Jan 31, 2016
    Last edited: Jan 31, 2016
  2. Use this to get the servers. As for getting the online ones.. you'll probably have to ping each server yourself and cache it somewhere or something like that.
     
    • Agree Agree x 1
  3. Inkzzz

    Resource Staff

    Use sockets to check if a server is online. You'll have to use the servers IP address, along with the port.
     
    • Agree Agree x 1
  4. Or McAPI
     
  5. Thanks everyone for the help! I ended up going with sockets.

    EDIT: Solved