SmartRestart
SmartRestart
The amount of memory remaining before an automatic restart occurs can be customized. You can also configure the number of seconds between checking the amount of memory, as well as the messages displayed before and after the restart.
Official Website: MC.Candy-Sky.Net
The Current Features
- Adjust the amount of memory before an automatic restart
- Configure the amount of seconds between checking the server's memory
- Customize the text to display before the restart occurs
- Customize the text to display after the restart
Commands and Permissions
Permissions is "smartrestart.sr"
- /sr
- Display the free memory ,least free memory and check interval.
- /sr reload
- Reloadd the config.
- /sr restart
- Forced to restart the server.
Example the Config
# Designing by Taiwanese from Candy-sky.net # Check the time in seconds interval check-mem-time: 5 # Restart at least how much memory? free-mem: 100 # Restart messages closeinga-message: "Server out of memory! Restarting to ensure server stability. Do not shut down the server manually." closeingb-message: "Server shutting down in 10 seconds, log out now!" # message to display to kicked players restart-message: "Please wait 30 seconds before logging in to ensure system stability"
Example the Command start.bat for Windows
@ECHO OFF :restart echo run server now , you can't close java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo Restart after 5 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 4 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 3 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 2 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 1 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul goto restart
Example the Shell Script start.sh for Linux
#!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" while : ; do echo "run server now , you can't close" java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done
Example the Shell Script start.sh for MAC
Theoretical writing Not been tested
#!/bin/bash cd "$( dirname "$0" )" while : ; do echo "run server now , you can't close" java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done
Changelog
- Version 0.4:
- Optimize detection and restart the code again.
- Fix "/sr reload" check interval constant error
- Version 0.3:
- Optimize detection and restart the code.
- Add "/sr" command to display the free memory ,least free memory and check interval.
- Add "/sr reload" to reloadd the config.
- Add "/sr restart" forced to restart the server.
- Version 0.2:
- Correct English syntax errors
- Automatically restart automatically displays the remaining memory to facilitate record
- Version 0.1:
- Initial release
@nic991004
預設的訊息就是中文的
請安心服用
source cide?
太棒了,這有中文,但是中文版怎麼下載? P.S我是台灣人!!!
WOW CHINESE!!
@cxh012
0.3版加入了~
@joshwenke
Unix is okay
write loop in shell
can use
Unix可以支援,
只要寫迴圈在shell內,
就可以使用。
Unix support?
So does this work with dedicated servers? Or just for servers mainly on a localhosted computer?
1.3.1?
建议加入reload及OP手动重启命令
Does it work on r4? And is the amount of memory in the config file based off on what the machine has left or the amount left based what I put in the Run.bat file? Because I have 16gb ram on my computer but only set the Run.bat to max at 6gb.
Works on R4? :D
:/
Nice plugin, you should allow us to run some commands before server shut down
stuff like
/ma force end
/say Server restarting!
etc
Here is a better translation coming from an asian native Canadian speaker (That studied chinese in HK): To users that are playing, why poke out the shortage of your own server?
Maybe on your next update, support Essentials Color so that you may display colored warning message to attract players eye.
All in all, good work.
@Zefram 例如看到什麼訊息?
@Ne0nx3r0 thank you~
@Lakesideminecraft up to R3.0
I rewrote your English translation:
請問能不能設計成 看到某段訊息 就關掉伺服器重開?
最近伺服器一直遭到ddos攻擊非常無言......
Can you update to R1.0?
@l4pierce
I've been introduced to modify
我已經把介紹修改好了,
"我无法作出最后那句话的意义,对不起", I do not understand ...
但是"我无法作出最后那句话的意义,对不起"我看不懂...
You can say that English is enough
你可以說英文就好