From a48619dde5bd82b483ae7ab27af1a729e38377c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:11:57 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(game):=20=E6=9B=B4=E6=96=B0=E8=AF=95?= =?UTF-8?q?=E7=82=BC=E4=B9=8B=E5=A1=94=E5=92=8C=E5=8B=87=E8=80=85=E4=B9=8B?= =?UTF-8?q?=E5=A1=94=E7=AD=89=E7=BA=A7=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改fight_塔.go中等级验证条件,添加data.Level != 1的特殊处理 - 防止等级1时的错误验证,允许重新挑战第1层 - 保持原有的最大等级限制逻辑 docs(README): 添加新的pprof性能分析命令示例 - 增加针对端口43892的性能分析命令 - 添加300秒CPU数据采样的HTTP可视化命令 - 为性能调试提供更多示例选项 --- README.md | 4 ++++ logic/controller/fight_塔.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8faee1428..9e46e646d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,11 @@ go tool pprof -http :8081 "http://202.189.15.67:62672/debug/pprof/profile" go tool pprof -http :8081 "http://8.162.8.203:9909/debug/pprof//profile" go tool pprof -http :8081 "http://8.162.23.87:9910/debug/pprof//profile" go tool pprof -http :8081 "http://61.147.247.7:36855/debug/pprof/profile" +go tool pprof -http :8081 "http://61.147.247.7:43892/debug/pprof/profile" +# 采样 60 秒的 CPU 数据,然后通过 HTTP 8081 端口可视化 + +go tool pprof -http :8081 "http://61.147.247.7:43892/debug/pprof/profile?seconds=300" 详情查看 [文档](./docs) - [战斗](./docs/battle.md) diff --git a/logic/controller/fight_塔.go b/logic/controller/fight_塔.go index c448b3fbc..27e9e62b6 100644 --- a/logic/controller/fight_塔.go +++ b/logic/controller/fight_塔.go @@ -59,13 +59,13 @@ func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEV if data.Level > 0 { switch data.Head.CMD { case 2428: //试炼之塔 - if data.Level > uint(c.Info.MaxFreshStage) { + if data.Level > uint(c.Info.MaxFreshStage) && data.Level != 1 { return nil, errorcode.ErrorCodes.ErrPokemonNotExists } c.Info.CurrentFreshStage = uint32(data.Level) case 2414: //勇者之塔 - if data.Level > uint(c.Info.MaxStage) { + if data.Level > uint(c.Info.MaxStage) && data.Level != 1 { return nil, errorcode.ErrorCodes.ErrPokemonNotExists } c.Info.CurrentStage = uint32(data.Level)