@@ -17,32 +17,36 @@ message MessageOfCharacter
1717 CharacterState character_active_state = 5 ;
1818
1919 // 位置
20- int32 x = 17 ;
21- int32 y = 18 ;
20+ int32 x = 6 ;
21+ int32 y = 7 ;
2222
23- double facing_direction = 19 ;
24- int32 speed = 20 ;
25- int32 view_range = 21 ;
23+ double facing_direction = 8 ;
24+ int32 speed = 9 ;
25+ int32 view_range = 10 ;
2626
27- int32 common_attack = 22 ;
28- int64 common_attack_cd = 23 ;
29- int32 common_attack_range = 24 ;
27+ int32 common_attack = 11 ;
28+ int64 common_attack_cd = 12 ;
29+ int32 common_attack_range = 13 ;
3030
31- int32 hp = 28 ;
31+ int32 hp = 14 ;
32+
33+ int32 carry_capacity = 15 ; // 负重上限,产品数量为单位
34+ int32 current_load = 16 ; // 当前负重
35+ int32 harvest_rate_per_sec = 17 ; // 每秒采集量
3236}
3337
3438
3539message MessageOfMaterialResource
3640{
37- MaterialResourceState material_resource_state = 2 ;
38-
39- int32 x = 3 ;
40- int32 y = 4 ;
41+ MaterialResourceState material_resource_state = 1 ;
4142
42- int32 process = 5 ; // 采集进度 等价于血量
43+ int32 x = 2 ;
44+ int32 y = 3 ;
4345
44- int32 id = 6 ;
46+ int32 remaining_amount = 4 ; // 采集进度 等价于血量
4547
48+ int32 id = 5 ;
49+ int32 max_amount = 6 ;
4650}
4751
4852message MessageOfMap
@@ -65,49 +69,95 @@ message MessageOfTeam
6569// int64 guid=5;
6670}
6771
72+ message MessageOfFactory
73+ {
74+ int64 factory_id = 1 ;
75+ int64 team_id = 2 ;
76+ int32 x = 3 ;
77+ int32 y = 4 ;
78+ int32 hp = 5 ;
79+ message ProductStack
80+ {
81+ int32 product_type = 1 ;
82+ int32 quantity = 2 ;
83+ }
84+ repeated ProductStack product_inventory = 6 ; //
85+ int32 producing_line_count = 7 ; // 生产线数量
86+ }
87+
88+ message MessageOfMarket
89+ {
90+ int64 market_id = 1 ;
91+ int32 x = 2 ;
92+ int32 y = 3 ;
93+ bool high_value = 4 ; // 是否为高额市场
94+ message PriceEntry
95+ {
96+ ProductType product_type = 1 ;
97+ int32 price = 2 ;
98+ }
99+ repeated PriceEntry price_list = 5 ;
100+ }
101+
102+ message MessageOfComputeCenter
103+ {
104+ int64 center_id = 1 ;
105+ int32 x = 2 ;
106+ int32 y = 3 ;
107+ int64 owner_team_id = 4 ; // 0表示无人占领
108+ int32 occupy_progress = 5 ; // 占领进度
109+ }
110+
68111message MessageOfObj
69112{
70113 oneof message_of_obj
71114 {
72115 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 ;
116+ MessageOfMaterialResource material_resource_message = 2 ;
117+ MessageOfMap map_message = 3 ;
118+ MessageOfNews news_message = 4 ;
119+ MessageOfTeam team_message = 5 ;
120+ MessageOfFactory factory_message = 6 ;
121+ MessageOfMarket market_message = 7 ;
122+ MessageOfComputeCenter compute_center_message = 8 ;
123+ MessageOfAIEvent ai_event_message = 9 ; //服务器推送的AI事件/建议
77124 }
78125}
79126
80- message MessageOfAll
127+ // 智慧大脑事件
128+ message MessageOfAIEvent
81129{
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 ;
130+ int64 team_id = 1 ;
131+ int64 from_character_id = 2 ; // 触发来源(可选)
132+ AIEventType event_type = 3 ; // 事件类型
133+ string description = 4 ; // 人类可读说明
134+ string plan_json = 5 ; // 结构化计划(JSON),客户端可以解析执行
135+ int64 timestamp_ms = 6 ; // 事件触发时间(ms),便于回放
136+ int64 event_id = 7 ; // 事件id, 便于追踪
137+ }
88138
89- int32 team1_material = 4 ;
90- int32 team2_material = 4 ;
91- int32 team3_material = 4 ;
92- int32 team4_material = 4 ;
139+ message MessageOfAll
140+ {
141+ int32 game_time = 1 ;
93142
94- int32 team1_computing_power = 5 ;
95- int32 team2_computing_power = 5 ;
96- int32 team3_computing_power = 5 ;
97- int32 team4_computing_power = 5 ;
143+ message TeamInfo {
144+ int32 score = 1 ;
145+ int32 material = 2 ;
146+ int32 computing_power = 3 ;
147+ int32 factory_hp = 4 ;
148+ }
98149
99- int32 team1_factory_hp = 6 ;
100- int32 team2_factory_hp = 6 ;
101- int32 team3_factory_hp = 6 ;
102- int32 team4_factory_hp = 6 ;
150+ repeated TeamInfo teams = 2 ; // teams[0] 对应 team1,teams[1] 对应 team2 ...
151+ }
103152
104- }
105153
106154message MessageToClient
107155{
108156 repeated MessageOfObj obj_message = 1 ;
109157 GameState game_state = 2 ;
110- MessageOfAll all_message = 3 ;
158+ protobuf.GameMode game_mode = 3 ;
159+ MessageOfAll all_message = 4 ;
160+ // MessageGameConfig config = 5; // 可用于下发对局参数
111161}
112162
113163message MoveRes // 如果打算设计撞墙保留平行速度分量,且需要返回值则可用这个(大概没啥用)
0 commit comments