Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
26e2c85b79
@ -68,7 +68,7 @@ func (this *ModelStonehengeBook) addStonehengeBook(uid string, btype int32, bid
|
||||
}
|
||||
info.Award[btype] = bookAward
|
||||
}
|
||||
bookAward.Books = append(bookAward.Books, btype)
|
||||
bookAward.Books = append(bookAward.Books, bid)
|
||||
if err = this.Change(uid, map[string]interface{}{
|
||||
"award": info.Award,
|
||||
}); err != nil {
|
||||
|
@ -206,3 +206,23 @@ func (this *configureComp) getWarorderLvp(lv int32, wtype int32) (conf *cfg.Game
|
||||
err = fmt.Errorf("lv:%d no conf !", lv)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getWarorderLvpMax(wtype int32) (conf *cfg.GamePassCheckExpData, err error) {
|
||||
var (
|
||||
exps []*cfg.GamePassCheckExpData
|
||||
maxlv int32
|
||||
)
|
||||
|
||||
if exps, err = this.getexp(wtype); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range exps {
|
||||
if maxlv < v.Id {
|
||||
maxlv = v.Id
|
||||
conf = v
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *
|
||||
var (
|
||||
confs []*cfg.GamePassCheckPriceData
|
||||
conf *cfg.GamePassCheckPriceData
|
||||
expconf *cfg.GamePassCheckExpData
|
||||
info *pb.DBWarorders
|
||||
warorder *pb.Warorder
|
||||
dwarorder *pb.DreamWarorder
|
||||
@ -108,6 +109,31 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *
|
||||
} else {
|
||||
dwarorder.Vip = 2
|
||||
}
|
||||
if conf.PayproId == pid || conf.PaymidId == pid {
|
||||
if expconf, err = this.configure.getWarorderLvpMax(conf.PasscheckType); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
dwarorder.Lv += this.ModuleTools.GetGlobalConf().PasscheckPro4UpLv
|
||||
if dwarorder.Lv > expconf.Id {
|
||||
dwarorder.Lv = expconf.Id
|
||||
dwarorder.Exp = expconf.Parameter
|
||||
} else {
|
||||
if expconf, err = this.configure.getWarorderLvp(dwarorder.Lv, conf.PasscheckType); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
dwarorder.Exp = expconf.Parameter
|
||||
}
|
||||
}
|
||||
}
|
||||
this.model.updateUserWarorders(session.GetUserId(), info)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user