Files
NewWPSBot/.tasks/2025-11-12_4_battle-username-target.md

35 lines
1.4 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.

# 背景
文件名: 2025-11-12_4_battle-username-target.md
创建于: 2025-11-13_00:10:51
创建者: LIUBAI095
主分支: main
任务分支: 未创建
Yolo模式: Off
# 任务描述
挑战插件需支持通过用户ID或用户名发起PVP挑战。
# 项目概览
WPSCombatSystem 负责玩家战斗流程当前挑战命令仅接受数值型用户ID用户基础资料由 WPSConfigAPI 管理。
# 分析
- `WPSCombatBattle._handle_challenge` 在解析目标参数时仅执行 `int()` 转换,失败即判定格式错误。
- `combat_service.create_pvp_challenge` 函数签名也要求目标ID为整数。
- `user_info` 表包含 `username` 字段,且其他插件存在根据用户名反查 `user_id` 的逻辑。
# 提议的解决方案
待定
# 当前执行步骤:"1. 创建任务文件"
# 任务进度
2025-11-13_00:19:55
- 已修改: Plugins/WPSCombatSystem/combat_plugin_battle.py
- 更改: 挑战命令支持按用户名优先解析并更新帮助信息
- 原因: 允许用户通过用户名或ID发起挑战
- 阻碍因素: 无
- 状态: 未确认
2025-11-13_00:21:27
- 已修改: Plugins/WPSCombatSystem/combat_plugin_battle.py Plugins/WPSConfigSystem.py
- 更改: 通过 Architecture 获取 WPSConfigAPI 实现用户名解析,新增接口并去除直接数据库访问
- 原因: 避免插件直接访问数据库,统一通过配置接口解析用户
- 阻碍因素: 无
- 状态: 未确认
# 最终审查