上传主线代码

This commit is contained in:
liwei1dao 2023-09-14 14:19:05 +08:00
parent de766a6c14
commit 562f5018e3
2 changed files with 35 additions and 14 deletions

View File

@ -41,6 +41,9 @@ func (this *ModuleRobot_MainLine) Receive(robot IRobot, stype string, message pr
case "info":
resp := message.(*pb.MainlineInfoResp)
this.info = resp.Info
if this.info.Level == nil {
this.info.Level = make(map[int32]int32)
}
break
case "create":
// resp := message.(*pb.UserCreateResp)
@ -71,6 +74,9 @@ func (this *ModuleRobot_MainLine) DoPipeline(robot IRobot) (err error) {
if conf, err = this.findcanpasslevel(); err != nil { //找到目标管卡
return
}
switch conf.Episodetype {
case 1, 4, 8:
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
heros = heromodule.getbattlehero()
if resp, errdata = robot.SendMessage("mainline", "challenge",
@ -87,6 +93,15 @@ func (this *ModuleRobot_MainLine) DoPipeline(robot IRobot) (err error) {
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
return
}
break
case 0, 3, 7:
if _, errdata = robot.SendMessage("mainline", "levelpass", &pb.MainlineLevelPassReq{Level: conf.Id}); errdata != nil {
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
return
}
default:
err = fmt.Errorf("no fund mainline id:%d type:%d", conf.Id, conf.Episodetype)
}
this.info.Level[conf.Id] = 32
return
}

View File

@ -55,6 +55,12 @@ func (this *ModuleRobot_WTask) Receive(robot IRobot, stype string, message proto
break
}
}
for _, v := range this.progress {
if v.Tid == resp.Progress.Tid {
v.Conlds = resp.Progress.Conlds
return
}
}
this.progress = append(this.progress, resp.Progress)
break
case "finish":