update
This commit is contained in:
parent
aa253f24ec
commit
76dfb1651f
@ -1,6 +1,7 @@
|
|||||||
package robot
|
package robot
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/modules/hero"
|
"go_dreamfactory/modules/hero"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
@ -17,13 +18,13 @@ var (
|
|||||||
subType: hero.HeroSubTypeList,
|
subType: hero.HeroSubTypeList,
|
||||||
req: &pb.HeroListReq{},
|
req: &pb.HeroListReq{},
|
||||||
rsp: &pb.HeroListResp{},
|
rsp: &pb.HeroListResp{},
|
||||||
// print: func(rsp proto.Message) {
|
print: func(rsp proto.Message) {
|
||||||
// out := rsp.(*pb.HeroListResp)
|
out := rsp.(*pb.HeroListResp)
|
||||||
// for i, v := range out.List {
|
for i, v := range out.List {
|
||||||
// fmt.Printf("%d- %v\n", (i + 1), v)
|
fmt.Printf("%d- %v\n", (i + 1), v)
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
// enabled: true,
|
enabled: true,
|
||||||
next: func(robot *Robot, rsp proto.Message) {
|
next: func(robot *Robot, rsp proto.Message) {
|
||||||
tcs := []*TestCase{}
|
tcs := []*TestCase{}
|
||||||
if r, ok := rsp.(*pb.HeroListResp); ok {
|
if r, ok := rsp.(*pb.HeroListResp); ok {
|
||||||
@ -36,8 +37,8 @@ var (
|
|||||||
req: &pb.HeroInfoReq{
|
req: &pb.HeroInfoReq{
|
||||||
HeroId: heroId,
|
HeroId: heroId,
|
||||||
},
|
},
|
||||||
rsp: &pb.HeroInfoResp{},
|
rsp: &pb.HeroInfoResp{},
|
||||||
enabled: true,
|
// enabled: true,
|
||||||
// print: func(rsp proto.Message) {
|
// print: func(rsp proto.Message) {
|
||||||
// r := rsp.(*pb.HeroInfoResp)
|
// r := rsp.(*pb.HeroInfoResp)
|
||||||
// fmt.Printf("%v\n", r)
|
// fmt.Printf("%v\n", r)
|
||||||
|
@ -63,7 +63,7 @@ var (
|
|||||||
fmt.Printf("%v 活跃值:%v\n", v, out.Active)
|
fmt.Printf("%v 活跃值:%v\n", v, out.Active)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
enabled: true,
|
// enabled: true,
|
||||||
}, {
|
}, {
|
||||||
desc: "活跃度领取",
|
desc: "活跃度领取",
|
||||||
mainType: string(comm.ModuleTask),
|
mainType: string(comm.ModuleTask),
|
||||||
|
@ -129,7 +129,9 @@ func (this *ModelHero) createMultiHero(uid string, bPush bool, heroCfgIds ...int
|
|||||||
|
|
||||||
if len(heroes) == 0 {
|
if len(heroes) == 0 {
|
||||||
for _, v := range heroCfgIds {
|
for _, v := range heroCfgIds {
|
||||||
return this.createOneHero(uid, v, bPush)
|
if err := this.createOneHero(uid, v, bPush); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
findHero := func(heroId int32) (*pb.DBHero, bool) {
|
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{}{
|
data := map[string]interface{}{
|
||||||
"sameCount": h.SameCount, //叠加数
|
"sameCount": h.SameCount, //叠加数
|
||||||
}
|
}
|
||||||
return this.modifyHeroData(uid, h.Id, data)
|
if err := this.modifyHeroData(uid, h.Id, data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return this.createOneHero(uid, v, bPush)
|
if err := this.createOneHero(uid, v, bPush); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return this.createOneHero(uid, v, bPush)
|
if err := this.createOneHero(uid, v, bPush); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user