Skip to main content

Phira Server Manager plugin for NoneBot2

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-nodejsphira

Phira 游戏服务器管理与监控插件

适用于 NoneBot2 的 Phira Multiplayer (Node.js 版) 后端管理插件。提供实时的房间查询、网页截图监控、服务器协议级连通性检测以及完整的管理员远程控制功能。

📖 功能介绍

  • 多维度房间查询:支持纯文本列表展示及高清网页长截图(PC/移动端布局)。
  • 连通性检测:模拟 Phira 客户端进行 TCP 协议级握手测试,获取真实延迟。
  • 状态监控:一键获取 Phira 服务器各节点的运行状态截图。
  • 动态鉴权管理:集成 AES-256-CBC 动态加密算法,安全对接管理接口。
  • 全方位行政指令:支持广播、踢人、强制开始、切换锁定、修改人数上限、关闭房间等。

💿 安装方法

推荐使用 nb-cli 进行安装:

nb plugin install nonebot-plugin-nodejsphira

并在机器人 .env 文件中配置必要项。

注意:网页截图功能依赖 nonebot-plugin-htmlrender。安装后请务必执行:

playwright install chromium

⚙️ 插件配置项

在机器人的 .env 文件中添加以下配置:

配置项 类型 默认值 说明
PHIRA_API_URL str https://phira.chuzoux.top Phira WEB服务器基础地址
PHIRA_STATUS_PAGE_URL str https://status.dmocken.top/status/phira Phira 状态页截图地址
PHIRA_CHECK_EMAIL str Phira 检测账号邮箱 (用于 /status)
PHIRA_CHECK_PASSWORD str Phira 检测账号密码 (用于 /status)
PHIRA_CHECK_SERVER str mp.phira.cn:12346 默认检测的 TCP 服务器地址
PHIRA_SERVER_NAME str Phira 服务器名称展示 (用于 /status)
PHIRA_ADMIN_SECRET str 必填。需在 phira-mp-nodejsver 项目中设置
SUPERUSERS list [] 机器人管理员列表 (OpenID)

🎮 触发规则

基础指令 (所有用户)

  • /room : 获取服务器房间概览列表 (纯文本)。
  • /proom : 以移动端尺寸获取房间列表的网页长截图。
  • /status : 执行 Phira 服务器协议级握手检测 (TCP,返回延迟)。
  • /pstatus : 获取 Phira 服务器节点运行状态图 (截图)。
  • /ping : 查看机器人在线状态及当前用户权限。
  • /help : 显示帮助菜单。

管理指令 (仅 SUPERUSERS)

  • /players : 列出全服所有活跃玩家。
  • /broadcast "内容" [#ID] : 全服或指定房间广播系统消息。
  • /kick {UID} : 强制踢出指定 ID 的玩家。
  • /fstart {RID}, /lock {RID}, /maxp {RID} {人数}, /close {RID} : 房间行政管理。

🛠️ 其它用法

协议检测原理

/status 指令会模拟登录 phira.5wyxi.com 获取 Token,随后与目标服务器建立 TCP 连接并发送 0x01 握手包。如果收到正确响应,则判定为“在线”并计算往返延迟。

📝 许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_nodejsphira-0.1.7.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_nodejsphira-0.1.7-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_nodejsphira-0.1.7.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8a2fb93307a641dc696ddfef3b0c02805870d196b06687a5819c54f6ec1425ab
MD5 6e931935e65fe586f4780df2b9b33644
BLAKE2b-256 d8d4bbf7f7960374b1f3c69b159cbbaaf71e28a50d33b8d4a33c90c2f98e0495

See more details on using hashes here.

File details

Details for the file nonebot_plugin_nodejsphira-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ebbcfe6b4c33ce9b7d18d695c785f4e9af38dcbd2b8347fc54289931d79bec62
MD5 d6251e9189b25df56df38c878210b8d6
BLAKE2b-256 7ba466925b46d4466b480b9445e98d3f4a01163260ccdbc4cf8634e4ce818c59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page