This commit is contained in:
2025-10-11 01:01:36 +08:00
parent dbf326e751
commit b258a81bb8
4 changed files with 20 additions and 13 deletions

View File

@@ -62,16 +62,16 @@ func isPortAvailable(port uint64) bool {
// 如果id是0,那就是login server
func Start(serverid uint16) {
// 定义延时执行的匿名函数
defer func() {
// 使用recover()捕捉异常
if err := recover(); err != nil {
// err不为空值说明主动抛出异常
fmt.Printf("捕捉异常:%v\n", err)
} else {
// err为空值说明程序没有抛出异常
fmt.Println("程序没有异常")
}
}()
// defer func() {
// // 使用recover()捕捉异常
// if err := recover(); err != nil {
// // err不为空值说明主动抛出异常
// fmt.Printf("捕捉异常:%v\n", err)
// } else {
// // err为空值说明程序没有抛出异常
// fmt.Println("程序没有异常")
// }
// }()
//ants.NewPool(100)
head := player.NewTomeeHandler()

View File

@@ -58,8 +58,10 @@ func (e *Effect10) OnHit(opp *input.Input, skill *info.SkillEntity) {
t1 := e.Input.FightC.GetRand().Int31n(3)
eff := input.Geteffect(input.EffectType.Status, int(e.Status))
eff.Effect.Duration(int(t1 + 1))
e.Input.AddEffect(eff)
if eff.ID != 0 {
eff.Effect.Duration(int(t1 + 1))
e.Input.AddEffect(eff)
}
}
}