diff --git a/comm/imodule.go b/comm/imodule.go index ac7260dd6..74489d394 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -39,6 +39,8 @@ type ( CreateHeroes(uid string, heroCfgId ...string) error //创建指定数量 CreateRepeatHero(uid string, heroCfgId string, num int32) (*pb.DBHero, error) + // 批量创建英雄 + CreateRepeatHeros(session IUserSession, items map[string]int32, bPush bool) (code pb.ErrorCode) // 获取英雄 // heroId 英雄ID GetHeroByObjID(uid, heroId string) (*pb.DBHero, pb.ErrorCode) diff --git a/modules/hero/module.go b/modules/hero/module.go index c98b99455..a64692368 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -157,3 +157,17 @@ func (this *Hero) EventUserOffline(session comm.IUserSession) { err := this.modelHero.RemoveUserHeroInfo(session) this.Debugf("EventUserOffline:%s err:%v", session, err) } + +// 批量创建多个英雄 +func (this *Hero) CreateRepeatHeros(session comm.IUserSession, items map[string]int32, bPush bool) (code pb.ErrorCode) { + + for heroCfgId, num := range items { + _, err := this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num) + if err != nil { + code = pb.ErrorCode_HeroCreate + break + } + } + + return +} diff --git a/modules/mail/api_getAttachment.go b/modules/mail/api_getAttachment.go index 2d112b38e..80a1a373e 100644 --- a/modules/mail/api_getAttachment.go +++ b/modules/mail/api_getAttachment.go @@ -48,7 +48,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma // 修改状态 this.module.modelMail.MailUpdateMailAttachmentState(req.ObjID) mail.Reward = true - return + //return } } }