From 17ac51b6760cd583ac025f17779934aa9b1b9614 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 30 Jun 2022 13:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pb=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/robot/notify.go | 2 +- cmd/robot/robot.go | 2 +- comm/const.go | 2 +- modules/gateway/agent.go | 4 +- pb/hero_msg.pb.go | 152 +++++++++++++------------------ pb/notify_msg.pb.go | 61 +++++++------ pb/proto/notify/notify_msg.proto | 4 +- services/comp_gateroute.go | 4 +- 8 files changed, 104 insertions(+), 127 deletions(-) diff --git a/cmd/robot/notify.go b/cmd/robot/notify.go index 89847d73a..331b4e651 100644 --- a/cmd/robot/notify.go +++ b/cmd/robot/notify.go @@ -10,7 +10,7 @@ var notify_builders = []*builder{ //create mainType: comm.MainTypeNotify, subType: comm.SubTypeErrorNotify, - rsp: &pb.ErrorNotify{}, + rsp: &pb.NotifyErrorNotifyPush{}, enabled: true, }, } diff --git a/cmd/robot/robot.go b/cmd/robot/robot.go index 8f6ca73ce..d3311cad1 100644 --- a/cmd/robot/robot.go +++ b/cmd/robot/robot.go @@ -211,7 +211,7 @@ func (r *Robot) AccountRegister(account string, sid int32) { //打印响应 func printReply(msg *pb.UserMessage, builder *builder) { - if m, ok := builder.rsp.(*pb.ErrorNotify); ok { + if m, ok := builder.rsp.(*pb.NotifyErrorNotifyPush); ok { var tt time.Duration if builder.start.IsZero() { tt = time.Duration(0) diff --git a/comm/const.go b/comm/const.go index a8ac4a08b..19d5df06e 100644 --- a/comm/const.go +++ b/comm/const.go @@ -38,7 +38,7 @@ const ( ModuleEquipment core.M_Modules = "equipment" //装备模块 ModuleHero core.M_Modules = "hero" //英雄模块 ModuleForum core.M_Modules = "forum" //论坛模块 - ModuleItems core.M_Modules = "item" + ModuleItems core.M_Modules = "items" //道具模块 ) //RPC服务接口定义处 diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index f4106296c..69e32f76d 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -81,7 +81,7 @@ locp: break locp } } else { - data, _ := anypb.New(&pb.ErrorNotify{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode_SecKeyInvalid}) + data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode_SecKeyInvalid}) if err = this.WriteMsg(&pb.UserMessage{ MainType: comm.MainTypeNotify, SubType: comm.SubTypeErrorNotify, @@ -232,7 +232,7 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { return } if reply.Code != pb.ErrorCode_Success { - data, _ := anypb.New(&pb.ErrorNotify{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode(reply.Code.Number())}) + data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode(reply.Code.Number())}) err = this.WriteMsg(&pb.UserMessage{ MainType: comm.MainTypeNotify, SubType: comm.SubTypeErrorNotify, diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index b36b06e1c..535178fed 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -1323,64 +1323,40 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, - 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, - 0x65, 0x72, 0x67, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, - 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, - 0x48, 0x65, 0x72, 0x6f, 0x52, 0x0a, 0x75, 0x70, 0x53, 0x74, 0x61, 0x72, 0x43, 0x61, 0x72, 0x64, - 0x22, 0x34, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, - 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, - 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x22, 0x4f, 0x0a, 0x15, 0x48, 0x65, 0x72, 0x6f, 0x47, 0x6f, - 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x12, - 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, 0x70, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6f, 0x47, - 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, - 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, - 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, - 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x75, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3b, 0x0a, 0x19, 0x48, 0x65, 0x72, - 0x6f, 0x47, 0x6f, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x45, 0x6e, 0x65, 0x72, - 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, - 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, - 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, - 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, - 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, - 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, - 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, - 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, - 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, - 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, - 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, - 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x22, 0xa4, 0x02, 0x0a, - 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, - 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x72, - 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x72, 0x6f, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 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, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 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, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5a, 0x0a, 0x0e, + 0x48, 0x65, 0x72, 0x6f, 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1c, + 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x4f, 0x62, 0x6a, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x09, + 0x63, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x63, + 0x6f, 0x73, 0x74, 0x49, 0x74, 0x6d, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, + 0x4a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x48, + 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x0e, + 0x48, 0x65, 0x72, 0x6f, 0x43, 0x68, 0x6f, 0x75, 0x6b, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, + 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, + 0x65, 0x73, 0x22, 0xa4, 0x02, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x62, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, + 0x62, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x1a, 0x3b, 0x0a, 0x0d, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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 ( @@ -1397,32 +1373,32 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte { var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_hero_hero_msg_proto_goTypes = []interface{}{ - (*HeroInfoReq)(nil), // 0: pb.HeroInfoReq - (*HeroInfoRsp)(nil), // 1: pb.HeroInfoRsp - (*HeroListReq)(nil), // 2: pb.HeroListReq - (*HeroListRsp)(nil), // 3: pb.HeroListRsp - (*ItemData)(nil), // 4: pb.ItemData - (*HeroStrengthenUplvReq)(nil), // 5: pb.HeroStrengthenUplvReq - (*HeroStrengthenUplvResp)(nil), // 6: pb.HeroStrengthenUplvResp - (*CostCardData)(nil), // 7: pb.CostCardData - (*HeroStrengthenUpStarReq)(nil), // 8: pb.HeroStrengthenUpStarReq - (*HeroStrengthenUpStarResp)(nil), // 9: pb.HeroStrengthenUpStarResp - (*HeroStrengthenUpSkillReq)(nil), // 10: pb.HeroStrengthenUpSkillReq - (*HeroStrengthenUpSkillResp)(nil), // 11: pb.HeroStrengthenUpSkillResp - (*HeroGongmingReq)(nil), // 12: pb.HeroGongmingReq - (*HeroGongmingResp)(nil), // 13: pb.HeroGongmingResp - (*HeroGongmingResetReq)(nil), // 14: pb.HeroGongmingResetReq - (*HeroGongmingResetResp)(nil), // 15: pb.HeroGongmingResetResp - (*HeroGongmingUseEnergyReq)(nil), // 16: pb.HeroGongmingUseEnergyReq - (*HeroGongmingUseEnergyResp)(nil), // 17: pb.HeroGongmingUseEnergyResp - (*HeroJuexingReq)(nil), // 18: pb.HeroJuexingReq - (*HeroJuexingResp)(nil), // 19: pb.HeroJuexingResp - (*HeroChoukaReq)(nil), // 20: pb.HeroChoukaReq - (*HeroChoukaResp)(nil), // 21: pb.HeroChoukaResp - (*HeroProperty)(nil), // 22: pb.HeroProperty - nil, // 23: pb.HeroProperty.PropertyEntry - nil, // 24: pb.HeroProperty.AddPropertyEntry - (*DBHero)(nil), // 25: pb.DBHero + (*HeroInfoReq)(nil), // 0: pb.HeroInfoReq + (*HeroInfoRsp)(nil), // 1: pb.HeroInfoRsp + (*HeroListReq)(nil), // 2: pb.HeroListReq + (*HeroListRsp)(nil), // 3: pb.HeroListRsp + (*ItemData)(nil), // 4: pb.ItemData + (*HeroStrengthenUplvReq)(nil), // 5: pb.HeroStrengthenUplvReq + (*HeroStrengthenUplvResp)(nil), // 6: pb.HeroStrengthenUplvResp + (*CostCardData)(nil), // 7: pb.CostCardData + (*HeroStrengthenUpStarReq)(nil), // 8: pb.HeroStrengthenUpStarReq + (*HeroStrengthenUpStarResp)(nil), // 9: pb.HeroStrengthenUpStarResp + (*HeroStrengthenUpSkillReq)(nil), // 10: pb.HeroStrengthenUpSkillReq + (*HeroStrengthenUpSkillResp)(nil), // 11: pb.HeroStrengthenUpSkillResp + (*HeroResonanceReq)(nil), // 12: pb.HeroResonanceReq + (*HeroResonanceResp)(nil), // 13: pb.HeroResonanceResp + (*HeroResonanceResetReq)(nil), // 14: pb.HeroResonanceResetReq + (*HeroResonanceResetResp)(nil), // 15: pb.HeroResonanceResetResp + (*HeroResonanceUseEnergyReq)(nil), // 16: pb.HeroResonanceUseEnergyReq + (*HeroResonanceUseEnergyResp)(nil), // 17: pb.HeroResonanceUseEnergyResp + (*HeroJuexingReq)(nil), // 18: pb.HeroJuexingReq + (*HeroJuexingResp)(nil), // 19: pb.HeroJuexingResp + (*HeroChoukaReq)(nil), // 20: pb.HeroChoukaReq + (*HeroChoukaResp)(nil), // 21: pb.HeroChoukaResp + (*HeroProperty)(nil), // 22: pb.HeroProperty + nil, // 23: pb.HeroProperty.PropertyEntry + nil, // 24: pb.HeroProperty.AddPropertyEntry + (*DBHero)(nil), // 25: pb.DBHero } var file_hero_hero_msg_proto_depIdxs = []int32{ 25, // 0: pb.HeroInfoRsp.base:type_name -> pb.DBHero @@ -1432,10 +1408,10 @@ var file_hero_hero_msg_proto_depIdxs = []int32{ 7, // 4: pb.HeroStrengthenUpStarReq.heroRace:type_name -> pb.CostCardData 25, // 5: pb.HeroStrengthenUpStarResp.hero:type_name -> pb.DBHero 25, // 6: pb.HeroStrengthenUpSkillResp.hero:type_name -> pb.DBHero - 25, // 7: pb.HeroGongmingResp.hero:type_name -> pb.DBHero - 25, // 8: pb.HeroGongmingResp.upStarCard:type_name -> pb.DBHero - 25, // 9: pb.HeroGongmingResetResp.hero:type_name -> pb.DBHero - 25, // 10: pb.HeroGongmingUseEnergyResp.hero:type_name -> pb.DBHero + 25, // 7: pb.HeroResonanceResp.hero:type_name -> pb.DBHero + 25, // 8: pb.HeroResonanceResp.upStarCard:type_name -> pb.DBHero + 25, // 9: pb.HeroResonanceResetResp.hero:type_name -> pb.DBHero + 25, // 10: pb.HeroResonanceUseEnergyResp.hero:type_name -> pb.DBHero 4, // 11: pb.HeroJuexingReq.costItmes:type_name -> pb.ItemData 25, // 12: pb.HeroJuexingResp.hero:type_name -> pb.DBHero 25, // 13: pb.HeroChoukaResp.heroes:type_name -> pb.DBHero diff --git a/pb/notify_msg.pb.go b/pb/notify_msg.pb.go index b5a7e3566..52fdaef1a 100644 --- a/pb/notify_msg.pb.go +++ b/pb/notify_msg.pb.go @@ -20,8 +20,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//统一错误码返回 -type ErrorNotify struct { +//统一错误码推送 +type NotifyErrorNotifyPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -33,8 +33,8 @@ type ErrorNotify struct { Data string `protobuf:"bytes,6,opt,name=Data,proto3" json:"Data"` // 错误数据 } -func (x *ErrorNotify) Reset() { - *x = ErrorNotify{} +func (x *NotifyErrorNotifyPush) Reset() { + *x = NotifyErrorNotifyPush{} if protoimpl.UnsafeEnabled { mi := &file_notify_notify_msg_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -42,13 +42,13 @@ func (x *ErrorNotify) Reset() { } } -func (x *ErrorNotify) String() string { +func (x *NotifyErrorNotifyPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ErrorNotify) ProtoMessage() {} +func (*NotifyErrorNotifyPush) ProtoMessage() {} -func (x *ErrorNotify) ProtoReflect() protoreflect.Message { +func (x *NotifyErrorNotifyPush) ProtoReflect() protoreflect.Message { mi := &file_notify_notify_msg_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -60,40 +60,40 @@ func (x *ErrorNotify) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ErrorNotify.ProtoReflect.Descriptor instead. -func (*ErrorNotify) Descriptor() ([]byte, []int) { +// Deprecated: Use NotifyErrorNotifyPush.ProtoReflect.Descriptor instead. +func (*NotifyErrorNotifyPush) Descriptor() ([]byte, []int) { return file_notify_notify_msg_proto_rawDescGZIP(), []int{0} } -func (x *ErrorNotify) GetReqMainType() string { +func (x *NotifyErrorNotifyPush) GetReqMainType() string { if x != nil { return x.ReqMainType } return "" } -func (x *ErrorNotify) GetReqSubType() string { +func (x *NotifyErrorNotifyPush) GetReqSubType() string { if x != nil { return x.ReqSubType } return "" } -func (x *ErrorNotify) GetCode() ErrorCode { +func (x *NotifyErrorNotifyPush) GetCode() ErrorCode { if x != nil { return x.Code } return ErrorCode_Success } -func (x *ErrorNotify) GetMessage() string { +func (x *NotifyErrorNotifyPush) GetMessage() string { if x != nil { return x.Message } return "" } -func (x *ErrorNotify) GetData() string { +func (x *NotifyErrorNotifyPush) GetData() string { if x != nil { return x.Data } @@ -105,18 +105,19 @@ var File_notify_notify_msg_proto protoreflect.FileDescriptor var file_notify_notify_msg_proto_rawDesc = []byte{ 0x0a, 0x17, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0b, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, - 0x71, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x52, 0x65, 0x71, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x52, 0x65, 0x71, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x52, 0x65, 0x71, 0x53, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, - 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x01, 0x0a, 0x15, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, + 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x4d, 0x61, 0x69, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x71, 0x4d, 0x61, + 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x65, 0x71, 0x53, 0x75, 0x62, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x52, 0x65, 0x71, 0x53, + 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x44, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -133,11 +134,11 @@ func file_notify_notify_msg_proto_rawDescGZIP() []byte { var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_notify_notify_msg_proto_goTypes = []interface{}{ - (*ErrorNotify)(nil), // 0: ErrorNotify - (ErrorCode)(0), // 1: ErrorCode + (*NotifyErrorNotifyPush)(nil), // 0: NotifyErrorNotifyPush + (ErrorCode)(0), // 1: ErrorCode } var file_notify_notify_msg_proto_depIdxs = []int32{ - 1, // 0: ErrorNotify.Code:type_name -> ErrorCode + 1, // 0: NotifyErrorNotifyPush.Code:type_name -> ErrorCode 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -153,7 +154,7 @@ func file_notify_notify_msg_proto_init() { file_errorcode_proto_init() if !protoimpl.UnsafeEnabled { file_notify_notify_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ErrorNotify); i { + switch v := v.(*NotifyErrorNotifyPush); i { case 0: return &v.state case 1: diff --git a/pb/proto/notify/notify_msg.proto b/pb/proto/notify/notify_msg.proto index fdd30f7d0..839c3c924 100644 --- a/pb/proto/notify/notify_msg.proto +++ b/pb/proto/notify/notify_msg.proto @@ -2,8 +2,8 @@ syntax = "proto3"; option go_package = ".;pb"; import "errorcode.proto"; -//统一错误码返回 -message ErrorNotify { +//统一错误码推送 +message NotifyErrorNotifyPush { string ReqMainType =1; // 请求协议模块 模块名 例如:user 对应项目中 user的模块 string ReqSubType = 2; // 请求协议函数 例如:login 对应项目中 user的模块中 api_login 的处理函数 ErrorCode Code = 3; // 执行返回错误码 对应 errorcode.proto 枚举 diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index af9d8d49f..3b06fb344 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -102,7 +102,6 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag log.Errorf("HandleUserMsg:[%s-%s] err:%s", args.MainType, args.SubType, reply.ErrorMessage) } }() - log.Debugf("SCompGateRoute ReceiveMsg agent:%s uId:%s MessageDistribution:[%s-%s]", args.UserSessionId, args.UserId, args.MainType, args.SubType) method := fmt.Sprintf("%s.%s", args.MainType, args.SubType) //获取用户消息处理函数 this.mrlock.RLock() @@ -126,7 +125,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag log.Errorf("UserMessage:%s Unmarshal err:%v", method, err) return err } - + log.Debugf("ReceiveMsg Message:[%s-%s]-%v user[%s-%s]", args.MainType, args.SubType, msg, args.UserSessionId, args.UserId) //调用校验接口 checkreturn := msghandle.check.Func.Call([]reflect.Value{msghandle.rcvr, reflect.ValueOf(session), reflect.ValueOf(msg)}) //读取校验结果 有错误直接返回错误码给用户 @@ -159,6 +158,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag reply.Reply = session.Polls() } } else { //未找到消息处理函数 + log.Errorf("no found handle %s", method) reply.Code = pb.ErrorCode_ReqParameterError } return nil