上传主线代码
This commit is contained in:
parent
de766a6c14
commit
562f5018e3
@ -41,6 +41,9 @@ func (this *ModuleRobot_MainLine) Receive(robot IRobot, stype string, message pr
|
|||||||
case "info":
|
case "info":
|
||||||
resp := message.(*pb.MainlineInfoResp)
|
resp := message.(*pb.MainlineInfoResp)
|
||||||
this.info = resp.Info
|
this.info = resp.Info
|
||||||
|
if this.info.Level == nil {
|
||||||
|
this.info.Level = make(map[int32]int32)
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case "create":
|
case "create":
|
||||||
// resp := message.(*pb.UserCreateResp)
|
// resp := message.(*pb.UserCreateResp)
|
||||||
@ -71,21 +74,33 @@ func (this *ModuleRobot_MainLine) DoPipeline(robot IRobot) (err error) {
|
|||||||
if conf, err = this.findcanpasslevel(); err != nil { //找到目标管卡
|
if conf, err = this.findcanpasslevel(); err != nil { //找到目标管卡
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
|
||||||
heros = heromodule.getbattlehero()
|
switch conf.Episodetype {
|
||||||
if resp, errdata = robot.SendMessage("mainline", "challenge",
|
case 1, 4, 8:
|
||||||
&pb.MainlineChallengeReq{Level: conf.Id, Battle: &pb.BattleFormation{
|
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
||||||
Format: heros,
|
heros = heromodule.getbattlehero()
|
||||||
|
if resp, errdata = robot.SendMessage("mainline", "challenge",
|
||||||
|
&pb.MainlineChallengeReq{Level: conf.Id, Battle: &pb.BattleFormation{
|
||||||
|
Format: heros,
|
||||||
|
}}); errdata != nil {
|
||||||
|
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, errdata = robot.SendMessage("mainline", "challengeover", &pb.MainlineChallengeOverReq{Level: conf.Id, Report: &pb.BattleReport{
|
||||||
|
Info: resp.(*pb.MainlineChallengeResp).Info,
|
||||||
|
WinSide: 1,
|
||||||
}}); errdata != nil {
|
}}); errdata != nil {
|
||||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if _, errdata = robot.SendMessage("mainline", "challengeover", &pb.MainlineChallengeOverReq{Level: conf.Id, Report: &pb.BattleReport{
|
break
|
||||||
Info: resp.(*pb.MainlineChallengeResp).Info,
|
case 0, 3, 7:
|
||||||
WinSide: 1,
|
if _, errdata = robot.SendMessage("mainline", "levelpass", &pb.MainlineLevelPassReq{Level: conf.Id}); errdata != nil {
|
||||||
}}); errdata != nil {
|
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
return
|
||||||
return
|
}
|
||||||
|
default:
|
||||||
|
err = fmt.Errorf("no fund mainline id:%d type:%d", conf.Id, conf.Episodetype)
|
||||||
}
|
}
|
||||||
this.info.Level[conf.Id] = 32
|
this.info.Level[conf.Id] = 32
|
||||||
return
|
return
|
||||||
|
@ -55,6 +55,12 @@ func (this *ModuleRobot_WTask) Receive(robot IRobot, stype string, message proto
|
|||||||
break
|
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)
|
this.progress = append(this.progress, resp.Progress)
|
||||||
break
|
break
|
||||||
case "finish":
|
case "finish":
|
||||||
|
Loading…
Reference in New Issue
Block a user