This commit is contained in:
meixiongfeng 2023-07-27 18:54:26 +08:00
commit 3cf137827f
7 changed files with 70 additions and 9 deletions

View File

@ -598,5 +598,7 @@ type (
IMainline interface {
///红点
IGetReddot
// bingo 关卡
BingoJumpLevel(session IUserSession, level int32) (errdata *pb.ErrorData)
}
)

View File

@ -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

View File

@ -108,6 +108,7 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
},
Formation: make([]*pb.DBSimpleHero, 0),
Time: configure.Now().Unix(),
FightTime: req.Report.Costtime,
Rating: score.Id,
Harm: req.Report.Harm,
}

View File

@ -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{}

View File

@ -56,7 +56,7 @@ func (this *ModelMline) getMainlineData(uid string) (results *pb.DBMainline, err
func (this *ModelMline) updateMainlineData(uid string, data *pb.DBMainline) (err error) {
if err = this.Change(uid, map[string]interface{}{
"Level": data.Level,
"level": data.Level,
"chapteraward": data.Chapteraward,
"exploreaward": data.Exploreaward,
"groupaward": data.Groupaward,

View File

@ -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
}

View File

@ -19,6 +19,7 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
confs []*cfg.GameWorldDealData
need []*cfg.Gameatn
money []*cfg.Gameatn
award []*pb.UserAssets
err error
)
if errdata = this.ExchangeCheck(session, req); errdata != nil {
@ -53,17 +54,25 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
return
}
need = append(need, confs[i].Item...)
money = append(need, confs[i].Money...)
money = append(money, confs[i].Money...)
info.Exchange[v]++
}
if errdata = this.module.ConsumeRes(session, need, true); errdata != nil {
if errdata = this.module.ConsumeRes(session, money, true); errdata != nil {
return
}
if errdata = this.module.DispenseRes(session, money, true); errdata != nil {
if errdata = this.module.DispenseRes(session, need, true); errdata != nil {
return
}
for _, v := range need {
award = append(award, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
if err = this.module.modelwtask.Change(session.GetUserId(), map[string]interface{}{
"exchange": info.Exchange,
@ -75,6 +84,6 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
}
return
}
session.SendMsg(string(this.module.GetType()), "exchange", &pb.WTaskExchangeReq{Eid: req.Eid})
session.SendMsg(string(this.module.GetType()), "exchange", &pb.WTaskExchangeResp{Eid: req.Eid, Award: award})
return
}