PublicPlaytime
PublicPlaytime 是一个插件,可让你轻松查看曾在你的服务器上玩过的每位玩家的游玩时间。PublicPlaytime 使用 Bukkit* 的标准统计数据(Statistic)来查询在线玩家的游玩时间,并使用一个数据库来保存所有离线玩家的时长。所显示的游玩时间即为特定玩家在你的服务器上的登录时长。它应当与原版 Minecraft 中通过统计菜单可查看的统计数据一致。这也意味着,当你切换服务器的主世界时,游玩时间将会被重置。 为防止这种情况发生,请使用下文介绍的备份功能。
*任何 Bukkit 的分支版本均可使用(例如 Spigot、Paper 等)。
命令
PublicPlaytime 具有多种功能。所有命令均可在游戏中通过 /playtime help 查看,别名也可在此处找到。
- /playtime get <player> <outputMode>
- 以指定格式获取该特定玩家的游玩时间
- <outputMode> - days, hours, minutes, seconds, ticks, standard
- standard 将以 DD:HH:MM:SS 格式输出游玩时间。
执行时的输出: /playtime get LifelessNerd standard
- /playtime ranking <outputMode> <maxAmount>
- 以标准格式在聊天栏中输出游玩时间的排行榜。
- <maxAmount> - 任意整数
- 排行榜将显示的排名数量。例如 5 将显示前 5 名玩家。
- <outputMode> - days, hours, minutes, seconds, ticks, standard
- standard 将以 DD:HH:MM:SS 格式输出游玩时间。
执行时的输出: /playtime ranking standard 10
- /playtime scoreboard <show/hide> <outputMode> <maxAmount>
- 显示或隐藏游玩时间最高的玩家的记分板。
- <show/hide> 'show' 或 'hide'
- <maxAmount> - 任意整数
- 排行榜将显示的排名数量。例如 5 将显示前 5 名玩家。
- <outputMode> - days, hours, minutes, seconds, ticks
- 此处不允许使用 standard,因为它无法适配记分板显示。
注意:此命令在配置文件中有一些选项,用于控制是否刷新记分板以及刷新的间隔。请参阅“文件”部分。
执行时的输出: /playtime scoreboard show minutes 10
-
/playtime help
-
/playtime about
-
/playtime backup
- 将当前的游玩时间保存到文件中。这将覆盖之前的备份。
-
/playtime load
- 从备份文件中加载游玩时间,并将所有玩家的游玩时间设置为与备份一致的值。这将覆盖旧的游玩时间。此功能在转移主世界时非常有用,因为转移主世界会重置游玩时间。若要保留游玩时间,请在旧世界中备份旧的游玩时间,切换世界后,再将其加载。
文件
首次启动该插件时,会创建两个 YAML 文件:配置文件(config)和数据库文件(database)。配置文件包含供你编辑的插件选项。其中有两个设置可以更改:是否允许记分板刷新,以及如果允许,刷新的间隔是多少。低于 20 tick(1 秒)的值不会生效,因为统计数据本身是以秒为单位的。
请勿编辑数据库文件。它以 tick 为单位存储每位玩家的游玩时间。你可以手动添加玩家,但这通常已由插件在玩家首次加入时自动完成;当玩家退出服务器时,任何手动设置的值都会被覆盖。
如果使用 /playtime backup 进行了备份,则会生成一个备份文件。你可以编辑此文件(尽管我不建议这样做),但请注意,如果你这样做了,要加载该备份文件,请先重新加载或重启服务器,以便插件识别你进行的修改。
即将推出的功能(希望能实现)
已知问题与支持/帮助
你可以在 这里 查看已知问题。
如果遇到任何问题,请在 GitHub 上提交,点击这里,或在 Twitter 上私信我。你也可以通过 此链接 加入支持 Discord 服务器。
PublicPlaytime
PublicPlaytime is a plugin which makes it easy to see playtimes of every player who has ever been on your server. PublicPlaytime uses the standard Statistic from Bukkit* to query the playtime of online players, and a database which holds the time for all offline players. The time played is of course how long a certain player has been logged in on your server. It should be the same as the statistic in vanilla Minecraft that people can access via the statistics menu. This also means, that when you switch the main world of your server, the playtime will be reset. To prevent this from happening, use the backup feature that is explained further below.
*Any forks of Bukkit will suffice (i.e. Spigot, Paper etc.)
Commands
PublicPlaytime has several functions. All commands can be seen in-game via /playtime help, aliases can also be found here.
- /playtime get <player> <outputMode>
- Gets the playtime for that specific player in a certain format
- <outputMode> - days, hours, minutes, seconds, ticks, standard
- standard will output the playtime in DD:HH:MM:SS format.
Output when executing: /playtime get LifelessNerd standard
- /playtime ranking <outputMode> <maxAmount>
- Outputs a leaderboard of playtime in your chat in standard formatting.
- <maxAmount> - any integer
- The amount of places that the printed leaderboard will hold. I.e. 5 will get you the top 5 players.
- <outputMode> - days, hours, minutes, seconds, ticks, standard
- standard will output the playtime in DD:HH:MM:SS format.
Output when executing: /playtime ranking standard 10
- /playtime scoreboard <show/hide> <outputMode> <maxAmount>
- Shows or hides a scoreboard of the players with the highest amount of playtime.
- <show/hide> 'show' or 'hide'
- Whether to show or hide a scoreboard.
- <maxAmount> - any integer
- The amount of places that the printed leaderboard will hold. I.e. 5 will get you the top 5 players.
- <outputMode> - days, hours, minutes, seconds, ticks
- standard is not permitted here, since it does not fit in a scoreboard.
Note: This command has options in the config, for whether to refresh the scoreboard and at what interval. See 'Files'.
Output when executing: /playtime scoreboard show minutes 10
-
/playtime help
- Shows a list of all commands that the plugin has.
-
/playtime about
- Shows information about the plugin, where to find it and more.
-
/playtime backup
- Saves the current playtimes into a file. This will overwrite a previous backup.
-
/playtime load
- Loads playtimes from the backup file, and sets all playtimes equal to those of the backup. This will overwrite old playtimes. This feature is handy when transferring main worlds, as this resets playtimes. To carry the playtimes over, backup the old playtimes in the old world, change worlds, then load them.
Files
Upon first starting the plugin, 2 YAML files will be created, a config and a database. The config will hold options for the plugin for you to edit. There are 2 settings that can be changed, whether to allow scoreboards to refresh, and if so, at what interval they should do so. Anything below 20 ticks (1 second) will not have an effect, since the statistics themselves are done with seconds.
The database is not to be edited. It stores playtimes as ticks per player. You can add players, although this is already done by the plugin when people first join, and any values will get overwritten when a player quits the server.
A backup file is present if a backup is made with /playtime backup. You may edit this file (although I dicourage you from doing it) but notice that when you do this, to load the backup file, first reload/restart the server for the plugin to see the manual changes you've made.
Upcoming feature(s) (hopefully)
Known issues and support/help
Issues can be found here.
If there are any problems, add them on GitHub, here, or DM me on Twitter. You may also join the Support Discord server via this link.
评论 0
登录后参与评分
还没有评论,来抢沙发吧