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 服务器 API 基础地址
PHIRA_STATUS_PAGE_URL str .../status/phira Phira 状态页截图地址
PHIRA_ADMIN_SECRET str 必填。服务器端设置的 ADMIN_SECRET
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.0.tar.gz (3.3 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.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de3018b4450bf60707ff2a6acedec014495751ccc63ee1d541dedb3fbae2585a
MD5 279191aced0742f909ed78a99c1cca05
BLAKE2b-256 266ba34b6882cdd7febd3c943d3dae849f2f6fbf329454773c93c697f3a19a22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_nodejsphira-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4cc983ffbde52cc39f0ba9375613a4fd694226d3b382d2989905e79d9476785
MD5 bf139dff48c2eea85fc63bdf6c2269be
BLAKE2b-256 8719e764acc9664b3d8337e56671883bf7cb8af5253d4435f17b537753cf9662

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