BetterStatus
一款 Minecraft 网络监控插件,拥有独立的 BungeeCord 和 Velocity 代理适配器以及 Paper/Spigot PlaceholderAPI 后端。
模块
common:不可变的状态快照、异步监控/状态转换、带版本控制的有界插件消息协议、公共 API、SQLite 历史记录和 Discord webhook 支持。
proxy-bungee:BungeeCord/Waterfall 适配器,监控、/srvstatus 命令、历史记录和 webhook 警报。
proxy-velocity:原生 Velocity 适配器,具有相同的监控核心和命令。
backend:接收代理快照并注册 PlaceholderAPI 占位符的 Bukkit/Paper 插件。
要求
- JDK 21+
- Maven 3.9+
- BungeeCord/Waterfall 或 Velocity 3.x(仅安装一个代理适配器)
- Paper/Spigot 1.20+ 用于后端服务器
- PlaceholderAPI 用于占位符
构建
从仓库根目录执行:
mvn clean verify
构建产物:
proxy-bungee/target/betterstatus-bungee-2.0.0.jar
proxy-velocity/target/betterstatus-velocity-2.0.0.jar
backend/target/betterstatus-backend-2.0.0.jar
在代理上安装一个代理适配器,并在需要占位符的所有服务器上安装后端 jar 包。切勿在一个代理上同时安装两个代理适配器。
BungeeCord 配置
首次启动时,会创建 plugins/BetterStatus/config.yml:
servers:
- lobby
- survival
settings:
update-interval-seconds: 5
timeout-millis: 3000
failure-threshold: 3
recovery-threshold: 2
warning-ping-millis: 150
critical-ping-millis: 300
messages:
online: "&aOnline"
offline: "&cOffline"
maintenance: "&6Maintenance"
storage:
enabled: true
discord:
webhook-url: ""
Velocity 会创建包含等效监控设置的 plugins/betterstatus/config.properties。将 servers 配置为精确的代理服务器名称的逗号分隔列表。SQLite 历史记录存储在插件数据目录中。在未配置 webhook URL 之前,Discord 通知将保持禁用状态。
占位符
保留现有的占位符:
%srvstatus_lobby% — 配置的旧版状态文本。
按服务器的占位符:
| 占位符 |
值 |
%srvstatus_lobby_state% |
状态枚举 |
%srvstatus_lobby_online% |
布尔在线指示器 |
%srvstatus_lobby_players% |
当前玩家数 |
%srvstatus_lobby_max% |
最大玩家数 |
%srvstatus_lobby_playercount% |
组合计数,例如 12/100 |
%srvstatus_lobby_ping% |
延迟(毫秒) |
%srvstatus_lobby_motd% |
MOTD |
%srvstatus_lobby_version% |
服务器版本 |
%srvstatus_lobby_uptime% |
运行时间(秒) |
%srvstatus_lobby_downtime% |
自上次成功 ping 以来的时间 |
%srvstatus_lobby_lastseen% |
上次成功检查的时间戳 |
%srvstatus_lobby_health% |
健康状态 |
全网络占位符:
| 占位符 |
值 |
%srvstatus_playercount% |
总在线玩家 / 总容量,例如 24/500 |
%srvstatus_total_playercount% |
网络玩家计数的别名 |
%srvstatus_total_players% |
仅总在线玩家数 |
%srvstatus_total_max% |
总玩家容量 |
%srvstatus_total_servers% |
被监控的服务器数量 |
%srvstatus_online_servers% |
在线/降级服务器数量 |
%srvstatus_offline_servers% |
离线/无法访问的服务器数量 |
%srvstatus_network_status% |
聚合网络状态 |
TAB/记分板行示例:
Players: %srvstatus_playercount%
Lobby: %srvstatus_lobby_playercount%
占位符请求仅读取后端缓存。未知的服务器名称返回 Unknown。
命令
/srvstatus 或 /srvstatus list — 列出被监控的服务器。
/srvstatus info <server> — 显示服务器快照。
/srvstatus check <server|all> — 队列进行全新检查。
/srvstatus history <server> — 显示最近的转换记录(BungeeCord)。
权限:serverstatus.admin。Velocity 还会额外检查 serverstatus.view 以确定命令可见性。
状态
UNKNOWN、STARTING、ONLINE、DEGRADED、MAINTENANCE、RESTARTING、UNREACHABLE 和 OFFLINE。可配置的成功/恢复阈值可减少抖动。延迟阈值也是可配置的。
传输限制
代理监控引擎独立于玩家数量对后端进行 ping 检测。后端状态交付目前使用 BungeeCord 插件消息通道,因此后端至少需要一个连接的玩家才能请求新的快照。此版本尚未实现独立于玩家的认证 TCP/TLS 传输。
BungeeCord 适配器会在检测到 Maintenance 插件已安装时自动尝试挂钩其 API。两个代理适配器都暴露了共享的 ServerStatusApi;集成可以通过调用 setMaintenance(server, true/false) 来控制维护状态。MySQL、全网络聚合分析、自动热重载和独立于玩家的传输也尚未包含在内。
安全性
入站插件消息具有数据包大小和服务器数量限制,格式错误的数据包会被拒绝。监控和 webhook 交付是异步进行的。请保持 webhook URL 私密,切勿提交真实的凭据。
BetterStatus
A Minecraft network monitoring plugin with separate BungeeCord and Velocity proxy adapters and a Paper/Spigot PlaceholderAPI backend.
Modules
common: immutable status snapshots, asynchronous monitoring/state transitions, versioned bounded plugin-message protocol, public API, SQLite history and Discord webhook support.
proxy-bungee: BungeeCord/Waterfall adapter, monitoring, /srvstatus commands, history and webhook alerts.
proxy-velocity: Velocity-native adapter with the same monitoring core and command.
backend: Bukkit/Paper plugin that receives proxy snapshots and registers PlaceholderAPI placeholders.
Requirements
- JDK 21+
- Maven 3.9+
- BungeeCord/Waterfall or Velocity 3.x (install only one proxy adapter)
- Paper/Spigot 1.20+ on backend servers
- PlaceholderAPI for placeholders
Build
From the repository root:
mvn clean verify
Artifacts:
proxy-bungee/target/betterstatus-bungee-2.0.0.jar
proxy-velocity/target/betterstatus-velocity-2.0.0.jar
backend/target/betterstatus-backend-2.0.0.jar
Install one proxy adapter on the proxy and the backend jar on every server where placeholders are needed. Do not install both proxy adapters on one proxy.
BungeeCord configuration
On first startup, plugins/BetterStatus/config.yml is created:
servers:
- lobby
- survival
settings:
update-interval-seconds: 5
timeout-millis: 3000
failure-threshold: 3
recovery-threshold: 2
warning-ping-millis: 150
critical-ping-millis: 300
messages:
online: "&aOnline"
offline: "&cOffline"
maintenance: "&6Maintenance"
storage:
enabled: true
discord:
webhook-url: ""
Velocity creates plugins/betterstatus/config.properties with equivalent monitoring settings. Configure servers as a comma-separated list of exact proxy server names. SQLite history is stored in the plugin data directory. Discord notifications remain disabled until a webhook URL is configured.
Placeholders
The existing placeholder is retained:
%srvstatus_lobby% — configured legacy status text.
Per-server placeholders:
| Placeholder |
Value |
%srvstatus_lobby_state% |
State enum |
%srvstatus_lobby_online% |
Boolean online indicator |
%srvstatus_lobby_players% |
Current players |
%srvstatus_lobby_max% |
Maximum players |
%srvstatus_lobby_playercount% |
Combined count, for example 12/100 |
%srvstatus_lobby_ping% |
Ping in milliseconds |
%srvstatus_lobby_motd% |
MOTD |
%srvstatus_lobby_version% |
Server version |
%srvstatus_lobby_uptime% |
Uptime in seconds |
%srvstatus_lobby_downtime% |
Time since last successful ping |
%srvstatus_lobby_lastseen% |
Last successful check timestamp |
%srvstatus_lobby_health% |
Health state |
Network-wide placeholders:
| Placeholder |
Value |
%srvstatus_playercount% |
Total online players / total capacity, e.g. 24/500 |
%srvstatus_total_playercount% |
Alias of the network player count |
%srvstatus_total_players% |
Total online players only |
%srvstatus_total_max% |
Total player capacity |
%srvstatus_total_servers% |
Number of monitored servers |
%srvstatus_online_servers% |
Online/degraded server count |
%srvstatus_offline_servers% |
Offline/unreachable server count |
%srvstatus_network_status% |
Aggregate network state |
Example TAB/scoreboard line:
Players: %srvstatus_playercount%
Lobby: %srvstatus_lobby_playercount%
Placeholder requests only read the backend cache. Unknown server names return Unknown.
Commands
/srvstatus or /srvstatus list — list monitored servers.
/srvstatus info <server> — show a server snapshot.
/srvstatus check <server|all> — queue a fresh check.
/srvstatus history <server> — show recent transitions (BungeeCord).
Permission: serverstatus.admin. Velocity additionally checks serverstatus.view for command visibility.
States
UNKNOWN, STARTING, ONLINE, DEGRADED, MAINTENANCE, RESTARTING, UNREACHABLE, and OFFLINE. Configurable failure/recovery thresholds reduce flapping. Ping thresholds are configurable.
Transport limitations
The proxy monitoring engine pings backends independently of player count. Backend status delivery currently uses the BungeeCord plugin-message channel, so a backend needs at least one connected player to request fresh snapshots. Player-independent authenticated TCP/TLS transport is not implemented in this version.
The BungeeCord adapter automatically attempts to hook the Maintenance plugin API when it is installed. Both proxy adapters expose the shared ServerStatusApi; integrations can call setMaintenance(server, true/false) to control a maintenance state. MySQL, network-wide aggregate analytics, automatic hot reload and a player-independent transport are also not included yet.
Security
Inbound plugin messages have packet-size and server-count bounds and malformed packets are rejected. Monitoring and webhook delivery are asynchronous. Keep webhook URLs private and never commit real credentials.
评论 0
登录后参与评分
还没有评论,来抢沙发吧