上传主线代码
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":
|
||||
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,21 +74,33 @@ func (this *ModuleRobot_MainLine) DoPipeline(robot IRobot) (err error) {
|
||||
if conf, err = this.findcanpasslevel(); err != nil { //找到目标管卡
|
||||
return
|
||||
}
|
||||
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
||||
heros = heromodule.getbattlehero()
|
||||
if resp, errdata = robot.SendMessage("mainline", "challenge",
|
||||
&pb.MainlineChallengeReq{Level: conf.Id, Battle: &pb.BattleFormation{
|
||||
Format: heros,
|
||||
|
||||
switch conf.Episodetype {
|
||||
case 1, 4, 8:
|
||||
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
|
||||
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 {
|
||||
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 {
|
||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||
return
|
||||
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
|
||||
|
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user