refactor(fight): 移除调试打印语句并优化阻塞策略 移除了effect_attr.go中的调试println语句,将注释掉相关的日志输出, 同时在pack.go中更新了锁策略,从SleepBlockStrategy切换到 ConditionBlockStrategy,并移除了未使用的time包导入 ```
This commit is contained in:
@@ -136,7 +136,7 @@ func (e *EffectPropSyncReverse) active(is bool) {
|
|||||||
// 还原反转的属性类型(恢复双方原始值)
|
// 还原反转的属性类型(恢复双方原始值)
|
||||||
e.ourpet.PetInfo.Type = e.ctx.oldOurType
|
e.ourpet.PetInfo.Type = e.ctx.oldOurType
|
||||||
e.ourpet.PetInfo.Type = e.ctx.oldOppType
|
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:
|
case opTypeSync:
|
||||||
// 还原同步的属性类型
|
// 还原同步的属性类型
|
||||||
e.ourpet.PetInfo.Type = e.ctx.oldOurType
|
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.oldOurType = e.ourpet.PetInfo.Type
|
||||||
e.ctx.oldOppType = e.opppet.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
|
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:
|
case opTypeSync:
|
||||||
// 同步属性类型:保存我方原始值,覆盖为对方值
|
// 同步属性类型:保存我方原始值,覆盖为对方值
|
||||||
e.ctx.oldOurType = e.ourpet.PetInfo.Type
|
e.ctx.oldOurType = e.ourpet.PetInfo.Type
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
@@ -245,7 +244,7 @@ func NewClientData(c gnet.Conn) *ClientData {
|
|||||||
cd.LF = lockfree.NewLockfree(
|
cd.LF = lockfree.NewLockfree(
|
||||||
8,
|
8,
|
||||||
cd,
|
cd,
|
||||||
lockfree.NewSleepBlockStrategy(time.Millisecond),
|
lockfree.NewConditionBlockStrategy(),
|
||||||
)
|
)
|
||||||
// // // 启动Lockfree
|
// // // 启动Lockfree
|
||||||
if err := cd.LF.Start(); err != nil {
|
if err := cd.LF.Start(); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user