Shutdown server

Discussion in 'Plugin Development' started by Forseth11, Sep 15, 2013.

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

    Forseth11

    Hello, I host a server with beastnode and I made a plugin to kick players with a kick message then shutdown the server. I dispatched command: 'stop', but every time it stops it immediately starts back up.

    How do I stop it from starting back up.

    I have this code I am going to try. Will it work:
    Code:java
    1. this.logger.info("Shutdown in progress.");
    2.  
    3. this.plugin.getServer().savePlayers();
    4. Server server = this.plugin.getServer();
    5.  
    6. server.savePlayers();
    7.  
    8. for (World world : server.getWorlds()) {
    9. world.save();
    10. server.unloadWorld(world, true);
    11. }
    12.  
    13. server.shutdown();


    I tested that code and it did not work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  2. Hmmmmmm try System.exit();
     
  3. Offline

    Forseth11


  4. It could be that the serverbox that the server is running on has a program that makes it start right back up contact your hosting provider
     
  5. Offline

    Forseth11

    vxwkillerjthewalrus A person from beastnode said that it is thinking it is a crash and starts again.
    How do I make it not look like a crash.

    Oh if the user on beastnode is the owner they can type: builtin:stop
    but if I dispatch that command it says it is unknown.
     
  6. You could ask them too disable that feature on your server

    Cause there seems too be no way too get around it
     
  7. Offline

    callum.thepro

    Dont dispatch the command, just output it to the console in a way so it is interpreted. (p.s, I don't know how to do this)
     
  8. Offline

    Datdenkikniet

    getServer().shutDown()?
     
  9. Offline

    ferrybig

    he is already using that code inside the main post, the reason it failed was because his hosting provider thinks the server shutdown is a crash, and start it directly after it has shutdown
     
  10. Offline

    Datdenkikniet

  11. Offline

    Hoolean Retired Staff

    Forseth11

    Ask BeastNode how to bypass it with a plugin :)
     
Thread Status:
Not open for further replies.

Share This Page