上传主线代码
This commit is contained in:
parent
6449aa7fdd
commit
32d328121b
@ -598,5 +598,7 @@ type (
|
||||
IMainline interface {
|
||||
///红点
|
||||
IGetReddot
|
||||
// bingo 关卡
|
||||
BingoJumpLevel(session IUserSession, level int32) (errdata *pb.ErrorData)
|
||||
}
|
||||
)
|
||||
|
@ -215,7 +215,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
log.Field{Key: "0", Value: datas[0]})
|
||||
} else if len(datas) == 2 && (datas[0] == "mainline") {
|
||||
module1, err := this.service.GetModule(comm.ModuleMline)
|
||||
module1, err := this.service.GetModule(comm.ModuleMainline)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -228,7 +228,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
return
|
||||
}
|
||||
|
||||
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, int32(num1))
|
||||
errdata = module1.(comm.IMainline).BingoJumpLevel(session, int32(num1))
|
||||
|
||||
this.Debug("使用bingo命令",
|
||||
log.Field{Key: "uid", Value: session.GetUserId()},
|
||||
@ -523,12 +523,12 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
|
||||
|
||||
errdata = module1.(comm.IHero).GetAllMaxHero(session, true)
|
||||
|
||||
module1, err = this.service.GetModule(comm.ModuleMline)
|
||||
module1, err = this.service.GetModule(comm.ModuleMainline)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
errdata = module1.(comm.IMline).ModifyMlineDataByNanduID(session, 1101208)
|
||||
errdata = module1.(comm.IMainline).BingoJumpLevel(session, 1101208)
|
||||
module1, err = this.service.GetModule(comm.ModuleEquipment)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -121,6 +121,18 @@ func (this *configureComp) GetMainChapterConf(id int32) (conf *cfg.GameMainChapt
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetMainStageConfs() (data []*cfg.GameMainStageData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
)
|
||||
if v, err = this.GetConfigure(game_mainstage); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
data = v.(*cfg.GameMainStage).GetDataList()
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetMainStageConf(id int32) (data *cfg.GameMainStageData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
type Mainline struct {
|
||||
@ -89,3 +90,39 @@ func (this *Mainline) CheckPoint(uid string) bool {
|
||||
// }
|
||||
return false
|
||||
}
|
||||
|
||||
// 跳转主线管卡
|
||||
func (this *Mainline) BingoJumpLevel(session comm.IUserSession, level int32) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
info *pb.DBMainline
|
||||
confs []*cfg.GameMainStageData
|
||||
err error
|
||||
)
|
||||
|
||||
this.configure.GetMainStageConfs()
|
||||
info, err = this.modelMline.getMainlineData(session.GetUserId())
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range confs {
|
||||
if v.Id <= level {
|
||||
info.Level[v.Id] = 7
|
||||
}
|
||||
}
|
||||
this.modelMline.updateprogress(info)
|
||||
if err = this.modelMline.updateMainlineData(session.GetUserId(), info); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user