[INACTIVE][ADMN] AutoStop v0.53 - Time-Based Server Shutdowns and Restarts [531]

Discussion in 'Inactive/Unsupported Plugins' started by dv90, Mar 6, 2011.

  1. Offline

    dv90

    Server AutoStop
    Time-Based Scheduled Server Shutdowns and Restarts
    I no longer support this plugin as I don't have the time. Sorry. Plugin devs. can edit the source and release it as they want. The current version is somewhat functional on some systems but not others.

    Version: v0.53
    Source: v0.53
    Requirements: Permissions v2.0/2.5+ (Optional)

    A simple plugin that saves player and chunk data then shuts the server down at a specified time.

    The plugin will automatically put AutoRestart.jar in your bukkit directory.
    Don't run it; it won't do anything.
    Do not delete or move it.
    If your server doesn't auto restart, post your restart_log.txt here.
    If there is no restart_log.txt, you're doing it wrong.
    If you use a .bat file (server_nogui.bat), set your path to: path=start server_nogui.bat

    NOTE TO ANYBODY USING AN EXTERNAL SERVER:
    Remember, your server's timezone may be different. Take that into account when setting up your autostop.properties.

    Features:
    • Saves Player Data
    • Saves Chunk Data
    • Gives a custom warning at specified time before shutting down
    • Quickly shuts server down
    • Uses autostop.properties to specify what time (24-hour clock) it should shutdown at
    • Automatically creates the properties file if it doesn't exist
    • Automatically restarts server (if you enable it)
    • Multiple restart times
    Changelog (open)

    Version 0.53 (Current)
    • Fixed a few small bugs
    • Kicks all players before shutting down
    • Updated to latest RB
    Version 0.52
    • Supports multiple warn times now
    • Other small fixes
    Version 0.51
    • Fixed a small problem with the syntax of the auto-generated autostop.properties file.
    Version 0.5
    • Multiple stop/restart times
    • Added better support for Windows cmd users
    Version 0.4
    • /reboot and /restart commands
    • Permissions support for commands
    Version 0.3
    • Automatic server restarts
    • Stop/Warn time precision works with seconds now
    Version 0.2
    • Added configurable warning message and warning time
    • Attempted automatic restarts but had no luck; possible in a future release
    Version 0.1
    • Release

    FAQs (open)

    Don't use permissions? Just OP yourself.

    What is the permission? autostop.use


    Commands:
    • /reboot - Immediately saves data and restarts the server.
    • /restart - Same as reboot.
    Properties Example:
    Code:
    stoptime=12:00:00 12:05:00 12:10:00
    # Use 24-hour time. Separate times with a space. [Hour:Minute:Second]
    warntime=0:10 0:30 1:00 5:00 15:00
    # Displays warning this many min:sec before shutting down. Separate with space. [Minutes:Seconds]
    warnmsg=Shutting down...
    # Warning message to display.
    enablerestart=true
    # Enables automatic server restarts. If this is true, path must not be blank.
    path=java -jar craftbukkit.jar
    # Path to server file (including any arguments). This can also be a command if you are using crontab/screen/etc.
    # Linux screen example:
    # path=screen -dmS MinecraftServer java -jar craftbukkit.jar
    
    Suggestions and feedback appreciated! :)
     
  2. Offline

    Joseph

    Man... you are epic!
     
  3. Offline

    dv90

    Thanks :p
     
    Joseph likes this.
  4. Offline

    Sir Savary

    If only it turned it back on again :S
     
  5. Offline

    crohakon

    but... does it restart on its own...?
     
  6. Offline

    Spazmic

    If you could make it restart that would be amazing, with a 5 minutes before restart warning, that would be awesome.
     
  7. Offline

    Manbeast77

    Not to sound overly obtuse but, why would you need a warning that the server was going to turn back on? the server would already be down, and players wouldn't see the server is going to start back up warning. Now if you're talking about a pure stop then start again, yes I could see that. From what I understand though from friends working on the same thing, you would need a separate program that hooks into the MC console from the outside, or remotely, in order to restart a server without physically telling it to.
     
  8. Offline

    Thomas Carlsen

    I have this plugin request and its totally this thing.. thx.
    but i would like a feature like in my request where I can write the broadcast msg to display before shutdown and how many mins before :)
    take a look on my request and thx for this plugin :)
     
  9. Offline

    Fishergijoey

    Thanks dude this will really help with my server :D
    YOUR EPIC!
     
  10. Offline

    darkwarriors

    yes very good if u can add an automatical restart so i can delete it from crontab!
     
  11. Offline

    dv90

    I have been thinking about adding a warningtime variable to the autostop.properties file so that it will warn the users x number of minutes before the shutdown. Adding a custom message was an initial idea, I was just too lazy at the time. :p

    I can implement server restarts, however, the only way would be to add a variable in the properties file that specifies the path to your server jar followed by arguments (if you use any).

    Thanks to everybody for the feedback. I'll work on it for a couple hours and release an update tonight.

    EDIT:

    Well, after struggling for hours with numerous problems. I gave up on a some stuff and decided to just release what I had. Automatic restarts have been postponed because every different way I tried fail, miserably. Check the changelog for what's new in this release.
     
  12. Offline

    jessenic

    I think you would need a separate jar that starts craftbukkit.jar for autorestart
     
  13. Offline

    Phaedrus

    some clever scripting around your launch command in your batch file could simply relaunch the server once it closes. maybe i'll look into that when I get home.

    a quick a dirty way you could make it work is to simply add another line after your launch argument that calls another identical batch file that also launches the server, and then just calls the original batch file again once its server instance closes.

    Example:
    Code:
    Batch file 1:
    java -jar craftbukkit.jar
    start batchfile 2
    
    Batch file 2:
    java -jar craftbukkit.jar
    start batchfile 1
    
    Once the server is shut down by this plugin and closes, the batch file proceeds to the next line, which tells it to start batchfile 2 and then close. Batch file 2 then starts the server up again and runs until this plugin turns it off again, which advances the batch file to launch batch file 1 again. Rinse, repeat. Bobs your unkle.

    I'll have to actually test it out and if it works i'll post the working files.
     
    Spazmic likes this.
  14. Offline

    dv90

    Tried this. Problem is, the restart.jar file was in plugins/autostop/restart.jar. When you run it, bukkit would think you're starting it from this directory causing it to create new properties/world/etc data in that directory. Technically this could be fixed with some command line arguments but it was too complicated. I might just put the restart.jar in the same directory as the bukkit.jar though.

    As for the batch file idea. I'm trying to stay away from that since a lot of servers are run on linux, therefore, I would have to detect the operating system then run the corresponding file (sh/bat) which adds more steps.


    I'll work on it more tonight and hopefully get automatic restarts working. If so, I'll post an update. Anyways, thanks for the feedback.
     
  15. Offline

    Phaedrus

    I just meant it as a work around for the end user not something you should necessarily implement.

    Have you considered just using a wrapper?
     
  16. Offline

    dv90

    I'm assuming you mean around the entire bukkit jar, and no I haven't. I'm not too sure how I would go about doing that, since it would still require a plugin to send the warning message and force save the chunks. Unless the wrapper automatically typed the command into the console. I don't think a wrapper is the way to go, but I will consider it.

    EDIT:

    Automatic restart is working but not very practical on windows servers. Without making a wrapper around the whole server, the plugin cannot "get back into" the console once it is restarted. So if you are running this on windows, it will terminate the server/console, then restart it. The problem is, because you won't have access to the console after that, you can't type reload after editing the autostop.properties file if you want to change the time. This isn't a problem if you use the same time over and over though.

    On linux servers this isn't really a problem. If you use screen to run the server, you can specify the path in autostop.properties to be your screen command and it will restart into a new screen, which you can then use something like: screen -x nameOfScreen, to get into the console.

    I'll think about making a wrapper, but I doubt I will. Unless there's some sort of screen utility for windows, or some way of getting into a java process's console, windows is kind of at a disadvantage here.

    Lastly, an important note:
    If your server does not restart automatically, check the restart_log.txt file in your main bukkit directory. If it doesn't exit or it's blank, your path/command syntax is incorrect. If there is an error and you don't understand it, just post it here and I'll help you out.

    EDIT 2:

    Implemented /reboot and /restart commands (they do the same thing). They immediately restart the server after saving data. It supports Permissions v2.0+ (tested against 2 and 2.5.3). If you don't use Permissions, just op yourself and they will work.
     
  17. Offline

    gnftoxic

    Badass, bro. Gonna use this on my servers soon :)
     
  18. Offline

    alexjj

    Can you add multiple restart times? and if so what's the syntax.

    Looks nice, will install it when I'm at home.
     
  19. Offline

    darkwarriors

    Code:
    2011-03-10 12:09:43 [SEVERE] Could not load plugins/ServerAutoStop.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:65)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:58)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.util.zip.ZipException: error in opening zip file
            at java.util.zip.ZipFile.open(Native Method)
            at java.util.zip.ZipFile.<init>(ZipFile.java:114)
            at java.util.jar.JarFile.<init>(JarFile.java:135)
            at java.util.jar.JarFile.<init>(JarFile.java:99)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:52)
            ... 8 more
    
    maybe not ocrrect download?
     
  20. Offline

    dv90

    No not yet. After it restarts, it will restart at the same time again the next day.

    Wow, that's weird. I can't recreate that error. Did you try redownloading it? I changed the download link, so try again.
     
  21. Offline

    Mr_Fj

    Where can I download the 493 version? :(
     
  22. Offline

    darkwarriors

    Code:
    2011-03-10 16:30:00 [INFO] [AutoStop] Shutting down server.
    2011-03-10 16:30:00 [SEVERE] Exception in thread "Thread-17"
    2011-03-10 16:30:00 [SEVERE] java.lang.NoSuchMethodError: org.bukkit.Server.savePlayers()V
    2011-03-10 16:30:00 [SEVERE]    at net.hailxenu.serverautostop.AutoStopLoop.run(AutoStopPlugin.java:232)
    2011-03-10 16:30:00 [SEVERE]    at java.lang.Thread.run(Thread.java:619)
    
     
  23. Offline

    BioRage

    Would this work on VPS servers?

    The Restart part, not sure how you'd specify a path.
     
  24. Offline

    dv90

    Windows or Linux? Just put "path=java -jar [pathtobukkit.jar]"

    What version of bukkit are you running? Probably not supported.

    Not sure if all the features are possible in 493. I'll try to port it but can't promise anything.
     
  25. Offline

    gnftoxic

    "It's broke! how2fix?"
     
  26. Offline

    Steven

    Code:
    2011-03-10 15:25:00 [SEVERE] Exception in thread "Thread-5"
    2011-03-10 15:25:00 [SEVERE] java.lang.NoSuchMethodError: org.bukkit.Server.savePlayers()V
    2011-03-10 15:25:00 [SEVERE]     at net.hailxenu.serverautostop.AutoStopLoop.run(AutoStopPlugin.java:232)
    2011-03-10 15:25:00 [SEVERE]     at java.lang.Thread.run(Thread.java:662)
    
    how do we fix this error? I am running build 440.
     
  27. Offline

    M1sT3rM4n

    Why are you running build 440 when the latest recommended CB version is 531? Most of the plugins are updated to the latest stable CB.
     
  28. Offline

    darkwarriors

    my stable version git-Bukkit-0.0.0-458-g557f3d2-b440jnks
     
  29. Offline

    Ape3000

    Can you make it able to restart the server twice a day?
     
  30. Offline

    dv90

    440 is not supported, as stated in the thread title. It's also not possible to port this for lower builds. Sorry :/

    I will be adding multiple restarts soon.

    Thanks. :)
     

Share This Page