Change server on server shutdown.

Discussion in 'BungeeCord Plugin Development' started by bloodsplat, Feb 24, 2013.

  1. I'm trying to work out a way to move players to a different server when the server they are currently on shuts down.

    using an onDisable() function doesn't work as you cant send a plugin message and using a shutdown hook doesn't seem to work either.

    Anyone got any ideas on how we can achieve this?
     
  2. I think the best way would be to do this with a BungeeCord plugin, but we are missing the necessary API (something like ServerDisconnectEvent). Created an issue https://github.com/ElasticPortalSuite/BungeeCord/iss
     
    • Agree Agree x 1
  3. Yes an event like that would do wonders thanks for ticketing
     
  4. Well, to normally shut down a server, you have to use the stop command. So you could use a PlayerCommandPreprocessEvent, check for the stop command and then send the plugin message for all players to move them to another server. Although I'm not 100% sure if commands executed via the console call that event.
     
    #4 confuser, Feb 24, 2013
    Last edited: Feb 24, 2013