XtGameKit/Doc/GM-Commands.md

40 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GM Commands Guide
## 目标
本项目 GM 体系采用双轨入口,并强制复用现有 ET 包能力,不额外新建 GM 框架。
## 双轨入口约定
- 服务端命令入口:`cn.etetet.console`
- 使用 `[ConsoleHandler("CommandName")]` 注册
- 适合批量操作、压测、运维值守
- 客户端调试入口:`cn.etetet.yiuigm`
- 使用 `[GM(...)]` + `IGMCommand` 注册
- 仅用于 Debug 开发测试
## 共享实现约定
- GM 业务逻辑必须下沉到共享静态帮助类 `GMHelper`
- Console 与 Panel 只负责参数解析与转发,禁止各自复制业务逻辑
- GMHelper 内部必须调用正式业务系统接口(如 `BagComponentSystem.AddItems`),禁止直接改字段绕过校验
## 发布与安全
- 客户端 `[GM]` 类必须使用 `#if ENABLE_GM` 条件编译包裹
- Release 构建不加载 GM 入口
- 所有 GM 操作应写审计日志(模块 `GM`
## 建议命名规范
- `GM_*`:客户端 panel 命令实现
- `C_*`:服务端 console 命令实现
- `GMHelper.*`:共享业务函数
## 待接入命令清单(第一批)
- 资源:`AddItem` / `RemoveItem` / `ShowBag`
- 英雄:`AddHero` / `SetHeroLevel` / `ShowHeroes`
- 抽卡:`Gacha` / `ShowGachaStats` / `SimulateGacha`
- 运维:`FlushDirty` / `SetLogLevel`