英雄变更推送打包

This commit is contained in:
meixiongfeng 2022-07-22 22:14:21 +08:00
parent 1f6222e2bd
commit 45c304c3d6

View File

@ -3,6 +3,7 @@ package user
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -66,15 +67,18 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
var (
res []*cfg.Game_atn
)
//初始化英雄卡 //初始化英雄卡
if val, err := this.module.configure.GetGlobalInitConf(); err == nil { if val, err := this.module.configure.GetGlobalInitConf(); err == nil {
for _, v := range val.GetDataList() { for _, v := range val.GetDataList() {
res = append(res, v.Var...)
code = this.module.DispenseRes(session, v.Var, true) }
if code != pb.ErrorCode_Success { code = this.module.DispenseRes(session, res, true)
this.module.Errorf("资源发放失败,%v", code) if code != pb.ErrorCode_Success {
} this.module.Errorf("资源发放失败,%v", code)
} }
//defaultHero := utils.TrInt32(val) //defaultHero := utils.TrInt32(val)
// err = this.hero.CreateHeroes(session.GetUserId(), defaultHero...) // err = this.hero.CreateHeroes(session.GetUserId(), defaultHero...)