Restarter 插件会在可配置的时间间隔后自动重启服务器。它是解决某些服务器在长时间运行后出现稳定性问题的一种快速修复方案,能让新安装的插件和你设置的配置生效,并清除那些处于空闲状态(AFK)的玩家。
安装
将 Restarter.jar 文件放入 plugins/ 目录。首次运行后,会生成一个包含默认值的 Restarter/config.yml 文件。
请注意,Restarter 实际上只是停止服务器,它不负责再次启动服务器;请参考 examples/ 目录中的示例脚本,这些脚本可以在服务器停止后自动将其重新启动。
配置
minutesToRestart 值表示两次重启之间服务器运行的分钟数。
variance 值允许你设置两次重启时间间隔的最大波动范围。服务器的实际运行时间将在 [minutesToRestart-variance, minutesToRestart+variance] 范围内。例如,如果 minutesToRestart 为 90,variance 为 10,那么服务器将在重启前运行 80 到 100 分钟之间的任意时长。如果你将 variance 设置为 0,那么服务器将在恰好经过 minutesToRestart 分钟后重启。
warn 值表示在重启前多少分钟显示 warnMessage。默认为 1。
warnMessage 字符串是在重启前可配置的提前时间内向所有用户显示的提示信息。
kickMessage 字符串是当用户因重启被自动踢出服务器时向他们显示的消息。
命令
/rsquery
查询距离下次计划重启还有多长时间。需要 "restarter.query" 权限。
/rsset
设置距离下次重启的分钟数。此值不会保存到配置文件中。传入零或负数将立即执行重启。需要 "restarter.set" 权限。
源码
源代码托管于 。
The Restarter plugin automatically restarts the server after a configurable
amount of time. It works as a quick fix for any stability problems some servers
have when running for a long time, lets new plugins and configuration settings you've set take
effect, and clears out those AFK players.
Installing
Place the Restarter.jar file in the plugins/ directory. After the
first run, a Restarter/config.yml file will be generated with default
values.
Note that Restarter actually only stops the server. It does not handle
starting the server up again; refer to the examples/ directory for
example scripts that automatically bring the server up again after it
stops.
Configuration
The minutesToRestart value is how long in minutes the server will run
between restarts.
The variance value lets you set a maximum amount for the time between
to restart to vary. The server will run for an amount of time in the
range [minutesToRestart-variance, minutesToRestart+variance]. For
example, if minutesToRestart is 90 and variance is 10, then the server
will run for an amount of time between 80 and 100 minutes before
restarting. If you set variance to 0, then the server will always
restart after exactly minutesToRestart minutes.
The warn value is how many minutes before the restart to show the
warnMessage. Defaults to 1.
The warnMessage string is the message displayed to all users a
configurable amount of time before the restart.
The kickMessage string is the message shown to all users when they're
auto-kicked off of the server for the restart.
Commands
/rsquery
Queries how long until the next scheduled restart from now. Requires the "restarter.query" permission.
/rsset
Sets the amount of time in minutes until the next restart. This value is not saved to the configuration file. Giving zero or a negative number will do an immediate restart. Requires the "restarter.set" permission.
Source
The source is hosted at .
评论 0
登录后参与评分
还没有评论,来抢沙发吧