Server Status

Discussion in 'Plugin Development' started by nubebuster, Feb 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    nubebuster

    I am making a plugin that makes signs show if a server is up when someone right clicks it.
    How do I check if a server is up?
     
  2. nubebuster
    Ping the IP and see if you get a response.
     
  3. Offline

    nubebuster

  4. nubebuster
    Run a socket on a separate thread, and see if it gives any response. The target server is either lagging or not online, if the socket times out.
     
  5. Offline

    nubebuster

  6. Offline

    nubebuster

  7. Offline

    Milkywayz

  8. How about you do a bit of research instead of asking to be spoon fed with no attempts of your own whatsoever?
     
  9. Offline

    ImPhantom

    I would also recommend learning java from reading a book (if you can do that without help) or a video before you start making mods/plugins.
     
    badboysteee98 and Adamki11s like this.
  10. Offline

    nubebuster

    ImPhantom I know Java, I own a server with 4k unique players in 5 days and the only thing I am asking is how to ping a server in code.

    Exaplme:
    Code:
    public void PingServer(){
    }
    
     
  11. nubebuster
    The amount of players on your server has absolutely nothing to do with your Java knowledge.
     
  12. Offline

    Jake6177

    InetAddress net;
    net = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1});
    System.out.println(net.isReachable(5000) ? "reachable" : "not reachable");
     
  13. Offline

    ImPhantom

    • This is unacceptable, there are more constructive and less abrasive ways to say this.

    nubebuster
    Whoaa!! How cool are you? You can make a BASIC method.... A fucking 7 year old could do that.
     
    Benlewis9000 and badboysteee98 like this.
  14. Offline

    badboysteee98

    Benlewis9000 likes this.
  15. Offline

    CoderRyan

    ImPhantom don't be rude lol. everyone starts off somewhere lol.
     
  16. Offline

    xTrollxDudex

    nubebuster
    Try catch new Socket for IP and port. Seriously, find oracle docs, this should be solved already had you taken the single second to load that page.
     
  17. Offline

    Jake6177

    Actually if you wanna go there, since you capitalized "BASIC" you referred to the BASIC programming language. No, he didn't make a BASIC method, he made a basic Java method. :) Being rude isn't cool, bro.
     
    LCastr0 and Konkz like this.
  18. Offline

    Konkz

    [​IMG]
     
    itzrobotix likes this.
  19. Offline

    ImPhantom


    Jake6177
    You make a really good point. Ill keep that in mind. Haha
     
  20. Offline

    nubebuster

  21. Offline

    xTrollxDudex

    nubebuster
    Google it,
    PHP:
       InetAddress address InetAddress.getByName("address");
      if (
    address.isReachable(3000)) {
        return 
    true;
      }
      return 
    false;
     
  22. Offline

    Barinade

    Code:
        public static boolean isListening(String ip, int port) {
            Socket s;
            try {
                s = new Socket(ip, port);
                return true;
            } catch (Exception e) {
                return false;
            }
        }
    We were all at his level at one point, stop being dicks.
     
  23. Thats from netty ^

    Use the onServerPingEvent
     
  24. You put the ip and port of the server and use some other things
     
  25. Offline

    Barinade

    It's ServerListPingEvent and it triggers when the server is pinged. OP is trying to ping another server, I've given him the code, further posted is rather irrelevant.
     
  26. Offline

    ShadowWizardMC

Thread Status:
Not open for further replies.

Share This Page