From 7bb39c45e2090a5c46e9b86923b3377dd7bbfd24 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 1 Aug 2022 19:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=AC=A1=E5=88=9B=E5=BB=BA=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E8=8B=B1=E9=9B=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 ++ modules/hero/module.go | 14 ++++++++++++++ modules/mail/api_getAttachment.go | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) 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 } } }