This commit is contained in:
meixiongfeng 2023-02-08 12:01:52 +08:00
parent ebbc32e297
commit 8b24855232
3 changed files with 52 additions and 19 deletions

View File

@ -354,3 +354,22 @@ func (this *MCompConfigure) GetEquipmentConfigureById(equipmentId string) (confi
} }
return return
} }
func (this *MCompConfigure) GetAllItemConfigure() (item []*cfg.GameItemData) {
if v, err := this.GetConfigure(game_item); err == nil {
for _, v1 := range v.(*cfg.GameItem).GetDataMap() {
item = append(item, v1)
}
}
return
}
func (this *MCompConfigure) GetAllEquipmentConfigure(equipmentId string) (configure []*cfg.GameEquipData) {
if v, err := this.GetConfigure(game_equip); err == nil {
for _, v1 := range v.(*cfg.GameEquip).GetDataMap() {
configure = append(configure, v1)
}
return
}
return
}

View File

@ -111,25 +111,38 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
var ( var (
res []*cfg.Gameatn res []*cfg.Gameatn
) )
if val, err := this.configure.GetYouDaddyConf(); err == nil {
for _, v := range val.GetDataList() {
res = append(res, v.Var...)
equip := this.configure.GetAllItemConfigure()
for _, v1 := range equip {
res = append(res, &cfg.Gameatn{
A: "equi",
T: v1.Id,
N: 1,
})
}
data := this.configure.GetHeroConfigData()
for _, v := range data {
if v.Handbook != -1 {
res = append(res, &cfg.Gameatn{
A: "hero",
T: v.Hid,
N: 1,
})
} }
data := this.configure.GetHeroConfigData() }
for _, v := range data { // 发所有道具
if v.Handbook != -1 { item := this.configure.GetAllItemConfigure()
res = append(res, &cfg.Gameatn{ for _, v := range item {
A: "hero", res = append(res, &cfg.Gameatn{
T: v.Hid, A: "item",
N: 1, T: v.Id,
}) N: 100,
} })
} }
code = this.DispenseRes(session, res, true) code = this.DispenseRes(session, res, true)
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
this.Errorf("资源发放失败,%v", code) this.Errorf("资源发放失败,%v", code)
}
} }
this.Debug("使用bingo命令", this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "uid", Value: session.GetUserId()},

View File

@ -336,8 +336,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
N: 1, N: 1,
} }
if code, atno := this.module.DispenseAtno(session, []*cfg.Gameatn{res}, true); code == pb.ErrorCode_Success { if code, atno := this.module.DispenseAtno(session, []*cfg.Gameatn{res}, true); code == pb.ErrorCode_Success {
var list *pb.AtnoData
list.Atno = atno list := &pb.AtnoData{}
list.Atno = append(list.Atno, atno...)
rsp.Data = append(rsp.Data, list) rsp.Data = append(rsp.Data, list)
for _, v := range atno { for _, v := range atno {
if v.A == "hero" { if v.A == "hero" {