|
| 1 | +// Message2Client |
| 2 | +syntax = "proto3"; |
| 3 | +package protobuf; |
| 4 | + |
| 5 | +import "MessageType.proto"; |
| 6 | + |
| 7 | +message MessageOfCharacter |
| 8 | +{ |
| 9 | + int64 guid = 1; |
| 10 | + |
| 11 | + int64 team_id = 2; |
| 12 | + int64 player_id = 3; |
| 13 | + |
| 14 | + CharacterType character_type = 4; |
| 15 | + |
| 16 | + // 主动状态 |
| 17 | + CharacterState character_active_state = 5; |
| 18 | + |
| 19 | + // 位置 |
| 20 | + int32 x = 17; |
| 21 | + int32 y = 18; |
| 22 | + |
| 23 | + double facing_direction = 19; |
| 24 | + int32 speed = 20; |
| 25 | + int32 view_range = 21; |
| 26 | + |
| 27 | + int32 common_attack = 22; |
| 28 | + int64 common_attack_cd = 23; |
| 29 | + int32 common_attack_range = 24; |
| 30 | + |
| 31 | + int32 hp = 28; |
| 32 | +} |
| 33 | + |
| 34 | + |
| 35 | +message MessageOfMaterialResource |
| 36 | +{ |
| 37 | + MaterialResourceState material_resource_state = 2; |
| 38 | + |
| 39 | + int32 x = 3; |
| 40 | + int32 y = 4; |
| 41 | + |
| 42 | + int32 process = 5; // 采集进度 等价于血量 |
| 43 | + |
| 44 | + int32 id = 6; |
| 45 | + |
| 46 | +} |
| 47 | + |
| 48 | +message MessageOfMap |
| 49 | +{ |
| 50 | + uint32 height = 1; |
| 51 | + uint32 width = 2; |
| 52 | + message Row |
| 53 | + { |
| 54 | + repeated PlaceType cols = 1; |
| 55 | + } |
| 56 | + repeated Row rows = 3; |
| 57 | +} |
| 58 | + |
| 59 | +message MessageOfTeam |
| 60 | +{ |
| 61 | + int64 team_id = 1; |
| 62 | + int64 player_id = 2; |
| 63 | + int64 score = 3; |
| 64 | + int64 energy = 4; |
| 65 | +// int64 guid=5; |
| 66 | +} |
| 67 | + |
| 68 | +message MessageOfObj |
| 69 | +{ |
| 70 | + oneof message_of_obj |
| 71 | + { |
| 72 | + MessageOfCharacter character_message = 1; |
| 73 | + MessageOfMaterialResource material_resource_message= 6; |
| 74 | + MessageOfMap map_message = 8; |
| 75 | + MessageOfNews news_message = 9; |
| 76 | + MessageOfTeam team_message = 10; |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +message MessageOfAll |
| 81 | +{ |
| 82 | + int32 game_time = 1; |
| 83 | + |
| 84 | + int32 team1_score=2; |
| 85 | + int32 team2_score=3; |
| 86 | + int32 team3_score=3; |
| 87 | + int32 team4_score=3; |
| 88 | + |
| 89 | + int32 team1_material = 4; |
| 90 | + int32 team2_material = 4; |
| 91 | + int32 team3_material = 4; |
| 92 | + int32 team4_material = 4; |
| 93 | + |
| 94 | + int32 team1_computing_power = 5; |
| 95 | + int32 team2_computing_power = 5; |
| 96 | + int32 team3_computing_power = 5; |
| 97 | + int32 team4_computing_power = 5; |
| 98 | + |
| 99 | + int32 team1_factory_hp = 6; |
| 100 | + int32 team2_factory_hp = 6; |
| 101 | + int32 team3_factory_hp = 6; |
| 102 | + int32 team4_factory_hp = 6; |
| 103 | + |
| 104 | +} |
| 105 | + |
| 106 | +message MessageToClient |
| 107 | +{ |
| 108 | + repeated MessageOfObj obj_message = 1; |
| 109 | + GameState game_state = 2; |
| 110 | + MessageOfAll all_message = 3; |
| 111 | +} |
| 112 | + |
| 113 | +message MoveRes // 如果打算设计撞墙保留平行速度分量,且需要返回值则可用这个(大概没啥用) |
| 114 | +{ |
| 115 | + int64 actual_speed = 1; |
| 116 | + double actual_angle = 2; |
| 117 | + bool act_success = 3; |
| 118 | +} |
| 119 | + |
| 120 | +message CreatCharacterRes |
| 121 | +{ |
| 122 | + bool act_success = 1; |
| 123 | + int64 player_id = 2; |
| 124 | +} |
| 125 | + |
| 126 | +message BoolRes |
| 127 | +{ |
| 128 | + bool act_success = 1; |
| 129 | +} |
| 130 | + |
| 131 | +message CharacterInfoRes |
| 132 | +{ |
| 133 | + repeated MessageOfCharacter Character_info = 1; |
| 134 | +} |
| 135 | + |
| 136 | +message EcoRes |
| 137 | +{ |
| 138 | + int64 economy = 1; |
| 139 | +} |
| 140 | + |
| 141 | +message MessageOfNews |
| 142 | +{ |
| 143 | + oneof news // 一条新闻 |
| 144 | + { |
| 145 | + string text_message = 1; |
| 146 | + bytes binary_message = 2; |
| 147 | + } |
| 148 | + int64 from_id = 3; |
| 149 | + int64 to_id = 4; |
| 150 | + int64 team_id = 5; |
| 151 | +} |
| 152 | +// message MsgRes // 用于获取队友发来的消息 |
| 153 | +// { |
| 154 | +// bool have_message = 1; // 是否有待接收的消息 |
| 155 | +// int64 from_player_id = 2; |
| 156 | +// string message_received = 3; |
| 157 | +// } |
0 commit comments