Skip to main content

Phira Server Manager plugin for NoneBot2

Project description

nonebot-plugin-nodejsphira

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

适用于 NoneBot2 的 Phira Multiplayer (Node.js 版) 后端管理插件。提供实时的房间查询、网页截图监控、服务器节点状态查看以及完整的管理员远程控制功能。

📖 功能介绍

  • 多维度房间查询:支持纯文本列表展示及高清网页长截图(PC/移动端布局)。
  • 实时状态监控:一键获取 Phira 服务器各节点的运行状态。
  • 动态鉴权管理:集成 AES-256-CBC 动态加密算法,安全对接管理接口。
  • 全方位行政指令:支持广播、踢人、强制开始、切换锁定、修改人数上限、关闭房间等。
  • 权限智能感知:帮助菜单根据用户权限(SUPERUSERS)动态显示指令。

💿 安装方法

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

nb plugin install nonebot-plugin-nodejsphira

或者使用 pip 安装后手动加载:

pip install nonebot-plugin-nodejsphira

并在 pyproject.tomlbot.py 中加载插件:

plugins = ["nonebot_plugin_nodejsphira"]

注意:本插件依赖 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_ADMIN_SECRET str 必填。需在 phira-mp-nodejsver 项目中设置,用于鉴权
PHIRA_SCREENSHOT_WAIT_TIME int 2000 截图等待时间 (ms)
PHIRA_SCREENSHOT_TIMEOUT int 60000 截图超时时间 (ms)
SUPERUSERS list [] 机器人管理员列表 (OpenID),拥有管理指令权限

🎮 触发规则

基础指令 (所有用户)

  • /room : 获取服务器房间概览列表 (纯文本,包含房主及玩家)。
  • /room {id} : 查询指定房间的详细玩家名单及状态 (纯文本)。
  • /proom : 以移动端尺寸获取房间列表的网页长截图。
  • /proom {id} : 获取指定房间详情的网页截图 (PC布局)。
  • /status : 获取 Phira 服务器运行状态图。
  • /ping : 查看机器人在线状态及当前用户权限。
  • /help : 显示帮助菜单。

管理指令 (仅 SUPERUSERS)

  • /players : 列出全服所有房间内的在线玩家。
  • /broadcast "内容" [#ID] : 向全服或指定房间发送系统广播。
  • /kick {UID} : 强制将指定 ID 的玩家移出服务器。
  • /fstart {RID} : 强制开始指定房间的游戏。
  • /lock {RID} : 切换房间的锁定/解锁状态。
  • /maxp {RID} {人数} : 修改指定房间的人数上限。
  • /close {RID} : 强制解散并关闭指定房间。

🛠️ 其它用法

视觉缩放说明

插件默认开启了 125% 的视觉缩放 以及 2.0 的像素密度,确保生成的截图在手机端查看时,文字清晰且布局紧凑。

动态鉴权

管理指令会自动读取 PHIRA_ADMIN_SECRET 并生成当日有效的加密串。请确保机器人服务器的系统时间准确,否则会导致鉴权失败。

📝 许可证

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.4.tar.gz (9.2 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.4-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3afbea4789cbb26faf8d1c7798c4147d3c27c3c1cd69fdbd15eda9f7597346c9
MD5 33c3d1f9bd56a747a98297389513b2a0
BLAKE2b-256 647661ca572e184cda3452a8c1ff623866045e5081c7b4f3a046a4c0aad490c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2826b7b3ef7391a22fb1c958435e75d6cc829ddec90ad8609cd4e68aaf689a6f
MD5 779cc1468b5c6c3ec6d38124e255aef8
BLAKE2b-256 dbd4cef41170e5c49a46248bb98b1effffdb5dfac2e8bdd76d8026c3804b5865

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