Is onDisable() called when a bukkit server crashes?

Discussion in 'Plugin Development' started by NextInLine, Sep 16, 2013.

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

    NextInLine

    Really simple question, is the method
    public void onDisable(){
    }
    called when the server crashes? Or is their a way to detect when a server crashes, and run a method before it closes?
     
  2. Offline

    harbo5

    onDisable is called when the server is stopped. When the server crashes, it stops working.
     
  3. Offline

    NextInLine

    Then what would be the best(or only way) to detect with a method when a server does crash?
     
  4. harbo5
    onDisable() is called when the plugin gets disabled, which can be caused by a server stop, reload or another plugin disabling it.

    NextInLine
    You could try running a socket every so often, and check if the server responds. If it times out, then the server is offline or lagging.
     
  5. Offline

    xTrollxDudex

    Assist
    It should be external because when a server crashes plugins stop working. You can also send a signal every so often to an external source, and if the source does not receive anything, the server is lagged out or stopped/crashed. No way to tell the difference though.
     
  6. Yeah, I forgot to mention that. :rolleyes:
     
  7. Offline

    NextInLine

    The goal is to create an automatic way to do this, because I would have to ping a few (thousand) servers every 5 minutes..... I mean I could do it that way, but I thought there could be a better way.
     
  8. Offline

    uyuyuy99

    NextInLine Er... do you own a few thousand servers?
     
  9. Offline

    Shevchik

    No they don't, only things related to sync events and schedulers stops working.
    Manually created threads will still work.
     
  10. Offline

    NextInLine

    Potentially thousands of servers* As this wouldn't be custom... its for a project.
    ;)

    Seems like an external program is the way to do it, solved.
     
  11. Write a application that ping the server. through a loop, then send some information to the rest of runningserver. And they will inform the admin/ops/ users with the permission.
     
Thread Status:
Not open for further replies.

Share This Page