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
}
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,10 +111,15 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
var (
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 {
@ -126,11 +131,19 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
})
}
}
// 发所有道具
item := this.configure.GetAllItemConfigure()
for _, v := range item {
res = append(res, &cfg.Gameatn{
A: "item",
T: v.Id,
N: 100,
})
}
code = this.DispenseRes(session, res, true)
if code != pb.ErrorCode_Success {
this.Errorf("资源发放失败,%v", code)
}
}
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "param", Value: datas[0]},

View File

@ -336,8 +336,9 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
N: 1,
}
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)
for _, v := range atno {
if v.A == "hero" {