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.5.tar.gz (10.8 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.5-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dab40523fea74ed80b8ef2cf0b10d2b8f642a11f8d5cc2769fbe46e71a5d334a
MD5 3319153ead49f3d8ad33bcd8d5298cfb
BLAKE2b-256 f88da5d3c5b228be972a181dc2e1fa09dcad04d639104f10277b5a255a973458

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 866212bfa249298117b1babb1a586be53590ef73735e3e8303fb92b7544111fb
MD5 5f33b8c9635b6971469aa4a4c125ea8f
BLAKE2b-256 dab98e25fb1f05383ddb3b0920cc818c16867c311f0998762fb1b2bf3bf1ce3c

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