游戏时长统计
Playtime Stats 是一款 Minecraft 插件,用于追踪并显示玩家的游戏时长统计数据,支持全局统计以及按项目/服务器单独统计。这样即使拥有多个 Minecraft 项目(Project),也能同时查看全局和按项目划分的游戏时长。
它提供了易于使用的命令,让玩家查看自己的游戏时长、检查其他玩家的时长,以及查看服务器上的排行榜前列玩家。所有数据均存储在 MongoDB 数据库中,便于跨多个服务器或项目进行管理和分析。
命令
/playtime
显示你自己的游戏时长(包括全局和当前项目/服务器的时长)。
/playtime toplist
显示当前项目/服务器中游戏时长最多的前 20 名玩家。
/playtime <playername>
显示指定玩家的游戏时长(包括全局和当前项目/服务器的时长)。
如何连接 MongoDB
创建 MongoDB 云账户:
确保你拥有一个 MongoDB 云账户以及一个现成的 MongoDB
MongoDB Cloud
配置插件:
打开 config.yml 文件
设置以下选项:
mongodb_uri: 你的 MongoDB 服务器的连接字符串(例如 mongodb+srv://<Username>:<db_password>@xx.xxxxxxx.mongodb.net/?retryWrites=true&w=majority&appName=Database)。
database_name: 要使用的数据库名称。
collection_name: 存储游戏时长数据的集合名称。
project_name: 你的项目/服务器名称(用于按项目统计)。
Playtime Stats
Playtime Stats is a Minecraft plugin that tracks and displays player playtime statistics, both globally and per project/server. So you can have multiple Minecraft Projekts and still have the Global and per Project Playtime.
It provides easy-to-use commands for players to view their own playtime, check the playtime of others, and see the top players on the server. All data is stored in a MongoDB database, making it easy to manage and analyze playtime across multiple servers or projects.
Commands
/playtime
Shows your own playtime (global and for the current project/server).
/playtime toplist
Displays the top 20 players with the most playtime for the current project/server.
/playtime <playername>
Shows the playtime of the specified player (global and for the current project/server).
How to Connect to MongoDB
Create a MongoDB cloud Account:
Make sure you have a MongoDB cloud Account and a existing Mongodb
MongoDB Cloud
Configure the Plugin:
Open the config.yml file
Set the following options:
mongodb_uri: The connection string for your MongoDB server (e.g., mongodb+srv://<Username>:<db_password>@xx.xxxxxxx.mongodb.net/?retryWrites=true&w=majority&appName=Database).
database_name: The name of the database to use.
collection_name: The name of the collection where playtime data will be stored.
project_name: The name of your project/server (used for per-project statistics).
评论 0
登录后参与评分
还没有评论,来抢沙发吧