1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-03 00:23:51 +08:00
parent 37fe80c241
commit cf332d916f
3 changed files with 10 additions and 1 deletions

View File

@@ -11,6 +11,8 @@
go tool pprof -http :8081 "http://125.208.20.223:54612/debug/debug/pprof/profile"
go tool pprof -http :8081 "http://127.0.0.1:9909/debug/pprof/profile"
go tool pprof -http :8081 "http://202.189.15.67:62672/debug/pprof/profile"
详情查看 [文档](./docs)
- [战斗](./docs/battle.md)

View File

@@ -40,11 +40,12 @@ func (p *Player) GenMonster() {
p.monsters, oldnum, newNum = replaceOneNumber(p.monsters)
replce = []int{newNum} //产生替换新的精灵
if atomic.CompareAndSwapUint32(&p.Canmon, 2, 1) {
p.MapNPC.Reset(10 * time.Second)
p.OgreInfo.Data = [9]OgrePetInfo{} //切地图清空
replce = p.monsters[:] //产生替换新的精灵
}
p.MapNPC.Reset(10 * time.Second)
p.OgreInfo.Data[oldnum] = OgrePetInfo{} //切地图清空
mapss, ok := xmlres.MonsterMap[gconv.Int(p.Info.MapID)]

View File

@@ -7,6 +7,12 @@ import (
"time"
)
// 定义刷野间隔常量(可根据业务调整)
const (
firstEnterInterval = 7 * time.Second // 首次进图/退出战斗后首次 刷新间隔
normalRefreshInterval = 10 * time.Second // 正常循环 刷新间隔
)
// NewPlayer 使用 Options 模式创建 Player 实例
func NewPlayer(opts ...PlayerOption) *Player {
p := &Player{