How to stop/restart server when event happens?

Discussion in 'Plugin Development' started by StarRocket, Feb 4, 2016.

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

    StarRocket

    I have been developing a UHC plugin and I am going to have a lobby on one server and joinable servers running the plugin. When one game ends (a player wins the game), how do I get the server to stop and then restart so that players can join and a new game would start?
     
  2. Offline

    mythbusterma

    @StarRocket

    Why does the server have to stop and start again? That doesn't make any sense. Also, if you're using Bungee, we don't support that here.
     
  3. Just make the plugin do /stop :D
    Code:
    getSever().dispatchCommand(getServer().getConsoleSender, "command goes here");
    
     
  4. That would work for stopping, but how would the restart work?
     
  5. A restart script. Quicke google search ;)
     
  6. Offline

    mcdorli

    You aren't allowed to stop a server. It's against the bukkitdev rules.
     
  7. Oh ok. :)
     
  8. Offline

    Edvio

    Make this your start.sh instead:
    :begin

    "c:\Program Files\Java\jre7\bin\java.exe" -Xms128M -Xmx2048M -jar craftbukkit.jar

    goto begin

    Then you can just make the console run the command "restart" :)
     
  9. Offline

    StarRocket

    @mythbusterma Read up on how to operate a network of servers, originally did not know that bungee was essentially the only way to make that happen. Considering using multiple worlds. The plugin generates a new world each time the plugin is enabled, therefore making the server restart essential to allowing the game to work again. Will try out the different methods everyone suggested here, thanks
     
  10. Where does it say that Bukkit doesn't support Bungee here? No mods have moved it or locked it for any reason.
     
  11. Offline

    Xerox262

    @_zircon_ Read the forum rules. https://bukkit.org/help/terms Number 8.

    The only way for a server to be Bungee compatible is if it's in offline mode, therefore Bungee is a gateway for offline mode and Bukkit does not support offline mode.

    @StarRocket There's no reason you need to restart the server though, you could just move all players out of that world then delete it and regenerate it.
     
  12. Thanks, I've never worked with Bungee so I didn't know that :)
     
  13. Offline

    StarRocket

    @Xerox262 That is a good idea. Will try it out
     
  14. Offline

    Konato_K

    I'm pretty sure is not, I've seen plugins in dev bukkit that restart the server, to my knowledge there is no problem with what a plugin does as long as the plugin specifies it does that.
     
Thread Status:
Not open for further replies.

Share This Page