装备洗练问题
This commit is contained in:
parent
7af53cf7ff
commit
fa8e950733
@ -1,6 +1,7 @@
|
|||||||
package equipment
|
package equipment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
@ -23,6 +24,8 @@ func (this *apiComp) WashConfirm(session comm.IUserSession, req *pb.EquipmentWas
|
|||||||
var (
|
var (
|
||||||
equip *pb.DB_Equipment
|
equip *pb.DB_Equipment
|
||||||
attrlibrary *cfg.GameEquipAttrlibrarySData
|
attrlibrary *cfg.GameEquipAttrlibrarySData
|
||||||
|
hero *pb.DBHero
|
||||||
|
equipments []*pb.DB_Equipment
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if errdata = this.WashConfirmCheck(session, req); errdata != nil {
|
if errdata = this.WashConfirmCheck(session, req); errdata != nil {
|
||||||
@ -74,6 +77,33 @@ func (this *apiComp) WashConfirm(session comm.IUserSession, req *pb.EquipmentWas
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if equip.HeroId != "" {
|
||||||
|
equipments = make([]*pb.DB_Equipment, 8)
|
||||||
|
if hero, errdata = this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), equip.HeroId); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for i, v := range hero.EquipID {
|
||||||
|
if v != "" {
|
||||||
|
if v != equip.Id {
|
||||||
|
if equipments[i], err = this.module.modelEquipment.QueryUserEquipmentsById(session.GetUserId(), v); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_EquipmentOnFoundEquipment,
|
||||||
|
Title: pb.ErrorCode_EquipmentOnFoundEquipment.ToString(),
|
||||||
|
Message: fmt.Sprintf("装备唯一 id:%s", v),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
equipments[i] = equip
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if errdata = this.module.ModuleHero.UpdateEquipment(session, hero, equipments); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "washconfirm", &pb.EquipmentWashConfirmResp{Issucc: true})
|
session.SendMsg(string(this.module.GetType()), "washconfirm", &pb.EquipmentWashConfirmResp{Issucc: true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user