Commit a0fb8df9511c63bb2506d4eb37d8726b452845a2

Authored by zhangqijia
1 parent 30e6d227

fix: update nty

cmd/test/action/protocode.go
... ... @@ -15,14 +15,14 @@ func GetTestActionMap() map[interface{}]interface{} {
15 15 am[uint32(pb.ProtoCode_RoleEndBattleRpc)] = RoleEndBattleRsp
16 16 am[uint32(pb.ProtoCode_EquipmentDelRpc)] = EquipmentDelRsp
17 17 am[uint32(pb.ProtoCode_HeroUpLevelRpc)] = HeroUpLevelRsp
  18 + am[uint32(pb.ProtoCode_DisConnectNty)] = DisConnectNty
  19 + am[uint32(pb.ProtoCode_RoleUpdateItemsNty)] = RoleUpdateItemsNty
18 20 am[uint32(pb.ProtoCode_HeartRsp)] = HeartRsp
19   - am[uint32(pb.ProtoCode_DisConnectRsp)] = DisConnectRsp
20 21 am[uint32(pb.ProtoCode_RoleRsp)] = RoleRsp
21 22 am[uint32(pb.ProtoCode_RoleUpdatePropertyRsp)] = RoleUpdatePropertyRsp
22 23 am[uint32(pb.ProtoCode_RoleEndBattleRsp)] = RoleEndBattleRsp
23 24 am[uint32(pb.ProtoCode_EquipmentAddRsp)] = EquipmentAddRsp
24 25 am[uint32(pb.ProtoCode_HeroUpLevelRsp)] = HeroUpLevelRsp
25   - am[uint32(pb.ProtoCode_RoleUpdateItemsNty)] = RoleUpdateItemsNty
26 26  
27 27 return am
28 28 }
... ...
pb/game.pb.go
... ... @@ -227,14 +227,14 @@ func (x *CreateReq) GetDevice() string {
227 227 return ""
228 228 }
229 229  
230   -type DisConnectRsp struct {
  230 +type DisConnectNty struct {
231 231 state protoimpl.MessageState
232 232 sizeCache protoimpl.SizeCache
233 233 unknownFields protoimpl.UnknownFields
234 234 }
235 235  
236   -func (x *DisConnectRsp) Reset() {
237   - *x = DisConnectRsp{}
  236 +func (x *DisConnectNty) Reset() {
  237 + *x = DisConnectNty{}
238 238 if protoimpl.UnsafeEnabled {
239 239 mi := &file_game_proto_msgTypes[4]
240 240 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
... ... @@ -242,13 +242,13 @@ func (x *DisConnectRsp) Reset() {
242 242 }
243 243 }
244 244  
245   -func (x *DisConnectRsp) String() string {
  245 +func (x *DisConnectNty) String() string {
246 246 return protoimpl.X.MessageStringOf(x)
247 247 }
248 248  
249   -func (*DisConnectRsp) ProtoMessage() {}
  249 +func (*DisConnectNty) ProtoMessage() {}
250 250  
251   -func (x *DisConnectRsp) ProtoReflect() protoreflect.Message {
  251 +func (x *DisConnectNty) ProtoReflect() protoreflect.Message {
252 252 mi := &file_game_proto_msgTypes[4]
253 253 if protoimpl.UnsafeEnabled && x != nil {
254 254 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
... ... @@ -260,8 +260,8 @@ func (x *DisConnectRsp) ProtoReflect() protoreflect.Message {
260 260 return mi.MessageOf(x)
261 261 }
262 262  
263   -// Deprecated: Use DisConnectRsp.ProtoReflect.Descriptor instead.
264   -func (*DisConnectRsp) Descriptor() ([]byte, []int) {
  263 +// Deprecated: Use DisConnectNty.ProtoReflect.Descriptor instead.
  264 +func (*DisConnectNty) Descriptor() ([]byte, []int) {
265 265 return file_game_proto_rawDescGZIP(), []int{4}
266 266 }
267 267  
... ... @@ -1086,7 +1086,7 @@ var file_game_proto_rawDesc = []byte{
1086 1086 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a,
1087 1087 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
1088 1088 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x6e,
1089   - 0x65, 0x63, 0x74, 0x52, 0x73, 0x70, 0x22, 0x31, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
  1089 + 0x65, 0x63, 0x74, 0x4e, 0x74, 0x79, 0x22, 0x31, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
1090 1090 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18,
1091 1091 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x54,
1092 1092 0x65, 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x37, 0x0a, 0x09, 0x45, 0x71, 0x75,
... ... @@ -1181,7 +1181,7 @@ var file_game_proto_goTypes = []interface{}{
1181 1181 (*HeartRsp)(nil), // 1: game.HeartRsp
1182 1182 (*LoginReq)(nil), // 2: game.LoginReq
1183 1183 (*CreateReq)(nil), // 3: game.CreateReq
1184   - (*DisConnectRsp)(nil), // 4: game.DisConnectRsp
  1184 + (*DisConnectNty)(nil), // 4: game.DisConnectNty
1185 1185 (*ChangeTeamReq)(nil), // 5: game.ChangeTeamReq
1186 1186 (*EquipInfo)(nil), // 6: game.EquipInfo
1187 1187 (*HeroEquipReferReq)(nil), // 7: game.HeroEquipReferReq
... ... @@ -1275,7 +1275,7 @@ func file_game_proto_init() {
1275 1275 }
1276 1276 }
1277 1277 file_game_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
1278   - switch v := v.(*DisConnectRsp); i {
  1278 + switch v := v.(*DisConnectNty); i {
1279 1279 case 0:
1280 1280 return &v.state
1281 1281 case 1:
... ...
pb/protocode.pb.go
... ... @@ -34,14 +34,14 @@ const (
34 34 ProtoCode_RoleEndBattleRpc ProtoCode = 8
35 35 ProtoCode_EquipmentDelRpc ProtoCode = 9
36 36 ProtoCode_HeroUpLevelRpc ProtoCode = 10
37   - ProtoCode_HeartRsp ProtoCode = 11
38   - ProtoCode_DisConnectRsp ProtoCode = 12
39   - ProtoCode_RoleRsp ProtoCode = 13
40   - ProtoCode_RoleUpdatePropertyRsp ProtoCode = 14
41   - ProtoCode_RoleEndBattleRsp ProtoCode = 15
42   - ProtoCode_EquipmentAddRsp ProtoCode = 16
43   - ProtoCode_HeroUpLevelRsp ProtoCode = 17
44   - ProtoCode_RoleUpdateItemsNty ProtoCode = 18
  37 + ProtoCode_DisConnectNty ProtoCode = 11
  38 + ProtoCode_RoleUpdateItemsNty ProtoCode = 12
  39 + ProtoCode_HeartRsp ProtoCode = 13
  40 + ProtoCode_RoleRsp ProtoCode = 14
  41 + ProtoCode_RoleUpdatePropertyRsp ProtoCode = 15
  42 + ProtoCode_RoleEndBattleRsp ProtoCode = 16
  43 + ProtoCode_EquipmentAddRsp ProtoCode = 17
  44 + ProtoCode_HeroUpLevelRsp ProtoCode = 18
45 45 )
46 46  
47 47 // Enum value maps for ProtoCode.
... ... @@ -58,14 +58,14 @@ var (
58 58 8: "RoleEndBattleRpc",
59 59 9: "EquipmentDelRpc",
60 60 10: "HeroUpLevelRpc",
61   - 11: "HeartRsp",
62   - 12: "DisConnectRsp",
63   - 13: "RoleRsp",
64   - 14: "RoleUpdatePropertyRsp",
65   - 15: "RoleEndBattleRsp",
66   - 16: "EquipmentAddRsp",
67   - 17: "HeroUpLevelRsp",
68   - 18: "RoleUpdateItemsNty",
  61 + 11: "DisConnectNty",
  62 + 12: "RoleUpdateItemsNty",
  63 + 13: "HeartRsp",
  64 + 14: "RoleRsp",
  65 + 15: "RoleUpdatePropertyRsp",
  66 + 16: "RoleEndBattleRsp",
  67 + 17: "EquipmentAddRsp",
  68 + 18: "HeroUpLevelRsp",
69 69 }
70 70 ProtoCode_value = map[string]int32{
71 71 "UNKNOWN": 0,
... ... @@ -79,14 +79,14 @@ var (
79 79 "RoleEndBattleRpc": 8,
80 80 "EquipmentDelRpc": 9,
81 81 "HeroUpLevelRpc": 10,
82   - "HeartRsp": 11,
83   - "DisConnectRsp": 12,
84   - "RoleRsp": 13,
85   - "RoleUpdatePropertyRsp": 14,
86   - "RoleEndBattleRsp": 15,
87   - "EquipmentAddRsp": 16,
88   - "HeroUpLevelRsp": 17,
89   - "RoleUpdateItemsNty": 18,
  82 + "DisConnectNty": 11,
  83 + "RoleUpdateItemsNty": 12,
  84 + "HeartRsp": 13,
  85 + "RoleRsp": 14,
  86 + "RoleUpdatePropertyRsp": 15,
  87 + "RoleEndBattleRsp": 16,
  88 + "EquipmentAddRsp": 17,
  89 + "HeroUpLevelRsp": 18,
90 90 }
91 91 )
92 92  
... ... @@ -135,17 +135,17 @@ var file_protocode_proto_rawDesc = []byte{
135 135 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x70, 0x63, 0x10,
136 136 0x08, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65,
137 137 0x6c, 0x52, 0x70, 0x63, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70,
138   - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x70, 0x63, 0x10, 0x0a, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65,
139   - 0x61, 0x72, 0x74, 0x52, 0x73, 0x70, 0x10, 0x0b, 0x12, 0x11, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x43,
140   - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x73, 0x70, 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x52,
141   - 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x0d, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x6f, 0x6c, 0x65,
142   - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x73,
143   - 0x70, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61,
144   - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75,
145   - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x10, 0x12, 0x12,
146   - 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x73, 0x70,
147   - 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
148   - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x74, 0x79, 0x10, 0x12, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e,
  138 + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x70, 0x63, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x44, 0x69,
  139 + 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x4e, 0x74, 0x79, 0x10, 0x0b, 0x12, 0x16, 0x0a,
  140 + 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73,
  141 + 0x4e, 0x74, 0x79, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x73,
  142 + 0x70, 0x10, 0x0d, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10, 0x0e,
  143 + 0x12, 0x19, 0x0a, 0x15, 0x52, 0x6f, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72,
  144 + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x73, 0x70, 0x10, 0x0f, 0x12, 0x14, 0x0a, 0x10, 0x52,
  145 + 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, 0x70, 0x10,
  146 + 0x10, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64,
  147 + 0x64, 0x52, 0x73, 0x70, 0x10, 0x11, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x70,
  148 + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x73, 0x70, 0x10, 0x12, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e,
149 149 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
150 150 }
151 151  
... ...
tools/generator.py
... ... @@ -61,26 +61,6 @@ def generatorProto(path):
61 61 continue
62 62 GoCodeData += GoProtoCodeLine.format(messageStr[:n1], messageStr[:n1])
63 63 GoCodeTestData += GoProtoCodeTestReqLine.format(messageStr[:n1], messageStr[:n1])
64   -
65   - # rsp
66   - for line in lines:
67   - if line.find("message") == -1:
68   - continue
69   - sline = line.split(' ')
70   - if len(sline) < 2:
71   - continue
72   -
73   - messageStr = sline[1].replace('\n', '').replace('{', "")
74   - n2 = messageStr.find('Rsp')
75   - loginReq = messageStr.find('LoginReq')
76   -
77   - if n2 != -1:
78   - code += 1
79   - ProtoCodeData += ProtoCodeLineRsp.format(messageStr[:n2], code)
80   - if loginReq != -1:
81   - continue
82   - GoCodeTestData += GoProtoCodeTestRspLine.format(messageStr[:n2], messageStr[:n2])
83   -
84 64 # nty
85 65 for line in lines:
86 66 if line.find("message") == -1:
... ... @@ -100,6 +80,24 @@ def generatorProto(path):
100 80 continue
101 81 GoCodeTestData += GoProtoCodeTestNtyLine.format(messageStr[:n3], messageStr[:n3])
102 82  
  83 + # rsp 满足客户端需要
  84 + for line in lines:
  85 + if line.find("message") == -1:
  86 + continue
  87 + sline = line.split(' ')
  88 + if len(sline) < 2:
  89 + continue
  90 +
  91 + messageStr = sline[1].replace('\n', '').replace('{', "")
  92 + n2 = messageStr.find('Rsp')
  93 + loginReq = messageStr.find('LoginReq')
  94 + if n2 != -1:
  95 + code += 1
  96 + ProtoCodeData += ProtoCodeLineRsp.format(messageStr[:n2], code)
  97 + if loginReq != -1:
  98 + continue
  99 + GoCodeTestData += GoProtoCodeTestRspLine.format(messageStr[:n2], messageStr[:n2])
  100 +
103 101  
104 102 # protocode.go
105 103 gostr = GoProtoCodeStr.format(GoCodeData)
... ...