Commit 0d5650de3b9c864a17d07245e4673b298eb2631c
1 parent
9e63e790
fix: proto 改造
Showing
7 changed files
with
278 additions
and
229 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +syntax = "proto3"; | |
| 2 | +option go_package = "../pb;pb"; | |
| 3 | + | |
| 4 | +package game; | |
| 5 | +//import "google/protobuf/empty.proto"; | |
| 6 | +import "models.proto"; | |
| 7 | + | |
| 8 | +// rpc = req + rsp 请求/返回 | |
| 9 | +// rpc = rar + rar 自回包 | |
| 10 | + | |
| 11 | +message EmailListReq { | |
| 12 | +} | |
| 13 | + | |
| 14 | +message EmailListRsp { | |
| 15 | + repeated models.Email emails = 1; | |
| 16 | +} | |
| 17 | + | |
| 18 | +message EmailDrawReq { | |
| 19 | + string id = 1; | |
| 20 | +} | |
| 21 | + | |
| 22 | +message EmailDrawRsp { | |
| 23 | + repeated string ids = 1; | |
| 24 | + string reward = 2; | |
| 25 | +} | |
| 26 | + | |
| 27 | +message EmailCheckRar { | |
| 28 | + string id = 1; | |
| 29 | +} | |
| 30 | + | |
| 31 | +message EmailDelReq { | |
| 32 | +} | |
| 33 | + | |
| 34 | +message EmailDelRsp { | |
| 35 | + repeated string ids = 1; | |
| 36 | +} | |
| 37 | + | |
| 38 | +message EmailNewNty { | |
| 39 | + models.Email email = 1; | |
| 40 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | +syntax = "proto3"; | |
| 2 | +option go_package = "../pb;pb"; | |
| 3 | + | |
| 4 | +package game; | |
| 5 | +//import "google/protobuf/empty.proto"; | |
| 6 | +import "models.proto"; | |
| 7 | + | |
| 8 | +// rpc = req + rsp 请求/返回 | |
| 9 | +// rpc = rar + rar 自回包 | |
| 10 | + | |
| 11 | + | |
| 12 | +message EquipmentDelReq { | |
| 13 | + repeated string id = 1; | |
| 14 | +} | |
| 15 | + | |
| 16 | +message EquipmentDelRsp { | |
| 17 | + map<string,int32> reward = 1; | |
| 18 | +} | |
| 19 | + | |
| 20 | +message EquipmentAddNty { | |
| 21 | + models.Equipment equip = 1; | |
| 22 | +} | |
| 23 | + | |
| 24 | +message EquipmentEnhanceReq { | |
| 25 | + string equip_id = 1; | |
| 26 | +} | |
| 27 | + | |
| 28 | +message EquipmentEnhanceRsp { | |
| 29 | + models.Equipment equip = 1; | |
| 30 | +} | |
| 31 | + | |
| 32 | +message EquipmentSetGemReq { | |
| 33 | + string equip_id = 1; | |
| 34 | + string gem_id = 2; | |
| 35 | +} | |
| 36 | + | |
| 37 | +message EquipmentSetGemRsp { | |
| 38 | + string equip_id = 1; | |
| 39 | + string gem_ids = 2; | |
| 40 | +} | |
| 41 | + | |
| 42 | +message EquipmentDelGemReq { | |
| 43 | + string equip_id = 1; | |
| 44 | + string gem_id = 2; | |
| 45 | +} | |
| 46 | + | |
| 47 | +message EquipmentDelGemRsp { | |
| 48 | + string equip_id = 1; | |
| 49 | + string gem_ids = 2; | |
| 50 | + string reward = 3; | |
| 51 | +} | |
| 52 | + | ... | ... |
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +syntax = "proto3"; | |
| 2 | +option go_package = "../pb;pb"; | |
| 3 | + | |
| 4 | +package game; | |
| 5 | +//import "google/protobuf/empty.proto"; | |
| 6 | +import "models.proto"; | |
| 7 | + | |
| 8 | +// rpc = req + rsp 请求/返回 | |
| 9 | +// rpc = rar + rar 自回包 | |
| 10 | + | |
| 11 | + | |
| 12 | +message GemSliceReq { | |
| 13 | + string slot_id = 1; | |
| 14 | + map<string,int32> costs = 2; | |
| 15 | + int32 attention_id = 3; | |
| 16 | +} | |
| 17 | + | |
| 18 | +message GemSliceRsp { | |
| 19 | + models.GemSlot gem_slot = 1; | |
| 20 | +} | |
| 21 | + | |
| 22 | +message GemSliceStopReq { | |
| 23 | + string slot_id = 1; | |
| 24 | +} | |
| 25 | + | |
| 26 | +message GemSliceStopRsp { | |
| 27 | + models.GemSlot gem_slot = 1; | |
| 28 | +} | |
| 29 | + | |
| 30 | +message GemAttentionReq { | |
| 31 | + string slot_id = 1; | |
| 32 | +} | |
| 33 | + | |
| 34 | +message GemAttentionRsp { | |
| 35 | + string slot_id = 1; | |
| 36 | + repeated int32 attentions = 2; | |
| 37 | +} | |
| 38 | + | |
| 39 | +message GemSliceRewardReq { | |
| 40 | + string slot_id = 1; | |
| 41 | + int32 draw_type = 2; | |
| 42 | +} | |
| 43 | + | |
| 44 | +message GemSliceRewardRsp { | |
| 45 | + string reward = 1; | |
| 46 | +} | |
| 47 | + | |
| 48 | +message ItemGemCompoundReq { | |
| 49 | + int32 gem_id = 1; | |
| 50 | + int32 gem_count = 2; | |
| 51 | +} | |
| 52 | + | |
| 53 | +message ItemGemCompoundRsp { | |
| 54 | + string reward = 3; | |
| 55 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,59 @@ |
| 1 | +syntax = "proto3"; | |
| 2 | +option go_package = "../pb;pb"; | |
| 3 | + | |
| 4 | +package game; | |
| 5 | +//import "google/protobuf/empty.proto"; | |
| 6 | +import "models.proto"; | |
| 7 | + | |
| 8 | +// rpc = req + rsp 请求/返回 | |
| 9 | +// rpc = rar + rar 自回包 | |
| 10 | + | |
| 11 | +message EquipInfo { | |
| 12 | + string equipId = 1; | |
| 13 | + int32 pos = 2; | |
| 14 | +} | |
| 15 | + | |
| 16 | +message HeroEquipReferRar { | |
| 17 | + repeated EquipInfo equipIds = 1; | |
| 18 | + string hero_id = 2; | |
| 19 | + bool refer = 3; //true 穿戴, false 脱下 | |
| 20 | +} | |
| 21 | + | |
| 22 | +message HeroFragmentCovertReq { | |
| 23 | + string hero_id = 1; | |
| 24 | +} | |
| 25 | + | |
| 26 | +message HeroFragmentCovertRsp { | |
| 27 | + models.Hero hero = 1; | |
| 28 | +} | |
| 29 | + | |
| 30 | + | |
| 31 | +message HeroUpLevelReq { | |
| 32 | + string heroId = 1; | |
| 33 | + string items = 2; // [itemId1=count1, itemId2=count2] | |
| 34 | +} | |
| 35 | + | |
| 36 | +message HeroUpLevelRsp { | |
| 37 | + models.Hero hero = 1; | |
| 38 | +} | |
| 39 | + | |
| 40 | +message HeroReinReq { | |
| 41 | + string hero_id = 1; | |
| 42 | +} | |
| 43 | + | |
| 44 | +message HeroReinRsp { | |
| 45 | + models.Hero hero = 1; | |
| 46 | +} | |
| 47 | + | |
| 48 | +message HeroSkillUpLevelReq { | |
| 49 | + string hero_id = 1; | |
| 50 | + int32 skill_id = 2; | |
| 51 | + int32 skill_type = 3; | |
| 52 | +} | |
| 53 | + | |
| 54 | +message HeroSkillUpLevelRsp { | |
| 55 | + string hero_id = 1; | |
| 56 | + int32 skill_id = 2; | |
| 57 | + int32 skill_level = 3; | |
| 58 | + int32 rein_point = 4; | |
| 59 | +} | ... | ... |
protocode.proto
| ... | ... | @@ -6,53 +6,57 @@ package protocode; |
| 6 | 6 | enum ProtoCode |
| 7 | 7 | { |
| 8 | 8 | UNKNOWN = 0; |
| 9 | - HeartRpc = 501; | |
| 10 | - LoginRpc = 502; | |
| 11 | - CreateRpc = 503; | |
| 12 | - ChangeTeamRpc = 504; | |
| 13 | - HeroEquipReferRpc = 505; | |
| 14 | - RoleClearItemsRpc = 506; | |
| 15 | - RoleStartBattleRpc = 507; | |
| 16 | - RoleEndBattleRpc = 508; | |
| 17 | - RoleGuideRpc = 509; | |
| 18 | - RoleTaskRpc = 510; | |
| 19 | - RoleOpenBoxRpc = 511; | |
| 20 | - RoleBuffRpc = 512; | |
| 21 | - RoleResetChapterRpc = 513; | |
| 22 | - RoleCostRpc = 514; | |
| 23 | - EquipmentDelRpc = 515; | |
| 24 | - EquipmentEnhanceRpc = 516; | |
| 25 | - HeroUpLevelRpc = 517; | |
| 26 | - HeroReinRpc = 518; | |
| 27 | - HeroSkillUpLevelRpc = 519; | |
| 28 | - EmailListRpc = 520; | |
| 29 | - EmailDrawRpc = 521; | |
| 30 | - EmailCheckRpc = 522; | |
| 31 | - EmailDelRpc = 523; | |
| 32 | - StoreBuyRpc = 524; | |
| 33 | - HeroFragmentCovertRpc = 525; | |
| 34 | - RoleLogOutRpc = 526; | |
| 35 | - RoleDrawCardRpc = 527; | |
| 36 | - RoleCdKeyRpc = 528; | |
| 37 | - RoleStartClimbRpc = 529; | |
| 38 | - RoleMiddleClimbRpc = 530; | |
| 39 | - RoleEndClimbRpc = 531; | |
| 40 | - RoleRankClimbRpc = 532; | |
| 41 | - EquipmentSetGemRpc = 533; | |
| 42 | - EquipmentDelGemRpc = 534; | |
| 43 | - ItemGemCompoundRpc = 535; | |
| 44 | - GemSliceRpc = 536; | |
| 45 | - GemSliceStopRpc = 537; | |
| 46 | - GemAttentionRpc = 538; | |
| 47 | - GemSliceRewardRpc = 539; | |
| 9 | + HeartRpc = 101; | |
| 10 | + LoginRpc = 102; | |
| 11 | + CreateRpc = 103; | |
| 12 | + ChangeTeamRpc = 104; | |
| 13 | + RoleClearItemsRpc = 105; | |
| 14 | + RoleStartBattleRpc = 106; | |
| 15 | + RoleEndBattleRpc = 107; | |
| 16 | + RoleGuideRpc = 108; | |
| 17 | + RoleTaskRpc = 109; | |
| 18 | + RoleOpenBoxRpc = 110; | |
| 19 | + RoleBuffRpc = 111; | |
| 20 | + RoleResetChapterRpc = 112; | |
| 21 | + RoleCostRpc = 113; | |
| 22 | + RoleLogOutRpc = 114; | |
| 23 | + RoleDrawCardRpc = 115; | |
| 24 | + RoleCdKeyRpc = 116; | |
| 25 | + RoleStartClimbRpc = 117; | |
| 26 | + RoleMiddleClimbRpc = 118; | |
| 27 | + RoleEndClimbRpc = 119; | |
| 28 | + RoleRankClimbRpc = 120; | |
| 29 | + | |
| 30 | + HeroEquipReferRpc = 201; | |
| 31 | + HeroFragmentCovertRpc = 202; | |
| 32 | + HeroUpLevelRpc = 203; | |
| 33 | + HeroReinRpc = 204; | |
| 34 | + HeroSkillUpLevelRpc = 205; | |
| 35 | + | |
| 36 | + EmailListRpc = 301; | |
| 37 | + EmailDrawRpc = 302; | |
| 38 | + EmailCheckRpc = 303; | |
| 39 | + EmailDelRpc = 304; | |
| 40 | + | |
| 41 | + EquipmentDelRpc = 401; | |
| 42 | + EquipmentEnhanceRpc = 402; | |
| 43 | + EquipmentSetGemRpc = 403; | |
| 44 | + EquipmentDelGemRpc = 404; | |
| 45 | + | |
| 46 | + StoreBuyRpc = 501; | |
| 47 | + | |
| 48 | + GemSliceRpc = 601; | |
| 49 | + GemSliceStopRpc = 602; | |
| 50 | + GemAttentionRpc = 603; | |
| 51 | + GemSliceRewardRpc = 604; | |
| 52 | + ItemGemCompoundRpc = 605; | |
| 53 | + | |
| 48 | 54 | |
| 49 | 55 | DisConnectNty = 1001; |
| 50 | 56 | RoleUpdatePropertyNty = 1002; |
| 51 | 57 | RoleUpdateItemsNty = 1003; |
| 52 | - EquipmentAddNty = 1004; | |
| 53 | - EmailNewNty = 1005; | |
| 58 | + EmailNewNty = 1004; | |
| 59 | + EquipmentAddNty = 1005; | |
| 54 | 60 | StoreUpdatePropertyNty = 1006; |
| 55 | 61 | |
| 56 | - | |
| 57 | - | |
| 58 | 62 | } |
| 59 | 63 | \ No newline at end of file | ... | ... |
game.proto renamed to role.proto
| ... | ... | @@ -43,17 +43,6 @@ message ChangeTeamRar { |
| 43 | 43 | repeated models.Team team = 1; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -message EquipInfo { | |
| 47 | - string equipId = 1; | |
| 48 | - int32 pos = 2; | |
| 49 | -} | |
| 50 | - | |
| 51 | -message HeroEquipReferRar { | |
| 52 | - repeated EquipInfo equipIds = 1; | |
| 53 | - string hero_id = 2; | |
| 54 | - bool refer = 3; //true 穿戴, false 脱下 | |
| 55 | -} | |
| 56 | - | |
| 57 | 46 | message RoleUpdatePropertyNty { |
| 58 | 47 | repeated string keys = 1; |
| 59 | 48 | models.Role role = 2; |
| ... | ... | @@ -134,110 +123,6 @@ message RoleCostRsp { |
| 134 | 123 | int32 cur = 1; |
| 135 | 124 | } |
| 136 | 125 | |
| 137 | -message EquipmentDelReq { | |
| 138 | - repeated string id = 1; | |
| 139 | -} | |
| 140 | - | |
| 141 | -message EquipmentDelRsp { | |
| 142 | - map<string,int32> reward = 1; | |
| 143 | -} | |
| 144 | - | |
| 145 | -message EquipmentAddNty { | |
| 146 | - models.Equipment equip = 1; | |
| 147 | -} | |
| 148 | - | |
| 149 | -message EquipmentEnhanceReq { | |
| 150 | - string equip_id = 1; | |
| 151 | -} | |
| 152 | - | |
| 153 | -message EquipmentEnhanceRsp { | |
| 154 | - models.Equipment equip = 1; | |
| 155 | -} | |
| 156 | - | |
| 157 | -message HeroUpLevelReq { | |
| 158 | - string heroId = 1; | |
| 159 | - string items = 2; // [itemId1=count1, itemId2=count2] | |
| 160 | -} | |
| 161 | - | |
| 162 | -message HeroUpLevelRsp { | |
| 163 | - models.Hero hero = 1; | |
| 164 | -} | |
| 165 | - | |
| 166 | -message HeroReinReq { | |
| 167 | - string hero_id = 1; | |
| 168 | -} | |
| 169 | - | |
| 170 | -message HeroReinRsp { | |
| 171 | - models.Hero hero = 1; | |
| 172 | -} | |
| 173 | - | |
| 174 | -message HeroSkillUpLevelReq { | |
| 175 | - string hero_id = 1; | |
| 176 | - int32 skill_id = 2; | |
| 177 | - int32 skill_type = 3; | |
| 178 | -} | |
| 179 | - | |
| 180 | -message HeroSkillUpLevelRsp { | |
| 181 | - string hero_id = 1; | |
| 182 | - int32 skill_id = 2; | |
| 183 | - int32 skill_level = 3; | |
| 184 | - int32 rein_point = 4; | |
| 185 | -} | |
| 186 | - | |
| 187 | -message EmailListReq { | |
| 188 | -} | |
| 189 | - | |
| 190 | -message EmailListRsp { | |
| 191 | - repeated models.Email emails = 1; | |
| 192 | -} | |
| 193 | - | |
| 194 | -message EmailDrawReq { | |
| 195 | - string id = 1; | |
| 196 | -} | |
| 197 | - | |
| 198 | -message EmailDrawRsp { | |
| 199 | - repeated string ids = 1; | |
| 200 | - string reward = 2; | |
| 201 | -} | |
| 202 | - | |
| 203 | -message EmailCheckRar { | |
| 204 | - string id = 1; | |
| 205 | -} | |
| 206 | - | |
| 207 | -message EmailDelReq { | |
| 208 | -} | |
| 209 | - | |
| 210 | -message EmailDelRsp { | |
| 211 | - repeated string ids = 1; | |
| 212 | -} | |
| 213 | - | |
| 214 | -message EmailNewNty { | |
| 215 | - models.Email email = 1; | |
| 216 | -} | |
| 217 | - | |
| 218 | -message StoreBuyReq { | |
| 219 | - int32 typ = 1; | |
| 220 | - int32 id = 2; | |
| 221 | - int32 count = 3; | |
| 222 | -} | |
| 223 | - | |
| 224 | -message StoreBuyRsp { | |
| 225 | - string reward = 1; | |
| 226 | -} | |
| 227 | - | |
| 228 | -message StoreUpdatePropertyNty { | |
| 229 | - repeated string keys = 1; // 键 名字 | |
| 230 | - models.Store store = 2; | |
| 231 | -} | |
| 232 | - | |
| 233 | -message HeroFragmentCovertReq { | |
| 234 | - string hero_id = 1; | |
| 235 | -} | |
| 236 | - | |
| 237 | -message HeroFragmentCovertRsp { | |
| 238 | - models.Hero hero = 1; | |
| 239 | -} | |
| 240 | - | |
| 241 | 126 | message RoleLogOutRar { |
| 242 | 127 | } |
| 243 | 128 | |
| ... | ... | @@ -294,74 +179,3 @@ message RoleEndClimbRsp { |
| 294 | 179 | message RoleRankClimbReq { |
| 295 | 180 | int32 chapter_id = 1; |
| 296 | 181 | } |
| 297 | - | |
| 298 | -message RoleRankClimbRsp { | |
| 299 | - repeated models.RankClimb rank = 1; | |
| 300 | -} | |
| 301 | - | |
| 302 | -message EquipmentSetGemReq { | |
| 303 | - string equip_id = 1; | |
| 304 | - string gem_id = 2; | |
| 305 | -} | |
| 306 | - | |
| 307 | -message EquipmentSetGemRsp { | |
| 308 | - string equip_id = 1; | |
| 309 | - string gem_ids = 2; | |
| 310 | -} | |
| 311 | - | |
| 312 | -message EquipmentDelGemReq { | |
| 313 | - string equip_id = 1; | |
| 314 | - string gem_id = 2; | |
| 315 | -} | |
| 316 | - | |
| 317 | -message EquipmentDelGemRsp { | |
| 318 | - string equip_id = 1; | |
| 319 | - string gem_ids = 2; | |
| 320 | - string reward = 3; | |
| 321 | -} | |
| 322 | - | |
| 323 | - | |
| 324 | -message ItemGemCompoundReq { | |
| 325 | - int32 gem_id = 1; | |
| 326 | - int32 gem_count = 2; | |
| 327 | -} | |
| 328 | - | |
| 329 | -message ItemGemCompoundRsp { | |
| 330 | - string reward = 3; | |
| 331 | -} | |
| 332 | - | |
| 333 | -message GemSliceReq { | |
| 334 | - string slot_id = 1; | |
| 335 | - map<string,int32> costs = 2; | |
| 336 | - int32 attention_id = 3; | |
| 337 | -} | |
| 338 | - | |
| 339 | -message GemSliceRsp { | |
| 340 | - models.GemSlot gem_slot = 1; | |
| 341 | -} | |
| 342 | - | |
| 343 | -message GemSliceStopReq { | |
| 344 | - string slot_id = 1; | |
| 345 | -} | |
| 346 | - | |
| 347 | -message GemSliceStopRsp { | |
| 348 | - models.GemSlot gem_slot = 1; | |
| 349 | -} | |
| 350 | - | |
| 351 | -message GemAttentionReq { | |
| 352 | - string slot_id = 1; | |
| 353 | -} | |
| 354 | - | |
| 355 | -message GemAttentionRsp { | |
| 356 | - string slot_id = 1; | |
| 357 | - repeated int32 attentions = 2; | |
| 358 | -} | |
| 359 | - | |
| 360 | -message GemSliceRewardReq { | |
| 361 | - string slot_id = 1; | |
| 362 | - int32 draw_type = 2; | |
| 363 | -} | |
| 364 | - | |
| 365 | -message GemSliceRewardRsp { | |
| 366 | - string reward = 1; | |
| 367 | -} | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +syntax = "proto3"; | |
| 2 | +option go_package = "../pb;pb"; | |
| 3 | + | |
| 4 | +package game; | |
| 5 | +//import "google/protobuf/empty.proto"; | |
| 6 | +import "models.proto"; | |
| 7 | + | |
| 8 | +// rpc = req + rsp 请求/返回 | |
| 9 | +// rpc = rar + rar 自回包 | |
| 10 | + | |
| 11 | + | |
| 12 | +message StoreBuyReq { | |
| 13 | + int32 typ = 1; | |
| 14 | + int32 id = 2; | |
| 15 | + int32 count = 3; | |
| 16 | +} | |
| 17 | + | |
| 18 | +message StoreBuyRsp { | |
| 19 | + string reward = 1; | |
| 20 | +} | |
| 21 | + | |
| 22 | +message StoreUpdatePropertyNty { | |
| 23 | + repeated string keys = 1; // 键 名字 | |
| 24 | + models.Store store = 2; | |
| 25 | +} | ... | ... |