Plugin category: Admin/Fix Suggested name: Server Hibernation What I want: If server is inactive for X amount of time, it will go to "Sleep" or "Inactive" till someone joins which makes the server to "Wake up". Ideas for commands: Might be a good idea for like a config reload plugin. Like /sh reload or /serhib reload. Ideas for permissions: Serhib.reload When I'd like it by: Don't really have a time limit, but if possible by next week.
If its home run, it will stop using all your ram and CPU. And it will stop the console getting clogged up with all the things that run every 5 mins
Somehow I think it's unrealistic. I'm not sure how Bukkit (or Minecraft server) works in depth, but I doubt a plugin can better manage what it does when there aren't users online.
ohtwo Mitch_ It is very possible to stop the cpu usage, Ram usage, not so much. hikeno19 http://mc-sg.org/plugins/ServerHibernate/releases/ServerHibernate.jar Just note that when no one is online, it's going to respond badly to pings, and it might take just a bit for the first person to login. It probably wont even be noticeable however. with my test the server ran at 0% cpu usage with no one online. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code: package org.mcsg.double0negative.serverhibernate; import org.bukkit.Bukkit; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; public class ServerHibernate extends JavaPlugin implements Listener{ public void onEnable(){ Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){ public void run(){ if(Bukkit.getOnlinePlayers().length == 0) { try{Thread.sleep(1000);}catch(Exception e){} } } }, 200, 1); } }