Shutdown Windows when nobody's playing

Discussion in 'Spigot Discussion' started by javier1734, Apr 1, 2020.

  1. Plugin category: Tools
    Minecraft version: 1.12.2

    Suggested name: WindowsShutDown

    What I want: I'd like to shut down Windows when nobody play in the minecraft server for 30 minutes for example. It could be an excelent plugin because we can safe money if we have a dedicated server and we don't want to be 24/7 looking for shutdown it :p


    Ideas for commands: /shutdown 30m (for example, this could be to start a countdown of 30 min when nobody is playing in the server

    Ideas for permissions: shutdown.windows (For execute the command /shutdown <time>)

    When I'd like it by: This week :D

    Thanks,
    Javier;)
     
  2. afaik, this isn't possible. Java Virtual Machines (what Minecraft servers/Minecraft clients run on) can't control the computer's activities.
     
  3. But they can run bat files, for example, a bat file that is: "shutdown.exe -s -t 0"
    No?
     
  4. Yeah, but what you seem to be planning is something that will be triggered upon stopping of the server everytime.
    The server can be stopped with plugins and a BukkitScheduler method, but as the server is stopped. It will always run that shutdown.exe batch file. Of course, you could always add some kind of input to ask if you want to stop the shutdown and if you want to press this key to continue, but you gotta add a delay for the shutdown if you plan to do this kind of thing.
     
  5. Can I make a Windows task that automatically shut down windows when the server stop?
     
  6. Strahan

    Benefactor

    Shutting the server down via the plugin is easy; how do you intend to turn it back on though? No task will suffice as the server is off. You'd have to have another box always turned on and listening for MC traffic then sending a WOL packet to the server. Then it would have to wait for the OS load then MC to load, and by that time the client has timed out. So you'd have to make a system that sends back a packet to the client to tell them we're starting the server, please try again in a few minutes.

    That sounds like a lot of headache to save yourself a few cents in electricity.
     
    • Agree Agree x 1