This commit is contained in:
zhaocy 2022-07-18 15:30:28 +08:00
parent aa253f24ec
commit 76dfb1651f
3 changed files with 23 additions and 14 deletions

View File

@ -1,6 +1,7 @@
package robot
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/modules/hero"
"go_dreamfactory/pb"
@ -17,13 +18,13 @@ var (
subType: hero.HeroSubTypeList,
req: &pb.HeroListReq{},
rsp: &pb.HeroListResp{},
// print: func(rsp proto.Message) {
// out := rsp.(*pb.HeroListResp)
// for i, v := range out.List {
// fmt.Printf("%d- %v\n", (i + 1), v)
// }
// },
// enabled: true,
print: func(rsp proto.Message) {
out := rsp.(*pb.HeroListResp)
for i, v := range out.List {
fmt.Printf("%d- %v\n", (i + 1), v)
}
},
enabled: true,
next: func(robot *Robot, rsp proto.Message) {
tcs := []*TestCase{}
if r, ok := rsp.(*pb.HeroListResp); ok {
@ -37,7 +38,7 @@ var (
HeroId: heroId,
},
rsp: &pb.HeroInfoResp{},
enabled: true,
// enabled: true,
// print: func(rsp proto.Message) {
// r := rsp.(*pb.HeroInfoResp)
// fmt.Printf("%v\n", r)

View File

@ -63,7 +63,7 @@ var (
fmt.Printf("%v 活跃值:%v\n", v, out.Active)
}
},
enabled: true,
// enabled: true,
}, {
desc: "活跃度领取",
mainType: string(comm.ModuleTask),

View File

@ -129,7 +129,9 @@ func (this *ModelHero) createMultiHero(uid string, bPush bool, heroCfgIds ...int
if len(heroes) == 0 {
for _, v := range heroCfgIds {
return this.createOneHero(uid, v, bPush)
if err := this.createOneHero(uid, v, bPush); err != nil {
return err
}
}
} else {
findHero := func(heroId int32) (*pb.DBHero, bool) {
@ -148,13 +150,19 @@ func (this *ModelHero) createMultiHero(uid string, bPush bool, heroCfgIds ...int
data := map[string]interface{}{
"sameCount": h.SameCount, //叠加数
}
return this.modifyHeroData(uid, h.Id, data)
if err := this.modifyHeroData(uid, h.Id, data); err != nil {
return err
}
} else {
return this.createOneHero(uid, v, bPush)
if err := this.createOneHero(uid, v, bPush); err != nil {
return err
}
}
} else {
return this.createOneHero(uid, v, bPush)
if err := this.createOneHero(uid, v, bPush); err != nil {
return err
}
}
}
}