Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
b46952cebd
@ -108,7 +108,7 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
|
||||
nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
|
||||
if nextAwaken == nil { // 达到满级觉醒
|
||||
resonConfig := this.module.configure.GetHeroResonanceConfig(_hero.HeroID, cfg.Star)
|
||||
if resonConfig.Maxnum == _hero.ResonateNum {
|
||||
if resonConfig != nil && resonConfig.Maxnum == _hero.ResonateNum {
|
||||
if _hero.Lv == _hero.Star*comm.HeroStarLvRatio {
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype37, 1, cfg.Color)
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype38, 1)
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.HeroInfoReq) (code pb.ErrorCode) {
|
||||
if req.HeroId == "" {
|
||||
if len(req.HeroId) == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
@ -22,7 +22,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.HeroInfoReq) (code
|
||||
var (
|
||||
uid string
|
||||
)
|
||||
hero := &pb.DBHero{}
|
||||
|
||||
if code = this.InfoCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
@ -38,14 +38,17 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.HeroInfoReq) (code
|
||||
if b {
|
||||
if conn, err := db.ServerDBConn(tag); err == nil {
|
||||
dbModel := db.NewDBModel(comm.TableHero, time.Hour, conn)
|
||||
if err = dbModel.GetListObj(uid, req.HeroId, hero); err == nil {
|
||||
rsp.Base = hero
|
||||
for _, v := range req.HeroId {
|
||||
hero := &pb.DBHero{}
|
||||
if err = dbModel.GetListObj(uid, v, hero); err == nil {
|
||||
rsp.Base = append(rsp.Base, hero)
|
||||
} else {
|
||||
this.module.Errorf("err:%v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
rsp.Uid = uid
|
||||
session.SendMsg(string(this.module.GetType()), HeroSubTypeInfo, rsp)
|
||||
return
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR
|
||||
nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)
|
||||
if nextAwaken == nil { // 达到满级觉醒
|
||||
resonConfig := this.module.configure.GetHeroResonanceConfig(_hero.HeroID, cfg.Star)
|
||||
if resonConfig.Maxnum == _hero.ResonateNum { // 共鸣满
|
||||
if resonConfig != nil && resonConfig.Maxnum == _hero.ResonateNum { // 共鸣满
|
||||
if _hero.Lv == _hero.Star*comm.HeroStarLvRatio {
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype37, 1, cfg.Color)
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype38, 1)
|
||||
|
@ -49,7 +49,7 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren
|
||||
return
|
||||
}
|
||||
// 只有英雄卡才能升级
|
||||
if _hero.CardType != comm.CardTypeHero {
|
||||
if _hero.CardType != comm.CardTypeHero && _hero.CardType != comm.CardTypeStar {
|
||||
code = pb.ErrorCode_HeroTypeErr
|
||||
return
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
|
||||
nextAwaken := this.moduleHero.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1)
|
||||
if nextAwaken == nil { // 达到满级觉醒
|
||||
resonConfig := this.moduleHero.configure.GetHeroResonanceConfig(hero.HeroID, cfg.Star)
|
||||
if resonConfig.Maxnum == hero.ResonateNum { // 共鸣满
|
||||
if resonConfig != nil && resonConfig.Maxnum == hero.ResonateNum { // 共鸣满
|
||||
if hero.Lv == hero.Star*comm.HeroStarLvRatio {
|
||||
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype37, 1, cfg.Color)
|
||||
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype38, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user