feat(pet): 优化宠物融合错误码并记录原始捕获时间

- 将宠物融合过程中的错误码从 ErrSystemBusy 细分为多个更具体的错误码,
  如 ErrPokemonNotFusionReady、ErrPokemonNotFusionReady2 等,便于问题定位。
- 在融合成功后,新增记录主宠的旧捕捉时间(OldCatchTime)字段。
- 调整战斗捕捉逻辑,使用对手玩家的第一个宠物信息进行添加,并重置战斗结束原因。

refactor(service): 移除未使用的管理员会话结构体字段和清理部分冗余代码

- 注释掉 base_sys_user.go
This commit is contained in:
2025-12-04 00:26:49 +08:00
parent 8d7d9da0bf
commit f8ba7988d0
10 changed files with 62 additions and 13 deletions

View File

@@ -18,24 +18,24 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
//防止同一只
if data.Mcatchtime == data.Auxcatchtime {
return result, errorcode.ErrorCodes.ErrSystemBusy
return result, errorcode.ErrorCodes.ErrPokemonNotFusionReady
}
_, Mcatchpetinfo, ok := c.FindPet(data.Mcatchtime)
if !ok {
return result, errorcode.ErrorCodes.ErrSystemBusy
return result, errorcode.ErrorCodes.ErrPokemonNotFusionReady2
}
if xmlres.PetMAP[int(Mcatchpetinfo.ID)].FuseMaster == 0 {
return result, errorcode.ErrorCodes.ErrSystemBusy
return result, errorcode.ErrorCodes.ErrPokemonNotFusionReady3
}
_, Auxpetinfo, ok := c.FindPet(data.Auxcatchtime)
if !ok {
return result, errorcode.ErrorCodes.ErrSystemBusy
return result, errorcode.ErrorCodes.ErrPokemonNotFusionReady2
}
if xmlres.PetMAP[int(Auxpetinfo.ID)].FuseSub == 0 {
return result, errorcode.ErrorCodes.ErrSystemBusy
return result, errorcode.ErrorCodes.ErrPokemonNotFusionReady3
}
///性格生成
@@ -56,6 +56,7 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
dv2 := decimal.NewFromInt(1).Div(decimal.NewFromInt(3)).Mul(decimal.NewFromInt(int64(Auxpetinfo.Dv)))
dv := dv1.Add(dv2).Add(decimal.NewFromInt(1)).IntPart()
r := model.GenPetInfo(resid, int(dv), int(natureId), effect, -1, 1)
r.OldCatchTime = Mcatchpetinfo.CatchTime
c.Service.Pet.PetAdd(r)
c.Pet_del(Auxpetinfo.CatchTime)
c.Pet_del(Mcatchpetinfo.CatchTime)