VoteRestart
This plugin works for every bukkit version ever released, I just set the files to 1.7.2 to let server owners know it's compatible.
Have you ever wanted to enable your server uses to vote for a restart when the server lags? Yes, yes you have. You can't deny it. Stop lying to yourself. With VoteRestart, when a certain amount of players have voted (defined in config), the server automatically restarts. This allows server owners to have some peace; letting the users automatically restart the server if it becomes laggy.
Information
Within your config, you can define how many votes are needed for a server restart. In game, players can issues the command "/vr"; this allows them to vote for a restart. Once the votes hit a certain number (defined in the config), the server will automatically restart. NEW (Version 0.2 and above): Define an interval in seconds for how often this plugin should automatically reset the votes to zero. This stops the use of bots or other miscellaneous tools to attemp to restart your server just to cause harm.
Getting Started
To get started with VoteRestart, please download the latest file from the right. Once you have downloaded it, please put it into your plugin directory (server/plugins/). Now, run the server for the first time. Once the server has started, it will create the config with some default files . Navigate to your plugins directory, and select the VoteRestart folder. Within this folder, please open up the config.yml (server/plugins/VoteRestart/config.yml). Now you have done this, please edit the file to your liking. It should look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # +----------------------------------------------------+ # < VoteReload Config File (Version 0.1) > # < Created by Tayler King (MCMedia) > # < http://dev.bukkit.org/profiles/MCMedia/ > # +----------------------------------------------------+ # This is the amount of votes needed for a restart. # We suggest about 80% of your average daily users. vote: '1' # If the player does not have permission to vote, what # message would you like to be returnd to the player? PermissionMessage: '&cYou do not have permission to vote for a restart.' # If the player has already voted, what message # would you like to be returnd to the player? VotedMessage: '&cYou have already voted for a restart.' |
Once you have finished editing this file, please save and close it. But, ah ah ah! Don't do anything! Stay with us, it won't do any harm. Please navigate to the root location of your server. Within here, you should have a file named something along the lines of "start.(bat/sh)" or "run.(bat/sh)". Please open up this file; we need to do a bit of editing. If you are on windows, it is likely to end with .bat. If this file does, please replace the file contents with this:
1 2 3 4 5 6 7 | @echo off Title Bukkit (Implementing VoteReload) SET BINDIR=%~dp0 CD /D "%BINDIR%" :start java -Xmx3072M -Xms3072M -jar bukkit.jar goto start |
Once you have done this, please replace "java -Xmx3072M -Xms3072M -jar bukkit.jar" with the command that you use to start up your server normally.
If your server is a linux server, it is likely that the file ends in .sh. If so, please replace the file contents with this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "\$BINDIR" while true do java -Xmx3072M -Xms3072M -jar bukkit.jar echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!" echo "Rebooting in:" for i in 5 4 3 2 1 do echo "$i..." sleep 1 done echo "Rebooting now!" done |
Once you have done this, please replace "java -Xmx3072M -Xms3072M -jar bukkit.jar" with the command that you use to start up your server normally.
Commands And Permissions
| Permission | Syntax | Usage |
|---|---|---|
| VoteRestart.vote | /vr | Vote for a server reload |
| VoteRestart.count | /vc | Shows current votes and votes needed for server restart |
-
View User Profile
-
Send Message
Posted Aug 11, 2017Will this work with 1.7.10?
-
View User Profile
-
Send Message
Posted May 6, 2014Could you plz add a some config options?
- Percentage of online Players needed to restart. so if 2 players are online they can restart it, but if 20 are online 2 votes are not enogh? - Configurable messages for Shutdown, Vote Reset etc? - If the Votes are resetted, you also have to set the status of all players that they can vote again?
Maybe can you bring this in a Update?
Thx
-
View User Profile
-
Send Message
Posted Nov 30, 2013The permission is VoteRestart.vote
-
View User Profile
-
Send Message
Posted Nov 29, 2013@MinecraftDevin11 @Dukewes
Oh. I'm really sorry about that. I must've put the wrong permission. I'll look into it in a bit.
-
View User Profile
-
Send Message
Posted Nov 29, 2013Same... I manage a minecraft server and the plugin, with permissions given to all players, will not let them run /vr but /vc :\. I'd love to see this plugin being used on my server..
-
View User Profile
-
Send Message
Posted Nov 29, 2013Even with the permission players cannot run /vr on my server. They can run /vc though.
-
View User Profile
-
Send Message
Posted Nov 7, 2013@YanPerez
I believe it works for 1.2.5+ servers :)
-
View User Profile
-
Send Message
Posted Nov 6, 2013VoteRestart works for version 1.6.4? version 1.7.2 plugin :)?
-
View User Profile
-
Send Message
Posted Nov 6, 2013@EvilWitchdoctor
I suppose I could implement this ;) I am currently working on a big(ish) plugin with a fellow coder, I will see when I have time :)
-
View User Profile
-
Send Message
Posted Nov 6, 2013I really like how this plugin is turning out, in fact I am using it right now. however, I have 1 request... could you allow an option to have the server reset when a percentage of players votes to restart, instead of a number of players?
Example:
if(playerTotal / playerVoters > .80)
Also, can I ask if there is a setting to ignore AFK players? Because I know there are a lot of servers out there that have 3-4 afk players standing around at all times, who will not vote. Thanks for the work on this plugin ;)
-
View User Profile
-
Send Message
Posted Nov 5, 2013@andrewm1
If you go to the GETTING STARTEDpart of the page, there is an include of what you need to place in your bat/sh file for the terminal.
-
View User Profile
-
Send Message
Posted Nov 5, 2013I was wondering if you could make this to run a terminal window command seeing as I use a program called msm to run my 3 minecraft servers and it operates using the terminal window for restarts and if you need more information google it.
-
View User Profile
-
Send Message
Posted Nov 5, 2013@Brixishuge
Hi there. I added an option in the config that allows you to define an interval for when the server will automatically reset the votes to 0.
-
View User Profile
-
Send Message
Posted Nov 5, 2013I will add a feature so you can define a certain amount of minutes in the config that the server will reset votes to zero. Thanks for the feedback ;)
-
View User Profile
-
Send Message
Posted Nov 5, 2013This plugin has it's dark side, if, for example, VPS has low specs, and you have 20 server slots, so you put integer "vote: 10", some random people, can join server in middle of night, and constantly do restarts. Maybe you should implement cooldown which will stop shell script to be run constantly...
-
View User Profile
-
Send Message
Posted Nov 5, 2013@YanPerez
Thanks, waiting for the file to be accepted ;)
-
View User Profile
-
Send Message
Posted Nov 5, 2013Cool Plugin (y) :)