消耗英雄推送消息

This commit is contained in:
meixiongfeng 2022-07-19 13:48:48 +08:00
parent 6e0a8c9a7d
commit 23ea4597bc
6 changed files with 33 additions and 29 deletions

View File

@ -92,7 +92,7 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR
code = pb.ErrorCode_ConfigNoFound
return
}
// 消耗校验
code = this.module.CheckConsumeRes(session, resonConfig.Need, true)
if code != pb.ErrorCode_Success {
return
@ -122,7 +122,9 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR
}
}
}
err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: szCostHero}) // 推送删除的英雄
err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
if err1 != nil {
this.module.Errorf("PushHeroProperty err!")
}

View File

@ -130,7 +130,9 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
code = pb.ErrorCode_DBError
return
}
err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: map[string]int32{req.CostCardObj: 1}}) // 推送删除的英雄
err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
if err1 != nil {
this.module.Errorf("PushHeroProperty err!")
}

View File

@ -138,7 +138,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
return
}
}
session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: mapCostHero})
code = this.module.modelHero.HeroStarUp(session, _hero) // 执行升星操作
if code != pb.ErrorCode_Success {
return

View File

@ -168,7 +168,8 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren
}
}
err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: req.ExpCards}) // 推送删除的英雄
err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化
if err1 != nil {
this.module.Errorf("PushHeroProperty err!")
}

View File

@ -1490,7 +1490,7 @@ func (x *HeroGetSpecifiedResp) GetHero() *DBHero {
return nil
}
type HeroDelNewHeroPush struct {
type HeroDelHeroPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -1498,8 +1498,8 @@ type HeroDelNewHeroPush struct {
Heros map[string]int32 `protobuf:"bytes,1,rep,name=heros,proto3" json:"heros" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *HeroDelNewHeroPush) Reset() {
*x = HeroDelNewHeroPush{}
func (x *HeroDelHeroPush) Reset() {
*x = HeroDelHeroPush{}
if protoimpl.UnsafeEnabled {
mi := &file_hero_hero_msg_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -1507,13 +1507,13 @@ func (x *HeroDelNewHeroPush) Reset() {
}
}
func (x *HeroDelNewHeroPush) String() string {
func (x *HeroDelHeroPush) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HeroDelNewHeroPush) ProtoMessage() {}
func (*HeroDelHeroPush) ProtoMessage() {}
func (x *HeroDelNewHeroPush) ProtoReflect() protoreflect.Message {
func (x *HeroDelHeroPush) ProtoReflect() protoreflect.Message {
mi := &file_hero_hero_msg_proto_msgTypes[28]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -1525,12 +1525,12 @@ func (x *HeroDelNewHeroPush) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use HeroDelNewHeroPush.ProtoReflect.Descriptor instead.
func (*HeroDelNewHeroPush) Descriptor() ([]byte, []int) {
// Deprecated: Use HeroDelHeroPush.ProtoReflect.Descriptor instead.
func (*HeroDelHeroPush) Descriptor() ([]byte, []int) {
return file_hero_hero_msg_proto_rawDescGZIP(), []int{28}
}
func (x *HeroDelNewHeroPush) GetHeros() map[string]int32 {
func (x *HeroDelHeroPush) GetHeros() map[string]int32 {
if x != nil {
return x.Heros
}
@ -1679,16 +1679,15 @@ var file_hero_hero_msg_proto_rawDesc = []byte{
0x72, 0x6f, 0x47, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22,
0x84, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x65, 0x6c, 0x4e, 0x65, 0x77, 0x48, 0x65,
0x72, 0x6f, 0x50, 0x75, 0x73, 0x68, 0x12, 0x34, 0x0a, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x65, 0x6c, 0x4e,
0x65, 0x77, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x75, 0x73, 0x68, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x1a, 0x38, 0x0a, 0x0a,
0x48, 0x65, 0x72, 0x6f, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x7e, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x65, 0x6c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x75,
0x73, 0x68, 0x12, 0x31, 0x0a, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1b, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x65, 0x6c, 0x48, 0x65, 0x72, 0x6f, 0x50,
0x75, 0x73, 0x68, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05,
0x68, 0x65, 0x72, 0x6f, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1733,11 +1732,11 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{
(*HeroAddNewHeroPush)(nil), // 25: HeroAddNewHeroPush
(*HeroGetSpecifiedReq)(nil), // 26: HeroGetSpecifiedReq
(*HeroGetSpecifiedResp)(nil), // 27: HeroGetSpecifiedResp
(*HeroDelNewHeroPush)(nil), // 28: HeroDelNewHeroPush
(*HeroDelHeroPush)(nil), // 28: HeroDelHeroPush
nil, // 29: HeroStrengthenUplvReq.ExpCardsEntry
nil, // 30: HeroPropertyPush.PropertyEntry
nil, // 31: HeroPropertyPush.AddPropertyEntry
nil, // 32: HeroDelNewHeroPush.HerosEntry
nil, // 32: HeroDelHeroPush.HerosEntry
(*DBHero)(nil), // 33: DBHero
}
var file_hero_hero_msg_proto_depIdxs = []int32{
@ -1760,7 +1759,7 @@ var file_hero_hero_msg_proto_depIdxs = []int32{
33, // 16: HeroLockResp.hero:type_name -> DBHero
33, // 17: HeroAddNewHeroPush.hero:type_name -> DBHero
33, // 18: HeroGetSpecifiedResp.hero:type_name -> DBHero
32, // 19: HeroDelNewHeroPush.heros:type_name -> HeroDelNewHeroPush.HerosEntry
32, // 19: HeroDelHeroPush.heros:type_name -> HeroDelHeroPush.HerosEntry
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
@ -2112,7 +2111,7 @@ func file_hero_hero_msg_proto_init() {
}
}
file_hero_hero_msg_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HeroDelNewHeroPush); i {
switch v := v.(*HeroDelHeroPush); i {
case 0:
return &v.state
case 1:

View File

@ -141,6 +141,6 @@ message HeroGetSpecifiedResp {
DBHero hero = 1; //
}
message HeroDelNewHeroPush {
message HeroDelHeroPush {
map<string,int32> heros = 1;
}