diff --git a/modules/equipment/model_equipment.go b/modules/equipment/modelEquipment.go similarity index 96% rename from modules/equipment/model_equipment.go rename to modules/equipment/modelEquipment.go index f19c0df18..ee66605bc 100644 --- a/modules/equipment/model_equipment.go +++ b/modules/equipment/modelEquipment.go @@ -65,7 +65,7 @@ func (this *modelEquipmentComp) QueryEquipmentAmount(uid string, equipmentId int } //添加装备 -func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[int32]uint32) (err error) { +func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[int32]uint32) (change []*pb.DB_Equipment, err error) { var ( configure *cfg.Game_equip equipments []*pb.DB_Equipment @@ -81,11 +81,13 @@ func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[int32]uint32) } add = make(map[string]*pb.DB_Equipment) update = make(map[string]*pb.DB_Equipment) + change = make([]*pb.DB_Equipment, len(equipments)) for k, v := range cIds { iskeep = false for _, equipment := range equipments { if equipment.CId == k && equipment.IsInitialState { update[equipment.Id] = equipment + change = append(change, equipment) equipment.OverlayNum += v iskeep = true break @@ -94,9 +96,10 @@ func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[int32]uint32) if !iskeep { if c, ok := configure.GetDataMap()[k]; ok { if equipment, err := this.newEquipment(uId, c, v); err != nil { - return err + return nil, err } else { add[equipment.Id] = equipment + change = append(change, equipment) } } } diff --git a/modules/equipment/module.go b/modules/equipment/module.go index 178335538..83d0459ac 100644 --- a/modules/equipment/module.go +++ b/modules/equipment/module.go @@ -81,10 +81,27 @@ func (this *Equipment) QueryEquipmentAmount(source *comm.ModuleCallSource, uid s //添加武器 func (this *Equipment) AddNewEquipments(source *comm.ModuleCallSource, uid string, cIds map[int32]uint32) (code pb.ErrorCode) { - var err error - if err = this.modelEquipment.AddEquipments(uid, cIds); err != nil { + var ( + err error + change []*pb.DB_Equipment + ) + if change, err = this.modelEquipment.AddEquipments(uid, cIds); err != nil { log.Errorf("err%v", err) code = pb.ErrorCode_SystemError + return + } + if len(change) > 0 { + this.equipmentsChangePush(uid, change) + } + return +} + +//Evens-------------------------------------------------------------------------------------------------------------------------------- +//推送道具变化消息 +func (this *Equipment) equipmentsChangePush(uid string, items []*pb.DB_Equipment) (err error) { + if session, ok := this.GetUserSession(uid); ok { + session.SendMsg(string(this.GetType()), "change", &pb.EquipmentChangePush{Equipments: items}) + err = session.Push() } return } diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 4f1d234ad..f0a5428f9 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -110,13 +110,12 @@ func (this *ModelItemsComp) Pack_QueryUserPackItemsAmount(uId string, itemid ... } ///添加或则减少物品到用户背包 -func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, addnum int32) (err error) { +func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, addnum int32) (change []*pb.DB_UserItemData, err error) { var ( itmes []*pb.DB_UserItemData add []*pb.DB_UserItemData del []*pb.DB_UserItemData update []*pb.DB_UserItemData - change []*pb.DB_UserItemData leftnum int64 ) if addnum == 0 { @@ -160,7 +159,7 @@ func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, add } ///添加或则减少多个物品到用户背包 -func (this *ModelItemsComp) Pack_AddItemsToUserPack(uId string, items map[int32]int32) (err error) { +func (this *ModelItemsComp) Pack_AddItemsToUserPack(uId string, items map[int32]int32) (change []*pb.DB_UserItemData, err error) { var ( itmes []*pb.DB_UserItemData add []*pb.DB_UserItemData @@ -172,6 +171,7 @@ func (this *ModelItemsComp) Pack_AddItemsToUserPack(uId string, items map[int32] this.module.Errorf("err:%v", err) return } + change = make([]*pb.DB_UserItemData, len(itmes)) for k, v := range items { add, update, del, leftnum = this.pack_addItemToUserPack(itmes, k, v) if leftnum < 0 { @@ -186,18 +186,21 @@ func (this *ModelItemsComp) Pack_AddItemsToUserPack(uId string, items map[int32] this.module.Errorf("err:%v", err) return } + change = append(change, add...) } if len(del) > 0 { if err = this.Pack_DeleteUserPack(uId, del...); err != nil { this.module.Errorf("err:%v", err) return } + change = append(change, del...) } if len(update) > 0 { if err = this.Pack_UpdateUserPack(uId, update...); err != nil { this.module.Errorf("err:%v", err) return } + change = append(change, update...) } } return diff --git a/pb/equipment_msg.pb.go b/pb/equipment_msg.pb.go index c9c67a1a1..30d2aea37 100644 --- a/pb/equipment_msg.pb.go +++ b/pb/equipment_msg.pb.go @@ -107,6 +107,54 @@ func (x *EquipmentGetListResp) GetEquipments() []*DB_Equipment { return nil } +//推送装备背包变化 +type EquipmentChangePush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Equipments []*DB_Equipment `protobuf:"bytes,1,rep,name=Equipments,proto3" json:"Equipments"` //装备列表 +} + +func (x *EquipmentChangePush) Reset() { + *x = EquipmentChangePush{} + if protoimpl.UnsafeEnabled { + mi := &file_equipment_equipment_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EquipmentChangePush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EquipmentChangePush) ProtoMessage() {} + +func (x *EquipmentChangePush) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_msg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EquipmentChangePush.ProtoReflect.Descriptor instead. +func (*EquipmentChangePush) Descriptor() ([]byte, []int) { + return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *EquipmentChangePush) GetEquipments() []*DB_Equipment { + if x != nil { + return x.Equipments + } + return nil +} + //装备挂在到英雄上 type EquipmentEquipReq struct { state protoimpl.MessageState @@ -120,7 +168,7 @@ type EquipmentEquipReq struct { func (x *EquipmentEquipReq) Reset() { *x = EquipmentEquipReq{} if protoimpl.UnsafeEnabled { - mi := &file_equipment_equipment_msg_proto_msgTypes[2] + mi := &file_equipment_equipment_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -133,7 +181,7 @@ func (x *EquipmentEquipReq) String() string { func (*EquipmentEquipReq) ProtoMessage() {} func (x *EquipmentEquipReq) ProtoReflect() protoreflect.Message { - mi := &file_equipment_equipment_msg_proto_msgTypes[2] + mi := &file_equipment_equipment_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -146,7 +194,7 @@ func (x *EquipmentEquipReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentEquipReq.ProtoReflect.Descriptor instead. func (*EquipmentEquipReq) Descriptor() ([]byte, []int) { - return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{2} + return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{3} } func (x *EquipmentEquipReq) GetHeroCardId() string { @@ -175,7 +223,7 @@ type EquipmentEquipResp struct { func (x *EquipmentEquipResp) Reset() { *x = EquipmentEquipResp{} if protoimpl.UnsafeEnabled { - mi := &file_equipment_equipment_msg_proto_msgTypes[3] + mi := &file_equipment_equipment_msg_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -188,7 +236,7 @@ func (x *EquipmentEquipResp) String() string { func (*EquipmentEquipResp) ProtoMessage() {} func (x *EquipmentEquipResp) ProtoReflect() protoreflect.Message { - mi := &file_equipment_equipment_msg_proto_msgTypes[3] + mi := &file_equipment_equipment_msg_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -201,7 +249,7 @@ func (x *EquipmentEquipResp) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentEquipResp.ProtoReflect.Descriptor instead. func (*EquipmentEquipResp) Descriptor() ([]byte, []int) { - return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{3} + return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{4} } func (x *EquipmentEquipResp) GetEquipments() []*DB_Equipment { @@ -223,7 +271,7 @@ type EquipmentUpgradeReq struct { func (x *EquipmentUpgradeReq) Reset() { *x = EquipmentUpgradeReq{} if protoimpl.UnsafeEnabled { - mi := &file_equipment_equipment_msg_proto_msgTypes[4] + mi := &file_equipment_equipment_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -236,7 +284,7 @@ func (x *EquipmentUpgradeReq) String() string { func (*EquipmentUpgradeReq) ProtoMessage() {} func (x *EquipmentUpgradeReq) ProtoReflect() protoreflect.Message { - mi := &file_equipment_equipment_msg_proto_msgTypes[4] + mi := &file_equipment_equipment_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -249,7 +297,7 @@ func (x *EquipmentUpgradeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentUpgradeReq.ProtoReflect.Descriptor instead. func (*EquipmentUpgradeReq) Descriptor() ([]byte, []int) { - return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{4} + return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{5} } func (x *EquipmentUpgradeReq) GetEquipmentId() string { @@ -272,7 +320,7 @@ type EquipmentUpgradeResp struct { func (x *EquipmentUpgradeResp) Reset() { *x = EquipmentUpgradeResp{} if protoimpl.UnsafeEnabled { - mi := &file_equipment_equipment_msg_proto_msgTypes[5] + mi := &file_equipment_equipment_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -285,7 +333,7 @@ func (x *EquipmentUpgradeResp) String() string { func (*EquipmentUpgradeResp) ProtoMessage() {} func (x *EquipmentUpgradeResp) ProtoReflect() protoreflect.Message { - mi := &file_equipment_equipment_msg_proto_msgTypes[5] + mi := &file_equipment_equipment_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -298,7 +346,7 @@ func (x *EquipmentUpgradeResp) ProtoReflect() protoreflect.Message { // Deprecated: Use EquipmentUpgradeResp.ProtoReflect.Descriptor instead. func (*EquipmentUpgradeResp) Descriptor() ([]byte, []int) { - return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{5} + return file_equipment_equipment_msg_proto_rawDescGZIP(), []int{6} } func (x *EquipmentUpgradeResp) GetIsSucc() bool { @@ -327,27 +375,32 @@ var file_equipment_equipment_msg_proto_rawDesc = []byte{ 0x74, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x55, 0x0a, 0x11, 0x45, - 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x71, 0x75, 0x69, 0x70, 0x52, 0x65, 0x71, - 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, - 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x22, 0x43, 0x0a, 0x12, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x45, - 0x71, 0x75, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x45, 0x71, 0x75, 0x69, - 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, - 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x45, 0x71, 0x75, - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x37, 0x0a, 0x13, 0x45, 0x71, 0x75, 0x69, 0x70, - 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, - 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, - 0x22, 0x5b, 0x0a, 0x14, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, - 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, - 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, - 0x12, 0x2b, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x44, 0x0a, 0x13, 0x45, + 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, + 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x55, 0x0a, 0x11, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x71, + 0x75, 0x69, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x65, 0x72, 0x6f, + 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75, + 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x12, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x71, 0x75, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, + 0x0a, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x0a, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x37, 0x0a, + 0x13, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x71, 0x75, 0x69, 0x70, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x14, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, + 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x12, 0x2b, 0x0a, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, + 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, + 0x65, 0x6e, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -362,25 +415,27 @@ func file_equipment_equipment_msg_proto_rawDescGZIP() []byte { return file_equipment_equipment_msg_proto_rawDescData } -var file_equipment_equipment_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_equipment_equipment_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_equipment_equipment_msg_proto_goTypes = []interface{}{ (*EquipmentGetListReq)(nil), // 0: EquipmentGetListReq (*EquipmentGetListResp)(nil), // 1: EquipmentGetListResp - (*EquipmentEquipReq)(nil), // 2: EquipmentEquipReq - (*EquipmentEquipResp)(nil), // 3: EquipmentEquipResp - (*EquipmentUpgradeReq)(nil), // 4: EquipmentUpgradeReq - (*EquipmentUpgradeResp)(nil), // 5: EquipmentUpgradeResp - (*DB_Equipment)(nil), // 6: DB_Equipment + (*EquipmentChangePush)(nil), // 2: EquipmentChangePush + (*EquipmentEquipReq)(nil), // 3: EquipmentEquipReq + (*EquipmentEquipResp)(nil), // 4: EquipmentEquipResp + (*EquipmentUpgradeReq)(nil), // 5: EquipmentUpgradeReq + (*EquipmentUpgradeResp)(nil), // 6: EquipmentUpgradeResp + (*DB_Equipment)(nil), // 7: DB_Equipment } var file_equipment_equipment_msg_proto_depIdxs = []int32{ - 6, // 0: EquipmentGetListResp.Equipments:type_name -> DB_Equipment - 6, // 1: EquipmentEquipResp.Equipments:type_name -> DB_Equipment - 6, // 2: EquipmentUpgradeResp.Equipment:type_name -> DB_Equipment - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 7, // 0: EquipmentGetListResp.Equipments:type_name -> DB_Equipment + 7, // 1: EquipmentChangePush.Equipments:type_name -> DB_Equipment + 7, // 2: EquipmentEquipResp.Equipments:type_name -> DB_Equipment + 7, // 3: EquipmentUpgradeResp.Equipment:type_name -> DB_Equipment + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_equipment_equipment_msg_proto_init() } @@ -415,7 +470,7 @@ func file_equipment_equipment_msg_proto_init() { } } file_equipment_equipment_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentEquipReq); i { + switch v := v.(*EquipmentChangePush); i { case 0: return &v.state case 1: @@ -427,7 +482,7 @@ func file_equipment_equipment_msg_proto_init() { } } file_equipment_equipment_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentEquipResp); i { + switch v := v.(*EquipmentEquipReq); i { case 0: return &v.state case 1: @@ -439,7 +494,7 @@ func file_equipment_equipment_msg_proto_init() { } } file_equipment_equipment_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EquipmentUpgradeReq); i { + switch v := v.(*EquipmentEquipResp); i { case 0: return &v.state case 1: @@ -451,6 +506,18 @@ func file_equipment_equipment_msg_proto_init() { } } file_equipment_equipment_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EquipmentUpgradeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_equipment_equipment_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EquipmentUpgradeResp); i { case 0: return &v.state @@ -469,7 +536,7 @@ func file_equipment_equipment_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_equipment_equipment_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/proto/equipment/equipment_msg.proto b/pb/proto/equipment/equipment_msg.proto index 22587d42f..ebedb3487 100644 --- a/pb/proto/equipment/equipment_msg.proto +++ b/pb/proto/equipment/equipment_msg.proto @@ -11,6 +11,11 @@ message EquipmentGetListResp { repeated DB_Equipment Equipments = 1; //装备列表 } +//推送装备背包变化 +message EquipmentChangePush { + repeated DB_Equipment Equipments = 1; //装备列表 +} + //装备挂在到英雄上 message EquipmentEquipReq{ string HeroCardId = 1; //英雄卡Id