This commit is contained in:
@@ -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://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://127.0.0.1:9909/debug/pprof/profile"
|
||||||
|
|
||||||
|
go tool pprof -http :8081 "http://202.189.15.67:62672/debug/pprof/profile"
|
||||||
|
|
||||||
详情查看 [文档](./docs)
|
详情查看 [文档](./docs)
|
||||||
|
|
||||||
- [战斗](./docs/battle.md)
|
- [战斗](./docs/battle.md)
|
||||||
|
|||||||
@@ -40,11 +40,12 @@ func (p *Player) GenMonster() {
|
|||||||
p.monsters, oldnum, newNum = replaceOneNumber(p.monsters)
|
p.monsters, oldnum, newNum = replaceOneNumber(p.monsters)
|
||||||
replce = []int{newNum} //产生替换新的精灵
|
replce = []int{newNum} //产生替换新的精灵
|
||||||
if atomic.CompareAndSwapUint32(&p.Canmon, 2, 1) {
|
if atomic.CompareAndSwapUint32(&p.Canmon, 2, 1) {
|
||||||
p.MapNPC.Reset(10 * time.Second)
|
|
||||||
p.OgreInfo.Data = [9]OgrePetInfo{} //切地图清空
|
p.OgreInfo.Data = [9]OgrePetInfo{} //切地图清空
|
||||||
replce = p.monsters[:] //产生替换新的精灵
|
replce = p.monsters[:] //产生替换新的精灵
|
||||||
|
|
||||||
}
|
}
|
||||||
|
p.MapNPC.Reset(10 * time.Second)
|
||||||
p.OgreInfo.Data[oldnum] = OgrePetInfo{} //切地图清空
|
p.OgreInfo.Data[oldnum] = OgrePetInfo{} //切地图清空
|
||||||
mapss, ok := xmlres.MonsterMap[gconv.Int(p.Info.MapID)]
|
mapss, ok := xmlres.MonsterMap[gconv.Int(p.Info.MapID)]
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 定义刷野间隔常量(可根据业务调整)
|
||||||
|
const (
|
||||||
|
firstEnterInterval = 7 * time.Second // 首次进图/退出战斗后首次 刷新间隔
|
||||||
|
normalRefreshInterval = 10 * time.Second // 正常循环 刷新间隔
|
||||||
|
)
|
||||||
|
|
||||||
// NewPlayer 使用 Options 模式创建 Player 实例
|
// NewPlayer 使用 Options 模式创建 Player 实例
|
||||||
func NewPlayer(opts ...PlayerOption) *Player {
|
func NewPlayer(opts ...PlayerOption) *Player {
|
||||||
p := &Player{
|
p := &Player{
|
||||||
|
|||||||
Reference in New Issue
Block a user