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) {