From a8d5b601b5a0a5b1c643bbd18ca7a3dd448584c9 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 12 Jul 2022 10:47:49 +0800 Subject: [PATCH] update --- modules/hero/configure_comp.go | 10 ++-- modules/story/api_challenge.go | 6 +-- modules/story/api_getlist.go | 5 +- pb/mail_msg.pb.go | 93 +++++++++++++++++++++++++++++----- 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 686e45aad..b870ccc67 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -306,7 +306,7 @@ func (this *configureComp) GetHeroResonanceConfig(cardConfigID int32) (data *cfg data = configure.Get(cardConfigID) } } else { - err = fmt.Errorf("%T no is *cfg.Game_hero", v) + err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) } return @@ -318,13 +318,13 @@ func (this *configureComp) GetHeroResonanceRestConfig() (data *cfg.Game_comAtnDa ) if v, err = this.GetConfigure(hero_comatn); err == nil { if configure, ok := v.(*cfg.Game_comAtn); !ok { - err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + err = fmt.Errorf("%T no is *cfg.Game_comAtn", v) return } else { data = configure.Get("hero_reset") } } else { - err = fmt.Errorf("%T no is *cfg.Game_hero", v) + err = fmt.Errorf("%T no is *cfg.game_comatn", v) } return @@ -336,11 +336,11 @@ func (this *configureComp) GetHeroAwakenConfig() (configure *cfg.Game_heroAwaken ) if v, err = this.GetConfigure(hero_awaken); err == nil { if configure, ok = v.(*cfg.Game_heroAwaken); !ok { - err = fmt.Errorf("%T no is *cfg.Game_heroResonance", v) + err = fmt.Errorf("%T no is *cfg.Game_heroAwaken", v) return } } else { - err = fmt.Errorf("%T no is *cfg.Game_hero", v) + err = fmt.Errorf("%T no is *cfg.Game_heroAwaken", v) } return diff --git a/modules/story/api_challenge.go b/modules/story/api_challenge.go index 4623a129f..18ba35b79 100644 --- a/modules/story/api_challenge.go +++ b/modules/story/api_challenge.go @@ -24,10 +24,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge bBranch bool // 当前挑战关卡是不是分支 ) bBranch = false - defer func() { - session.SendMsg(string(this.module.GetType()), StoryChallengeResp, &pb.StoryChallengeResp{Data: curChapter}) - - }() code = this.ChallengeCheck(session, req) if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 @@ -81,6 +77,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge err = this.module.modelStory.modifyStoryData(session.GetUserId(), curChapter.Id, update) } // 发奖 (奖励数据还没配置,后续补充) - + session.SendMsg(string(this.module.GetType()), StoryChallengeResp, &pb.StoryChallengeResp{Data: curChapter}) return } diff --git a/modules/story/api_getlist.go b/modules/story/api_getlist.go index e4a30ae51..e7e45d6c2 100644 --- a/modules/story/api_getlist.go +++ b/modules/story/api_getlist.go @@ -16,10 +16,7 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.StoryGetLis ///获取主线关卡信息 func (this *apiComp) GetList(session comm.IUserSession, req *pb.StoryGetListReq) (code pb.ErrorCode, data proto.Message) { rsp := &pb.StoryGetListResp{} - defer func() { - session.SendMsg(string(this.module.GetType()), StoryGetListResp, &pb.StoryGetListResp{Data: rsp.Data}) - }() code = this.GetListCheck(session, req) if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 @@ -31,5 +28,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.StoryGetListReq) return } rsp.Data = list + + session.SendMsg(string(this.module.GetType()), StoryGetListResp, &pb.StoryGetListResp{Data: rsp.Data}) return } diff --git a/pb/mail_msg.pb.go b/pb/mail_msg.pb.go index 891d49526..6be82fa19 100644 --- a/pb/mail_msg.pb.go +++ b/pb/mail_msg.pb.go @@ -391,6 +391,54 @@ func (x *MailDelMailResp) GetMail() []*DBMailData { return nil } +// 推送邮件 +type MailGetNewMailPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mail *DBMailData `protobuf:"bytes,1,opt,name=Mail,proto3" json:"Mail"` // 推送新的邮件信息 +} + +func (x *MailGetNewMailPush) Reset() { + *x = MailGetNewMailPush{} + if protoimpl.UnsafeEnabled { + mi := &file_mail_mail_msg_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MailGetNewMailPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MailGetNewMailPush) ProtoMessage() {} + +func (x *MailGetNewMailPush) ProtoReflect() protoreflect.Message { + mi := &file_mail_mail_msg_proto_msgTypes[8] + 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 MailGetNewMailPush.ProtoReflect.Descriptor instead. +func (*MailGetNewMailPush) Descriptor() ([]byte, []int) { + return file_mail_mail_msg_proto_rawDescGZIP(), []int{8} +} + +func (x *MailGetNewMailPush) GetMail() *DBMailData { + if x != nil { + return x.Mail + } + return nil +} + var File_mail_mail_msg_proto protoreflect.FileDescriptor var file_mail_mail_msg_proto_rawDesc = []byte{ @@ -420,8 +468,11 @@ var file_mail_mail_msg_proto_rawDesc = []byte{ 0x32, 0x0a, 0x0f, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x65, 0x6c, 0x4d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x4d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4d, - 0x61, 0x69, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x61, 0x69, 0x6c, 0x22, 0x35, 0x0a, 0x12, 0x4d, 0x61, 0x69, 0x6c, 0x47, 0x65, 0x74, 0x4e, 0x65, + 0x77, 0x4d, 0x61, 0x69, 0x6c, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x4d, 0x61, 0x69, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6c, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4d, 0x61, 0x69, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -436,7 +487,7 @@ func file_mail_mail_msg_proto_rawDescGZIP() []byte { return file_mail_mail_msg_proto_rawDescData } -var file_mail_mail_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_mail_mail_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_mail_mail_msg_proto_goTypes = []interface{}{ (*MailGetListReq)(nil), // 0: MailGetListReq (*MailGetListResp)(nil), // 1: MailGetListResp @@ -446,18 +497,20 @@ var file_mail_mail_msg_proto_goTypes = []interface{}{ (*MailGetUserMailAttachmentResp)(nil), // 5: MailGetUserMailAttachmentResp (*MailDelMailReq)(nil), // 6: MailDelMailReq (*MailDelMailResp)(nil), // 7: MailDelMailResp - (*DBMailData)(nil), // 8: DBMailData + (*MailGetNewMailPush)(nil), // 8: MailGetNewMailPush + (*DBMailData)(nil), // 9: DBMailData } var file_mail_mail_msg_proto_depIdxs = []int32{ - 8, // 0: MailGetListResp.Mails:type_name -> DBMailData - 8, // 1: MailReadMailResp.Mail:type_name -> DBMailData - 8, // 2: MailGetUserMailAttachmentResp.Mail:type_name -> DBMailData - 8, // 3: MailDelMailResp.Mail:type_name -> DBMailData - 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 + 9, // 0: MailGetListResp.Mails:type_name -> DBMailData + 9, // 1: MailReadMailResp.Mail:type_name -> DBMailData + 9, // 2: MailGetUserMailAttachmentResp.Mail:type_name -> DBMailData + 9, // 3: MailDelMailResp.Mail:type_name -> DBMailData + 9, // 4: MailGetNewMailPush.Mail:type_name -> DBMailData + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_mail_mail_msg_proto_init() } @@ -563,6 +616,18 @@ func file_mail_mail_msg_proto_init() { return nil } } + file_mail_mail_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MailGetNewMailPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -570,7 +635,7 @@ func file_mail_mail_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_mail_mail_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 0, },