From e7712e6e88a68e69c8b6e8360bd6379fac1a0430 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 20 Feb 2023 11:58:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=93=81=E5=8C=A0=E9=93=BA?= =?UTF-8?q?=E4=B8=93=E7=94=A8=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/equipment/module.go | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index 505988774..e6019a038 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -151,6 +151,8 @@ type ( RecycleEquipments(session IUserSession, equs []string, discount int32) (code pb.ErrorCode, atno []*pb.UserAtno) //获得可操作用户装备列表 GetActionableEquipments(uid string) (code pb.ErrorCode, eruips []*pb.DB_Equipment) + //获取可用套装 (铁匠铺使用) + GetActionableSuit(uid string) (code pb.ErrorCode, Suit []int32) } IMainline interface { ModifyMainlineDataByNanduID(uid string, nandu, id int32) (code pb.ErrorCode) diff --git a/modules/equipment/module.go b/modules/equipment/module.go index c699f02b2..72e259efc 100644 --- a/modules/equipment/module.go +++ b/modules/equipment/module.go @@ -300,6 +300,30 @@ func (this *Equipment) GetActionableEquipments(uid string) (code pb.ErrorCode, e return } +//获取可用套装 (铁匠铺使用) +func (this *Equipment) GetActionableSuit(uid string) (code pb.ErrorCode, Suit []int32) { + var ( + err error + equipments []*pb.DB_Equipment + suit map[int32]struct{} + ) + suit = make(map[int32]struct{}) + if equipments, err = this.modelEquipment.QueryUserEquipments(uid); err != nil { + return + } + for _, v := range equipments { + if v.HeroId == "" && !v.Islock { + if conf, err := this.configure.GetEquipmentConfigureById(v.CId); err == nil { + suit[conf.Suittype] = struct{}{} + } + } + } + for i, _ := range suit { + Suit = append(Suit, i) + } + return +} + //Evens-------------------------------------------------------------------------------------------------------------------------------- //推送道具变化消息 func (this *Equipment) equipmentsChangePush(session comm.IUserSession, items []*pb.DB_Equipment) (err error) {