Commit 0d8153337a56dbab34397aac2efe0b93e9d96b78
1 parent
b0645398
ReponseCmd 改成 RpcCode,先用注释查找对应的协议号
Rpc 结尾 代表消息自发自回,自动查询对应的协议号 Nty 结尾 自动查找同名的协议号。
Showing
1 changed file
with
19 additions
and
23 deletions
Show diff stats
game.proto
| ... | ... | @@ -5,32 +5,31 @@ package game; |
| 5 | 5 | //import "google/protobuf/empty.proto"; |
| 6 | 6 | import "models.proto"; |
| 7 | 7 | |
| 8 | -//ResponseCmd HeartRsp | |
| 8 | +//RpcCode HeartRpc | |
| 9 | 9 | message HeartReq { |
| 10 | 10 | int64 code = 1; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | +//RpcCode HeartRpc | |
| 13 | 14 | message HeartRsp { |
| 14 | 15 | int64 code = 1; |
| 15 | 16 | } |
| 16 | 17 | |
| 17 | -//ResponseCmd RoleRsp | |
| 18 | +//RpcCode LoginRpc | |
| 18 | 19 | message LoginReq { |
| 19 | 20 | string token = 1; |
| 20 | 21 | string device = 2; |
| 21 | 22 | } |
| 22 | 23 | |
| 23 | -//ResponseCmd CreateReq | |
| 24 | -message CreateReq { | |
| 24 | +message CreateRpc { | |
| 25 | 25 | string token = 1; |
| 26 | 26 | string device = 2; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -message DisConnectNty{ | |
| 29 | +message DisConnectNty { | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -//ResponseCmd ChangeTeamReq | |
| 33 | -message ChangeTeamReq { | |
| 32 | +message ChangeTeamRpc { | |
| 34 | 33 | repeated models.Team team = 1; |
| 35 | 34 | } |
| 36 | 35 | |
| ... | ... | @@ -39,42 +38,40 @@ message EquipInfo { |
| 39 | 38 | int32 pos = 2; |
| 40 | 39 | } |
| 41 | 40 | |
| 42 | -//ResponseCmd HeroEquipReferReq | |
| 43 | -message HeroEquipReferReq { | |
| 41 | +message HeroEquipReferRpc { | |
| 44 | 42 | repeated EquipInfo equipIds = 1; |
| 45 | 43 | string hero_id = 2; |
| 46 | 44 | bool refer = 3; //true 穿戴, false 脱下 |
| 47 | 45 | } |
| 48 | 46 | |
| 49 | -message RoleRsp { | |
| 47 | +//RpcCode LoginRpc | |
| 48 | +message LoginRsp { | |
| 50 | 49 | models.Role role = 2; |
| 51 | 50 | repeated models.Hero hero = 3; |
| 52 | 51 | repeated models.Team team = 4; |
| 53 | 52 | repeated models.Equipment equipments = 5; |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | -//ResponseCmd RoleUpdatePropertyNty | |
| 57 | -message RoleUpdatePropertyNty{ | |
| 55 | +message RoleUpdatePropertyNty { | |
| 58 | 56 | repeated int32 id = 1; |
| 59 | 57 | models.Role role = 2; |
| 60 | 58 | } |
| 61 | 59 | |
| 62 | -//ResponseCmd RoleUpdateItemsNty | |
| 63 | -message RoleUpdateItemsNty{ | |
| 60 | +message RoleUpdateItemsNty { | |
| 64 | 61 | string items = 1; |
| 65 | 62 | } |
| 66 | 63 | |
| 67 | -//ResponseCmd RoleClearItemsReq | |
| 68 | -message RoleClearItemsReq { | |
| 64 | +message RoleClearItemsRpc { | |
| 69 | 65 | repeated string items = 1; |
| 70 | 66 | } |
| 71 | 67 | |
| 68 | +//RpcCode RoleStartBattleRpc | |
| 72 | 69 | message RoleStartBattleReq { |
| 73 | 70 | int32 chapter_id = 1; |
| 74 | 71 | int32 carbon_id = 2; |
| 75 | 72 | } |
| 76 | 73 | |
| 77 | -//ResponseCmd RoleEndBattleRsp | |
| 74 | +//RpcCode RoleEndBattleRpc | |
| 78 | 75 | message RoleEndBattleReq { |
| 79 | 76 | int32 chapter_id = 1; |
| 80 | 77 | int32 carbon_id = 2; |
| ... | ... | @@ -82,7 +79,7 @@ message RoleEndBattleReq { |
| 82 | 79 | string team_id = 4; |
| 83 | 80 | } |
| 84 | 81 | |
| 85 | -//ResponseCmd RoleEndBattleRsp | |
| 82 | +//RpcCode RoleEndBattleRpc | |
| 86 | 83 | message RoleEndBattleRsp { |
| 87 | 84 | int32 role_level = 1; |
| 88 | 85 | int32 role_exp = 2; |
| ... | ... | @@ -92,22 +89,21 @@ message RoleEndBattleRsp { |
| 92 | 89 | repeated models.Hero hero = 6; |
| 93 | 90 | } |
| 94 | 91 | |
| 95 | -//ResponseCmd EquipmentDelReq | |
| 96 | -message EquipmentDelReq { | |
| 92 | +message EquipmentDelRpc { | |
| 97 | 93 | repeated string id = 1; |
| 98 | 94 | } |
| 99 | 95 | |
| 100 | -//ResponseCmd EquipmentAddRsp | |
| 101 | -message EquipmentAddNty{ | |
| 96 | +message EquipmentAddNty { | |
| 102 | 97 | models.Equipment equip = 1; |
| 103 | 98 | } |
| 104 | 99 | |
| 105 | -//ResponseCmd HeroUpLevelRsp | |
| 100 | +//RpcCode HeroUpLevelRpc | |
| 106 | 101 | message HeroUpLevelReq { |
| 107 | 102 | string heroId = 1; |
| 108 | 103 | string items = 2; // [itemId1=count1, itemId2=count2] |
| 109 | 104 | } |
| 110 | 105 | |
| 106 | +//RpcCode HeroUpLevelRpc | |
| 111 | 107 | message HeroUpLevelRsp { |
| 112 | 108 | models.Hero hero = 1; |
| 113 | 109 | } |
| 114 | 110 | \ No newline at end of file | ... | ... |