在非开放时间登录的玩家会收到一条清晰的消息,告知服务器开放时间并拒绝其访问。
在关闭时间已登录的玩家会收到警告,告知服务器即将关闭,并在关闭时间与玩家断开连接,同时显示解释该情况的提示。
- 开放时间可在配置文件中指定。
- 所有消息均可在配置文件中设置和进行本地化。

安装方法
按照常规操作:将 OpeningHours.jar 放入 plugins 目录即可。
命令
/openinghours 显示每周各天的开放时间。
权限
权限 'openinghours.ignore' 允许用户在非开放时间(及开放时间内)登录。
权限 'openinghours.openinghours' 允许用户执行 /openinghours 命令以查看每周各天的开放时间。
配置
插件通过 plugins/OpeningHours/config.yml 文件进行配置。插件首次运行时会自动生成一个示例配置文件。
示例 config.yml:
#时间使用双引号括起,支持 24 小时制或 12 小时制。
#时间中的空格会被忽略,因此可以在下方的消息中为美观而添加空格。
#例如 '06:00'、'06:00 AM'、'06:00AM'、'14:00'、'02:00 PM'、'02:00PM'
serverOpeningTime: '09:00'
serverClosingTime: '19:00'
#覆盖上述的开放时间,针对下方提及的日期和时间(所有星期几均使用小写识别):
- friday
:
- serverClosingTime: '23:00'
- saturday
:
- serverOpeningTime: '01:00'
serverClosingTime: '23:00'
- sunday
:
- serverOpeningTime: '01:00'
#显示消息:在服务器关闭前多少秒发出警告:
warnSecondsBeforeClose: 60
#指定(用逗号分隔)哪些玩家可以在非开放时间登录
#注意权限 "openinghours.ignore" 也能实现相同功能
ignoreFor: tarzan, jane, douglas
#消息中可使用参数 %serverOpeningTime%、%serverClosingTime%、
#%warnSecondsBeforeClose% 以及 "\n" 表示换行。
- messages
:
- serverClosed: 'This server is currently closed.\n\nOpening hours from %serverOpeningTime% to %serverClosingTime%.'
warnBeforeClose: 'This server closes in %warnSecondsBeforeClose% seconds.'
kickPlayer: 'Everybody is kicked because this server is currently closed.\n\nOpening hours from %serverOpeningTime% to %serverClosingTime%.'
errorOpenNotAfterClose: 'Opening time should be before closing time. Plugin disabled.'
OpeningHours Logo by WishesXD
Any player logging in outside of opening hours gets a clear message stating the opening hours and is denied access.
Players logged in at closing time get a warning that the server will close down beforehand and are
disconnected from the server at closing time with a message explaining this.
- The opening hours are specified in the configuration file.
- All messages can be set and localized in the configuration file.

Installation
As usual: put the OpeningHours.jar in the plugins directory.
Command
/openinghours displays opening hours per weekday.
Permissions
permission 'openinghours.ignore' allows a user to login outside (and inside) of opening hours.
permission 'openinghours.openinghours' allows a user execute the /openinghours command to display opening hours per weekday.
Configuration
The plugin is configured via the file plugins/OpeningHours/config.yml. The first time the plugin runs it creates an example configuration file.
Example config.yml:
#Times are specified between quotes in 24 or 12 hours format.
#Spaces are ignored in times, so spaces can be added for aesthetics when used in the messages below.
#e.g. '06:00', '06:00 AM', '06:00AM', '14:00', '02:00 PM', '02:00PM'
serverOpeningTime: '09:00'
serverClosingTime: '19:00'
#override the opening times above for the days & times mentioned below (all weekdays -lower-case- are recognized):
- friday
:
- serverClosingTime: '23:00'
- saturday
:
- serverOpeningTime: '01:00'
serverClosingTime: '23:00'
- sunday
:
- serverOpeningTime: '01:00'
#Show messages:warnBeforeClose this many seconds before serverClosingTime:
warnSecondsBeforeClose: 60
#specify (comma separated) the players who should be able to login outside of opening hours
#note that permission "openinghours.ignore" does the same
ignoreFor: tarzan, jane, douglas
#messages can use parameters %serverOpeningTime%, %serverClosingTime%,
#%warnSecondsBeforeClose% and "\n" for a line feed.
- messages
:
- serverClosed: 'This server is currently closed.\n\nOpening hours from %serverOpeningTime% to %serverClosingTime%.'
warnBeforeClose: 'This server closes in %warnSecondsBeforeClose% seconds.'
kickPlayer: 'Everybody is kicked because this server is currently closed.\n\nOpening hours from %serverOpeningTime% to %serverClosingTime%.'
errorOpenNotAfterClose: 'Opening time should be before closing time. Plugin disabled.'
OpeningHours Logo by WishesXD
评论 0
登录后参与评分
还没有评论,来抢沙发吧