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

refactor(fight): 移除调试打印语句并优化阻塞策略

移除了effect_attr.go中的调试println语句,将注释掉相关的日志输出,
同时在pack.go中更新了锁策略,从SleepBlockStrategy切换到
ConditionBlockStrategy,并移除了未使用的time包导入
```
This commit is contained in:
昔念
2026-03-04 14:45:52 +08:00
parent 5874ae270f
commit bf79c0fd6a
2 changed files with 4 additions and 5 deletions

View File

@@ -99,7 +99,7 @@ func (e *EffectPropSyncReverse) OnSkill() bool {
e.opppet = e.Ctx().Opp.CurrentPet
e.can = true
e.active(true)
return true
}
@@ -136,7 +136,7 @@ func (e *EffectPropSyncReverse) active(is bool) {
// 还原反转的属性类型(恢复双方原始值)
e.ourpet.PetInfo.Type = e.ctx.oldOurType
e.ourpet.PetInfo.Type = e.ctx.oldOppType
println("Effect55_o取消效果", e.ourpet.PetInfo.Type, e.opppet.PetInfo.Type)
// println("Effect55_o取消效果", e.ourpet.PetInfo.Type, e.opppet.PetInfo.Type)
case opTypeSync:
// 还原同步的属性类型
e.ourpet.PetInfo.Type = e.ctx.oldOurType
@@ -159,7 +159,7 @@ func (e *EffectPropSyncReverse) active(is bool) {
e.ctx.oldOurType = e.ourpet.PetInfo.Type
e.ctx.oldOppType = e.opppet.PetInfo.Type
e.ourpet.PetInfo.Type, e.opppet.PetInfo.Type = e.opppet.PetInfo.Type, e.ourpet.PetInfo.Type
println("Effect55_o激活效果", e.ourpet.PetInfo.Type, e.opppet.PetInfo.Type)
// println("Effect55_o激活效果", e.ourpet.PetInfo.Type, e.opppet.PetInfo.Type)
case opTypeSync:
// 同步属性类型:保存我方原始值,覆盖为对方值
e.ctx.oldOurType = e.ourpet.PetInfo.Type

View File

@@ -7,7 +7,6 @@ import (
"encoding/binary"
"encoding/hex"
"sync"
"time"
"context"
@@ -245,7 +244,7 @@ func NewClientData(c gnet.Conn) *ClientData {
cd.LF = lockfree.NewLockfree(
8,
cd,
lockfree.NewSleepBlockStrategy(time.Millisecond),
lockfree.NewConditionBlockStrategy(),
)
// // // 启动Lockfree
if err := cd.LF.Start(); err != nil {