Infinity Dungeons 统计数据
为 Infinity Dungeons 地图提供全面的统计数据和排行榜系统。通过游戏内排行榜和面向开发者的强大 RESTful API,追踪玩家最高分、怪物击杀数以及总游戏时长。
本插件旨在为您的 Infinity Dungeons 类 Roguelike 服务器增添竞技色彩。它添加了一个强大的统计系统,用于:
- 追踪玩家进度: 自动记录每位玩家的最高地下城层级、总击杀数和总游戏时长。
- 促进竞争: 使用浮动文本(全息图)在世界中显示动态排行榜,展示顶尖玩家。
- 增强社区互动: 玩家可以查看自己的数据或与服务器中的最佳玩家进行比较。
- 提供开发者工具: 内置的 RESTful API 允许您从网站、Discord 机器人或其他自定义集成中获取统计数据。
✨ 功能特性
- 玩家数据统计追踪: 监控并保存每位玩家在地下城中运行的关键数据。
- 游戏内排行榜:
- 高度可配置的浮动文本显示(全息图),用于展示最高击杀、游戏时长和最大层级。
- 可选择使用单个轮换全息图或多个静态全息图。
- 自定义标题、颜色和格式。
- 玩家命令:
/dun stats [player] - 查看自己或其他玩家的统计数据。
/dun killtop - 在聊天栏中显示按怪物击杀数排名的前列玩家。
/dun playtimetop - 在聊天栏中显示按游戏时长排名的前列玩家。
/dun maxleveltop - 在聊天栏中显示按最高层级排名的前列玩家。
- RESTful API:
- 一个可选的内置 API 服务器,通过简单的 HTTP 请求暴露玩家和服务器统计数据。(需要在服务器上开放端口)。
- 轻量且高效: 专为 Infinity Dungeons 设计,以实现尽可能高的性能。
⚙️ 配置
插件可通过 config.yml 进行完全配置。您可以启用/禁用功能、设置全息图位置并自定义所有消息。
# DungeonStats 插件配置
database: "data.yml"
api-server:
enabled: true
port: 8080
log-checker:
enabled: true
interval-ticks: 100
holograms:
enabled: false
refresh-interval-seconds: 10
# 'SINGLE':使用一个 text_display 实体,在不同排行榜之间轮换。
# 'MULTIPLE':为每个排行榜使用单独的 text_display 实体。
display-mode: 'SINGLE'
single-display:
location: "world,0.5,100.5,0.5" # 格式:"世界名称,x,y,z"
# 在切换到下一个排行榜之前,每个排行榜显示多长时间(秒)。
rotation-interval-seconds: 5
multiple-displays:
killtop:
location: "world,5.5,101.5,0.5"
playtimetop:
location: "world,0.5,101.5,5.5"
maxleveltop:
location: "world,-4.5,101.5,0.5"
messages:
title-kills: "&6&l--- 击杀排行榜 ---"
title-playtime: "&6&l--- 游戏时长排行榜 ---"
title-maxlevel: "&6&l--- 最高层级排行榜 ---"
# 可用占位符:{rank}, {player_name}, {value}
rank-entry: "#{rank} &b{player_name}: &f{value}"
rank-color-1: "&e" # 第1名:金色
rank-color-2: "&f" # 第2名:银色
rank-color-3: "&6" # 第3名:青铜色
rank-color-default: "&7" # 其他排名默认颜色
command-usage: "&c用法: /dun <stats|killtop|playtimetop|maxleveltop>"
command-player-not-found: "&c未找到玩家 {player_name} 的数据"
command-no-data: "&7暂无可用数据"
stats-title: "&6--- {player_name} 的统计数据 ---"
stats-line-maxlevel: "&e最高地下城层级: &f{value}"
stats-line-kills: "&e总击杀数: &f{value}"
stats-line-playtime: "&e总游戏时长: &f{value}"
? RESTful API 文档
如果 api-server.enabled 设置为 true,插件将在配置的端口上托管一个简单的 API 服务器。这会将游戏数据披露给远程服务器连接,如果您不希望其公开访问,必须进行适当的防火墙设置。
点击查看 API 端点
GET /players
返回在线玩家列表及其当前状态。
示例响应:
[
{
"name": "Steve3184",
"status": "waiting",
"health": 20.0,
"armor": 0.0
},
{
"name": "AdLambXD",
"status": "ingame",
"health": 15.0,
"armor": 4.0
},
{
"name": "Mark_Q",
"status": "spectator",
"health": 20.0,
"armor": 0.0
}
]
GET /stats
返回已完成的地下城运行日志。
- 可选查询参数:
limit(例如 /stats?limit=10)- 设置返回的最大记录数。默认为 0(无限制)。
示例响应:
[
{
"recordId": 6,
"level": 63,
"doorsOpened": 63,
"enemiesKilled": 203,
"bossesDefeated": 9,
"durationSeconds": 3686
}
]
GET /playerstats
返回单个玩家的终身统计数据。
- 必需查询参数:
name(例如 /playerstats?name=Steve3184)
成功响应:
{
"playerName": "Steve3184",
"kills": 6,
"playtimeSeconds": 38,
"maxLevel": 1
}
错误响应:
{
"error": "Player not found."
}
{
"error": "Player name query parameter is required."
}
GET /killtop
返回按怪物击杀数排名的前 100 名玩家。
示例响应:
[
{
"playerName": "Steve3184",
"kills": 6
}
]
GET /playtimetop
返回按总游戏时长排名的前 100 名玩家。
示例响应:
[
{
"playerName": "Steve3184",
"playtimeSeconds": 38
}
]
GET /maxleveltop
返回按达到的最高地下城层级排名的前 100 名玩家。
示例响应:
[
{
"playerName": "Steve3184",
"maxLevel": 1
}
]
? 安装
- 下载该插件的最新版本。
- 将
.jar 文件放入服务器的 plugins 文件夹中。
- 重启服务器。
- 通过编辑
plugins/RougeStats/config.yml 来配置插件。
- 再次重启服务器以应用更改。
❗ 依赖项
- 必需: 您的服务器必须运行 Infinity Dungeons 地图。本插件专为配合其机制而设计。
- 全息显示: 本插件使用内置的
text_display 实体,无需额外的全息显示插件。
Infinity Dungeons Stats
A comprehensive statistics and leaderboard system for the Infinity Dungeons map. Track player high scores, monster kills, and total playtime with in-game leaderboards and a powerful RESTful API for developers.
This plugin is designed to bring a competitive edge to your Infinity Dungeons rogue-like server. It adds a robust statistics system to:
- Track Player Progress: Automatically records each player's highest dungeon level, total kills, and total playtime.
- Foster Competition: Display dynamic leaderboards in your world using floating text (holograms) to show off the top players.
- Engage Your Community: Players can check their own stats or compare themselves against the server's best.
- Provide Developer Tools: A built-in RESTful API allows you to pull stats for use on websites, Discord bots, or other custom integrations.
✨ Features
- Player Statistics Tracking: Monitors and saves crucial data for every player's run in the dungeon.
- Highest Dungeon Level Reached
- Total Monster Kills
- Total Playtime
- In-Game Leaderboards:
- Highly configurable floating text displays (holograms) for top kills, playtime, and max level.
- Choose between a single, rotating hologram or multiple static ones.
- Customize titles, colors, and formats.
- Player Commands:
/dun stats [player] - View your own or another player's statistics.
/dun killtop - Display the top players by monster kills in chat.
/dun playtimetop - Display the top players by playtime in chat.
/dun maxleveltop - Display the top players by max level in chat.
- RESTful API:
- An optional, built-in API server to expose player and server stats via simple HTTP requests. (Requires opening a port on your server).
- Lightweight & Efficient: Designed specifically for Infinity Dungeons to be as performant as possible.
⚙️ Configuration
The plugin is fully configurable via config.yml. You can enable/disable features, set hologram locations, and customize all messages.
# DungeonStats Plugin Configuration
database: "data.yml"
api-server:
enabled: true
port: 8080
log-checker:
enabled: true
interval-ticks: 100
holograms:
enabled: false
refresh-interval-seconds: 10
# 'SINGLE': Use one text_display entity, rotating between different leaderboards.
# 'MULTIPLE': Use a separate text_display entity for each leaderboard.
display-mode: 'SINGLE'
single-display:
location: "world,0.5,100.5,0.5" # Format: "world_name,x,y,z"
# How long (in seconds) to display each leaderboard before switching to the next.
rotation-interval-seconds: 5
multiple-displays:
killtop:
location: "world,5.5,101.5,0.5"
playtimetop:
location: "world,0.5,101.5,5.5"
maxleveltop:
location: "world,-4.5,101.5,0.5"
messages:
title-kills: "&6&l--- Kills Leaderboard ---"
title-playtime: "&6&l--- Playtime Leaderboard ---"
title-maxlevel: "&6&l--- Max Level Leaderboard ---"
# Available Placeholders: {rank}, {player_name}, {value}
rank-entry: "#{rank} &b{player_name}: &f{value}"
rank-color-1: "&e" # Gold for Rank 1
rank-color-2: "&f" # Silver for Rank 2
rank-color-3: "&6" # Bronze for Rank 3
rank-color-default: "&7" # Default color for other ranks
command-usage: "&cUsage: /dun <stats|killtop|playtimetop|maxleveltop>"
command-player-not-found: "&cCould not find data for player {player_name}"
command-no-data: "&7No data available yet"
stats-title: "&6--- Stats for {player_name} ---"
stats-line-maxlevel: "&eHighest Dungeon Level: &f{value}"
stats-line-kills: "&eTotal Kills: &f{value}"
stats-line-playtime: "&eTotal Playtime: &f{value}"
? RESTful API Documentation
If api-server.enabled is set to true, the plugin will host a simple API server on the configured port. This discloses game data to a remote server connection and must be firewalled appropriately if you do not want it to be public.
Click to view API Endpoints
GET /players
Returns a list of online players and their current status.
Example Response:
[
{
"name": "Steve3184",
"status": "waiting",
"health": 20.0,
"armor": 0.0
},
{
"name": "AdLambXD",
"status": "ingame",
"health": 15.0,
"armor": 4.0
},
{
"name": "Mark_Q",
"status": "spectator",
"health": 20.0,
"armor": 0.0
}
]
GET /stats
Returns a log of completed dungeon runs.
- Optional Query Parameter:
limit (e.g., /stats?limit=10) - Sets the maximum number of records to return. Defaults to 0 (unlimited).
Example Response:
[
{
"recordId": 6,
"level": 63,
"doorsOpened": 63,
"enemiesKilled": 203,
"bossesDefeated": 9,
"durationSeconds": 3686
}
]
GET /playerstats
Returns the lifetime statistics for a single player.
- Required Query Parameter:
name (e.g., /playerstats?name=Steve3184)
Success Response:
{
"playerName": "Steve3184",
"kills": 6,
"playtimeSeconds": 38,
"maxLevel": 1
}
Error Responses:
{
"error": "Player not found."
}
{
"error": "Player name query parameter is required."
}
GET /killtop
Returns the top 100 players by monster kills.
Example Response:
[
{
"playerName": "Steve3184",
"kills": 6
}
]
GET /playtimetop
Returns the top 100 players by total playtime.
Example Response:
[
{
"playerName": "Steve3184",
"playtimeSeconds": 38
}
]
GET /maxleveltop
Returns the top 100 players by highest dungeon level reached.
Example Response:
[
{
"playerName": "Steve3184",
"maxLevel": 1
}
]
? Installation
- Download the latest version of the plugin.
- Place the
.jar file into your server's plugins folder.
- Restart your server.
- Configure the plugin by editing
plugins/RougeStats/config.yml.
- Restart the server again to apply changes.
❗ Dependencies
- Required: Your server must be running the Infinity Dungeons map. This plugin is specifically designed to work with its mechanics.
- Holograms: This plugin uses built-in
text_display entities and does not require a separate hologram plugin.
评论 0
登录后参与评分
还没有评论,来抢沙发吧