Removed silencing of gtk warning logs from gtk3.22-client.
[freeciv.git] / common / packets.def
blob48cf333fdefbea0e7f62aea11e194a8f70bf7a7c
1 /*
3 Max used id:
4 ============
6 Max id: 253
8 Packets are not ordered by their id, but by their category. New packet
9 with higher id may get added to existing category, and not to the end of file.
10 For this reason it's important to keep information about max id currently
11 in use updated here. So we know what ids are safe to use when adding new
12 packets.
14 Range 256:511 is reserved for freeciv-web specific packets.
17 Syntax:
19 Comments:
20 =========
22 Supported are: c-style (/ * * /), c++-style (//) and python style
23 (#). Empty lines will be ignored.
25 Typedef lines:
26 ==============
28 Start with "type" and have the format "type <alias> = <src>". You
29 can now use <alias> at every place a type is expected. Nested type
30 defs are possible.
32 Packets:
33 ========
35 A packet definition starts with a header line, contains variable
36 field declarations, and ends with a single line containing the word
37 "end".
39 PACKET_<PACKET_NAME>=<packet num>; [<packet flags>]
40 <type1> <field1>; [<field flags>]
41 <type2> <field2>; [<field flags>]
42 ...
43 end
45 Header line:
46 ------------
48 The header line contains the packet name. The packet name is used
49 for the naming of the generated code struct and functions:
50 struct packet_*;
51 send_packet_*
52 dsend_packet_*
53 dlsend_packet_*
54 lsend_packet_*
55 receive_packet_*
56 handle_packet_*
58 The header line also contains the packet number. The packet number
59 is used as a numeric identification of a packet between the client
60 and server. The packet number shall never change for an existing
61 packet without the adding of a mandatory capability. Packets which
62 are used for the capability checking PACKET_PROCESSING_STARTED,
63 PACKET_PROCESSING_FINISHED, PACKET_SERVER_JOIN_REQ and
64 PACKET_SERVER_JOIN_REPLY are excluded here. These packets should
65 never change their number. The packet number can be freely chosen
66 as long as it is below 65536 and unique. For backward compatibility
67 reasons, packets used for the initial protocol (notably before
68 checking the capabilities) must be in range 0-255.
70 Packet flags:
71 -------------
73 Packet flags is a comma separated list of:
75 is-info: a second packet with the same content can be discarded
76 WARNING: this flag is dangerous and should not be used for
77 a packet that contains information that may be changed in
78 the client outside of the reception of that packet, or for
79 any packet with side effects at the client.
81 is-game-info: same as is-info, but the state is reset every time a
82 connection changes of player target.
84 force: sending functions will take an extra argument 'force_to_send'
85 to force to send the packet (at least an empty one). In this
86 case, the is-info or is-game-info flags are ignored. It has no
87 effect if the packets doesn't have the is-info or is-game-info
88 flags.
90 cancel(PACKET_number): Cancel a packet with the same key (must be the
91 same key type at the start of the packet), useful for is-info packets.
93 pre-send:
94 post-recv:
95 post-send: generate calls to pre-send, post-receive and post-send
96 hooks. These hooks are named: pre_send_packet_*,
97 post_receive_packet_* and post_send_packet_*. The user has to
98 provide these. These functions may be used to do extra
99 preparations, conversions or checks.
101 no-delta: don't use the delta protocol. This is useful for
102 packets which contain always different data
103 (packet_generic_integer) or are only sent once
104 (packet_req_join_game). Sadly this also disables the use of 0 as
105 the default value.
107 no-packet: don't generate a packet argument for the send
108 function. Currently only used by packet_generic_empty.
110 no-handle: don't generate handle_* prototypes. The generated
111 switch statements (server/srv_main_gen.c, client/civclient_gen.c)
112 doesn't include code for this packet. You have to handle this by
113 yourself. This may be required for special packets which are
114 handled early in the sequence.
116 handle-via-packet: force the packet type of the handle
117 function. Otherwise the fields are passed to the handle function.
118 This is invoked automatically for packets with more than 5 fields
119 or packets whose names are of the form foo_ruleset.
121 handle-per-conn: normally the first parameter of the handle
122 function is the player. handle-per-conn changes this to the
123 connection the packet came from.
125 dsend: request the creation of a dsend_packet_* function. This is
126 similar to a send function but instead of taking a packet struct
127 as a parameter, it takes the fields of the packet as parameters.
129 lsend: request the creation of a lsend_packet_* function. This
130 function sends to list of connections instead of just one
131 connection, which is the case for the other send functions.
133 cs: a packet which is sent from the client to the server
135 sc: a packet which is sent from the server to the client
137 Each other packet line has the format "<type> <fields>;<flags>".
139 Type:
140 ----
142 <type> is an alias or a basic type. A basic type has the format
143 "<dataio-type>(<public-type>)". Exception here is the float
144 type. You can specify with the dataio-type "float<number>" the
145 transmission of a float in a uint32 multiplied by this factor.
147 Fields:
148 -------
150 Comma seperated list of names. Each name can have zero, one or
151 two array declarations. So "x", "x[10]" and "x[20][10]" is
152 possible. The array size in the "[]" can be specified plain as a
153 term. In this case all elements will be transmitted. If this is
154 not-desired you can specify the amount of elements to be
155 transfered by given the number. So the extended format is
156 "[<full-array-size>:<elements-to-transfer>]". elements-to-transfer
157 is relative to the packet.
159 Field flags:
160 ------------
162 key: create multiple entries in the cache indexed by the key set
163 (set of all fields which have the key attribute). This allow a
164 better delta compression.
166 diff: use the array-diff feature. This will reduce the amount of
167 traffic for large arrays in which only a few elements change.
169 add-cap: only transfer this field if the given capability is
170 available at runtime. If you have a capability named
171 "new_version" a field line may look like this:
172 TILE tile; add-cap(new_version)
173 when making an optional capability mandatory, go through and remove
174 the add-cap flag for it while leaving the field intact.
176 remove-cap: don't transfer this field if the given capability is
177 available at runtime. When making an optional capability manditory,
178 go through and remove entirely any fields marked as remove-cap with
179 that capability.
182 # typedefs for numbers
183 type BOOL = bool8(bool)
184 type SFLOAT10x3 = sfloat100(float)
185 type SFLOAT10x7 = sfloat1000000(float)
186 type SINT8 = sint8(int)
187 type SINT16 = sint16(int)
188 type SINT32 = sint32(int)
189 type UFLOAT10x3 = ufloat100(float)
190 type UFLOAT = ufloat10000(float)
191 type UINT8 = uint8(int)
192 type UINT16 = uint16(int)
193 type UINT32 = uint32(int)
195 # typedefs for arrays/structs
196 type MEMORY = memory(unsigned char)
197 type REQUIREMENT = requirement(struct requirement)
198 type ACT_PROB = action_probability(struct act_prob)
199 type STRING = string(char)
200 # A string vector encoded to a string outside the packet and field system.
201 # Marking it this way is useful as documentation. The marking can also be
202 # used in non vanilla generate_packets.py packet generators.
203 type STRVEC = STRING
204 type TECH_LIST = tech_list(int)
205 type UNIT_LIST = unit_list(int)
206 type BUILDING_LIST = building_list(int)
207 type WORKLIST = worklist(struct worklist)
209 # typedefs for enums
210 type ACHIEVEMENT_TYPE = uint8(enum achievement_type)
211 type ACTIVITY = uint8(enum unit_activity)
212 type AIRLIFTING_STYLE = uint8(enum airlifting_style)
213 type PERSISTENT_READY = uint8(enum persistent_ready)
214 type VICTORY_CONDITIONS = uint8(enum victory_condition_type)
215 type TECH_UPKEEP_STYLE = uint8(enum tech_upkeep_style)
216 type AUTH_TYPE = uint8(enum authentication_type)
217 type BARBARIAN_TYPE = uint8(enum barbarian_type)
218 type BASE_GUI = uint8(enum base_gui_type)
219 type BORDERS_MODE = uint8(enum borders_mode)
220 type CLAUSE = uint8(enum clause_type)
221 type CMDLEVEL = uint8(enum cmdlevel)
222 type DIPLOMACY_MODE = uint8(enum diplomacy_mode)
223 type DIPLSTATE_TYPE = uint8(enum diplstate_type)
224 type DIRECTION = sint8(enum direction8)
225 type EFFECT_TYPE = uint8(enum effect_type)
226 type EVENT = sint16(enum event_type)
227 type GUI_TYPE = uint8(enum gui_type)
228 type IMPR_GENUS = uint8(enum impr_genus_id)
229 type KNOWN = uint8(enum known_type)
230 type MOOD = uint8(enum mood_type)
231 type ORDERS = uint8(enum unit_orders)
232 type PHASE_MODE = uint8(enum phase_mode_types)
233 type PLACE_TYPE = uint8(enum spaceship_place_type)
234 type REPORT_TYPE = uint8(enum report_type)
235 type SSET_CLASS = uint8(enum sset_class)
236 type SSET_TYPE = uint8(enum sset_type)
237 type ROAD_COMPAT = uint8(enum road_compat)
238 type FTM = uint8(enum free_tech_method)
239 type GLS = uint8(enum gameloss_style)
240 type UTYF = uint8(enum unit_type_flag_id)
241 type CBONUS_TYPE = uint8(enum combat_bonus_type)
242 type TRI = uint8(enum traderoute_illegal_cancelling)
243 type MOVE_MODE = uint8(enum road_move_mode)
244 type GEN_ACTION = uint8(enum gen_action)
245 type ACTION_DECISION = uint8(enum action_decision)
246 type REVOLENTYPE = uint8(enum revolen_type)
247 type HAPPYBORDERSTYPE = uint8(enum happyborders_type)
248 type TECH_COST_STYLE = uint8(enum tech_cost_style)
249 type TECH_LEAKAGE_STYLE = uint8(enum tech_leakage_style)
250 type GOLD_UPKEEP_STYLE = uint8(enum gold_upkeep_style)
251 type TR_BONUS_TYPE = uint8(enum traderoute_bonus_type)
253 # typedefs for bit vectors
254 type BV_EXTRA_FLAGS = bitvector(bv_extra_flags)
255 type BV_BASE_FLAGS = bitvector(bv_base_flags)
256 type BV_EXTRAS = bitvector(bv_extras)
257 type BV_BASES = bitvector(bv_bases)
258 type BV_ROADS = bitvector(bv_roads)
259 type BV_ROAD_FLAGS = bitvector(bv_road_flags)
260 type BV_CITY_OPTIONS = bitvector(bv_city_options)
261 type BV_IMPR_FLAGS = bitvector(bv_impr_flags)
262 type BV_IMPRS = bitvector(bv_imprs)
263 type BV_PLAYER = bitvector(bv_player)
264 type BV_SPECIAL = bitvector(bv_special)
265 type BV_STARTPOS_NATIONS= bitvector(bv_startpos_nations)
266 type BV_TECH_FLAGS = bitvector(bv_tech_flags)
267 type BV_TERRAIN_FLAGS = bitvector(bv_terrain_flags)
268 type BV_UCLASS_FLAGS = bitvector(bv_unit_class_flags)
269 type BV_UNIT_CLASSES = bitvector(bv_unit_classes)
270 type BV_UTYPE_FLAGS = bitvector(bv_unit_type_flags)
271 type BV_UTYPE_ROLES = bitvector(bv_unit_type_roles)
272 type BV_DISASTER_EFFECTS = bitvector(bv_disaster_effects)
273 type BV_SPACESHIP_STRUCT = bitvector(bv_spaceship_structure)
275 # typedefs for IDs
276 type EXTRA = SINT8
277 type BASE = sint8(Base_type_id)
278 type ROAD = sint8(Road_type_id)
279 type CITY = UINT16
280 # city id, with space for special values
281 type CITYSPE = SINT32
282 type CONNECTION = SINT16
283 type CONTINENT = sint16(Continent_id)
284 type GOVERNMENT = sint8(Government_type_id)
285 type IMPROVEMENT = uint8(Impr_type_id)
286 type MULTIPLIER = uint8(Multiplier_type_id)
287 type NATION = sint16(Nation_type_id)
288 type PLAYER = UINT8
289 type RESEARCH = UINT8
290 type RESOURCE = uint8(Resource_type_id)
291 type SPECIALIST = uint8(Specialist_type_id)
292 type TEAM = UINT8
293 type TECH = UINT8
294 type TERRAIN = uint8(Terrain_type_id)
295 type TILE = SINT32
296 type UNIT = UINT16
297 type UNIT_TYPE = uint8(Unit_type_id)
299 # other typedefs
300 type CITY_COORD = UINT8
301 type GOLD = UINT32
302 type HP = UINT8
303 type PERCENT = UINT8
304 type MOVEFRAGS = UINT16 # units of TERRAIN_CONTROL.move_fragments
305 type PHASE = SINT16
306 type TURN = SINT16
307 type XYSIZE = UINT16
308 type YEAR = SINT16
309 type CITIZENS = UINT8
311 /****************************************************
312 The remaining lines are the definition of the packets. These are
313 grouped together. There are the following groups:
314 General
315 Login/pregame/endgame
316 Info
317 Chat/event
318 City
319 Player
320 Unit
321 Diplomacy
322 Report
323 Connection
324 New turn
325 Spaceship
326 Ruleset
327 Scenario
328 Voting
329 Editor
330 ****************************************************/
333 /************** General packets **********************/
335 # For compatibility with older versions, this number cannot be changed.
336 # Used in initial protocol.
337 PACKET_PROCESSING_STARTED = 0; sc
340 # For compatibility with older versions, this number cannot be changed.
341 # Used in initial protocol.
342 PACKET_PROCESSING_FINISHED = 1; sc
345 /************** Login/pregame/endgame packets **********************/
347 # This packet is the first real (freeciv specific) packet send by the
348 # client. The player hasn't been accepted yet.
349 # For compatibility with older versions, this number cannot be changed.
350 # Used in initial protocol.
351 # 48 used instead of MAX_LEN_NAME to keep compatibility with old versions
352 # even if MAX_LEN_NAME changes. Similarly 512 instead of MAX_LEN_CAPSTR.
353 PACKET_SERVER_JOIN_REQ = 4; cs, dsend, no-delta, no-handle
354 STRING username[48];
355 STRING capability[512];
356 STRING version_label[48];
357 UINT32 major_version, minor_version, patch_version;
360 # ... and the server replies.
361 # For compatibility with older versions, this number cannot be changed.
362 # Used in initial protocol.
363 PACKET_SERVER_JOIN_REPLY = 5; sc, no-delta, post-send, post-recv
364 BOOL you_can_join;
365 STRING message[1536]; /* MAX_LEN_MSG */
366 STRING capability[512]; /* MAX_LEN_CAPSTR */
367 STRING challenge_file[4095]; /* MAX_LEN_PATH */
368 # clients conn id as known in server
369 CONNECTION conn_id;
372 # Used in initial protocol.
373 PACKET_AUTHENTICATION_REQ = 6; sc, handle-per-conn, dsend
374 AUTH_TYPE type;
375 STRING message[MAX_LEN_MSG]; /* explain to the client if there's a problem */
378 # Used in initial protocol.
379 PACKET_AUTHENTICATION_REPLY = 7; cs, no-handle
380 STRING password[MAX_LEN_PASSWORD];
384 PACKET_SERVER_SHUTDOWN = 8; sc, lsend
387 PACKET_NATION_SELECT_REQ = 10; cs, handle-per-conn, dsend
388 PLAYER player_no;
389 NATION nation_no;
390 BOOL is_male;
391 STRING name[MAX_LEN_NAME];
392 UINT8 style;
395 PACKET_PLAYER_READY = 11; cs, dsend
396 PLAYER player_no;
397 BOOL is_ready;
400 PACKET_ENDGAME_REPORT = 12; sc, lsend, no-delta, handle-via-packet
401 UINT8 category_num;
402 STRING category_name[32:category_num][MAX_LEN_NAME];
404 UINT8 player_num;
407 PACKET_ENDGAME_PLAYER = 223; sc, lsend, no-delta, handle-via-packet
408 UINT8 category_num;
409 PLAYER player_id;
410 UINT16 score;
411 UINT32 category_score[32:category_num];
412 BOOL winner;
415 /************** Info packets **********************/
417 # Use of is-game-info on this packet is dangerous but speeds things up
418 # greatly. Packet spam from excess sending of tiles has slowed the client
419 # greatly in the past. However see the comment on is-game-info at the top
420 # about the dangers.
421 PACKET_TILE_INFO = 15; sc, lsend, is-game-info
422 TILE tile; key
424 CONTINENT continent;
425 KNOWN known;
426 PLAYER owner;
427 PLAYER extras_owner;
428 CITY worked;
430 TERRAIN terrain;
431 RESOURCE resource;
432 BV_EXTRAS extras;
433 STRING spec_sprite[MAX_LEN_NAME];
434 STRING label[MAX_LEN_NAME];
437 # The variables in the packet are listed in alphabetical order.
438 PACKET_GAME_INFO = 16; sc, is-info
439 UINT8 add_to_size_limit;
440 UINT8 aifill;
441 PERSISTENT_READY persistent_ready;
442 AIRLIFTING_STYLE airlifting_style;
443 UINT8 angrycitizen;
444 SINT16 base_pollution;
445 UINT8 base_tech_cost;
446 UINT16 border_city_radius_sq;
447 UINT8 border_size_effect;
448 SINT16 border_city_permanent_radius_sq;
449 BORDERS_MODE borders;
450 UINT32 base_bribe_cost;
451 UINT32 culture_vic_points;
452 UINT16 culture_vic_lead;
453 UINT16 culture_migration_pml;
454 BOOL calendar_skip_0;
455 /* size limit for cities before they can celebrate */
456 UINT8 celebratesize;
457 BOOL changable_tax;
458 UINT8 pop_report_zeroes;
459 BOOL citizen_nationality;
460 UINT16 citizen_convert_speed;
461 UINT8 citizen_partisans_pct;
462 UINT8 citymindist;
463 UINT32 cooling;
464 UINT32 coolinglevel;
465 DIPLOMACY_MODE diplomacy;
466 BOOL fogofwar;
467 UINT8 food_cost;
468 UINT32 foodbox;
469 UINT8 forced_gold;
470 UINT8 forced_luxury;
471 UINT8 forced_science;
472 UINT8 fulltradesize;
473 /* True if at least one civilization has researched a tech */
474 BOOL global_advances[A_LAST]; diff
475 BOOL global_warming;
476 UINT32 globalwarming;
477 GOLD gold;
478 GOLD_UPKEEP_STYLE gold_upkeep_style;
479 REVOLENTYPE revolentype;
480 GOVERNMENT default_government_id;
481 GOVERNMENT government_during_revolution_id;
482 UINT8 granary_food_inc;
483 UINT8 granary_food_ini[MAX_GRANARY_INIS];
484 UINT8 granary_num_inis;
485 PLAYER great_wonder_owners[B_LAST]; diff
486 UINT8 happy_cost;
487 HAPPYBORDERSTYPE happyborders;
488 UINT32 heating;
489 UINT16 illness_base_factor;
490 UINT8 illness_min_size;
491 BOOL illness_on;
492 UINT16 illness_pollution_factor;
493 UINT16 illness_trade_infection;
494 UINT8 init_city_radius_sq;
495 /* If set, editing is allowed */
496 BOOL is_edit_mode;
497 /* TRUE only in pregame for "new" (not loaded) games */
498 BOOL is_new_game;
499 BOOL killcitizen;
500 BOOL killstack;
501 UINT8 min_city_center_output[O_LAST];
502 STRING negative_year_label[MAX_LEN_NAME];
503 UINT8 notradesize;
504 BOOL nuclear_winter;
505 UINT32 nuclearwinter;
506 PHASE phase;
507 PHASE_MODE phase_mode;
508 BOOL pillage_select;
509 BOOL tech_steal_allow_holes;
510 BOOL tech_trade_allow_holes;
511 BOOL tech_trade_loss_allow_holes;
512 BOOL tech_parasite_allow_holes;
513 BOOL tech_loss_allow_holes;
514 STRING positive_year_label[MAX_LEN_NAME];
515 UINT8 rapturedelay;
516 UINT16 disasters;
517 BOOL restrictinfra;
518 BOOL unreachable_protects;
519 UINT32 sciencebox;
520 UINT32 shieldbox;
521 UINT32 skill_level;
522 BOOL slow_invasions;
523 VICTORY_CONDITIONS victory_conditions;
524 BOOL team_pooled_research;
525 UINT32 tech;
526 TECH_COST_STYLE tech_cost_style;
527 TECH_LEAKAGE_STYLE tech_leakage;
528 UINT16 tech_upkeep_divider;
529 TECH_UPKEEP_STYLE tech_upkeep_style;
530 FTM free_tech_method;
531 GLS gameloss_style;
532 UINT32 timeout;
533 UINT32 first_timeout;
534 BOOL tired_attack;
535 UINT16 trademindist;
536 BOOL force_trade_route;
537 BOOL trading_city;
538 BOOL trading_gold;
539 BOOL trading_tech;
540 TURN turn;
541 UINT32 warminglevel;
542 YEAR year;
543 BOOL year_0_hack;
544 UINT16 calendar_fragments;
545 UINT16 fragment_count;
546 STRING calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME];
547 BOOL civil_war_enabled;
548 BOOL paradrop_to_transport;
551 # This cannot have is-info set. Sending the same value a second time after a
552 # while has passed means a completely reset timeout.
553 PACKET_TIMEOUT_INFO = 244; sc
554 SFLOAT10x3 seconds_to_phasedone;
555 SFLOAT10x3 last_turn_change_time;
558 PACKET_MAP_INFO = 17; sc, lsend
559 XYSIZE xsize;
560 XYSIZE ysize;
561 UINT8 topology_id;
564 PACKET_NUKE_TILE_INFO = 18; sc, dsend,lsend
565 TILE tile;
568 PACKET_TEAM_NAME_INFO = 19; sc, lsend
569 TEAM team_id; key
570 STRING team_name[MAX_LEN_NAME];
573 PACKET_ACHIEVEMENT_INFO = 238; sc, lsend
574 UINT8 id;
575 BOOL gained;
576 BOOL first;
579 /************** Chat/event packets **********************/
581 /* This MUST have identical structure to PACKET_EARLY_CHAT_MSG as there's casting
582 * the two. */
583 PACKET_CHAT_MSG = 25; sc, lsend
584 STRING message[MAX_LEN_MSG];
585 TILE tile;
586 EVENT event;
587 TURN turn;
588 PHASE phase;
589 CONNECTION conn_id;
592 /* This MUST have identical structure to PACKET_CHAT_MSG as there's casting
593 * the two. */
594 PACKET_EARLY_CHAT_MSG = 28; sc, lsend
595 STRING message[MAX_LEN_MSG];
596 TILE tile;
597 EVENT event;
598 TURN turn;
599 PHASE phase;
600 CONNECTION conn_id;
603 PACKET_CHAT_MSG_REQ = 26; cs, handle-per-conn, dsend
604 STRING message[MAX_LEN_MSG];
607 # Used in initial protocol.
608 PACKET_CONNECT_MSG = 27; sc, dsend
609 STRING message[MAX_LEN_MSG];
612 /************** City packets **********************/
614 PACKET_CITY_REMOVE = 30; sc, dsend, lsend, cancel(PACKET_CITY_INFO), cancel(PACKET_CITY_SHORT_INFO)
615 CITY city_id;
618 PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO)
619 CITY id; key
620 TILE tile;
622 PLAYER owner;
623 CITIZENS size;
624 UINT8 city_radius_sq;
625 UINT8 style;
627 CITIZENS ppl_happy[FEELING_LAST];
628 CITIZENS ppl_content[FEELING_LAST];
629 CITIZENS ppl_unhappy[FEELING_LAST];
630 CITIZENS ppl_angry[FEELING_LAST];
632 UINT8 specialists_size;
633 CITIZENS specialists[SP_MAX:specialists_size];
635 UINT8 nationalities_count;
636 PLAYER nation_id[MAX_NUM_PLAYER_SLOTS:nationalities_count];
637 CITIZENS nation_citizens[MAX_NUM_PLAYER_SLOTS:nationalities_count];
639 UINT16 history;
640 UINT16 culture;
642 SINT16 surplus[O_LAST];
643 UINT16 waste[O_LAST];
644 SINT16 unhappy_penalty[O_LAST];
645 UINT16 prod[O_LAST];
646 SINT16 citizen_base[O_LAST];
647 SINT16 usage[O_LAST];
648 UINT16 food_stock, shield_stock;
650 UINT16 trade[MAX_TRADE_ROUTES];
651 UINT8 trade_value[MAX_TRADE_ROUTES];
653 UINT16 pollution;
654 UINT16 illness_trade;
656 UINT8 production_kind;
657 UINT8 production_value;
659 TURN turn_founded;
660 TURN turn_last_built;
661 UINT8 changed_from_kind;
662 UINT8 changed_from_value;
663 UINT16 before_change_shields;
664 UINT16 disbanded_shields;
665 UINT16 caravan_shields;
666 UINT16 last_turns_shield_surplus;
668 UINT8 airlift;
669 BOOL did_buy, did_sell, was_happy;
671 BOOL diplomat_investigate;
672 UINT8 walls;
673 SINT8 city_image;
675 WORKLIST worklist;
677 BV_IMPRS improvements;
678 BV_CITY_OPTIONS city_options;
679 STRING name[MAX_LEN_NAME];
682 PACKET_CITY_SHORT_INFO = 32; sc, lsend, is-game-info, cancel(PACKET_CITY_INFO)
683 CITY id; key
684 TILE tile;
686 PLAYER owner;
687 UINT8 size;
688 UINT8 style;
690 BOOL occupied;
691 UINT8 walls;
693 BOOL happy;
694 BOOL unhappy;
696 SINT8 city_image;
698 BV_IMPRS improvements;
699 STRING name[MAX_LEN_NAME];
702 PACKET_CITY_SELL = 33; cs, dsend
703 CITY city_id;
704 UINT8 build_id;
707 PACKET_CITY_BUY = 34; cs, dsend
708 CITY city_id;
711 PACKET_CITY_CHANGE = 35; cs, dsend
712 CITY city_id;
713 UINT8 production_kind;
714 UINT8 production_value;
717 PACKET_CITY_WORKLIST = 36; cs, dsend
718 CITY city_id;
719 WORKLIST worklist;
722 PACKET_CITY_MAKE_SPECIALIST = 37; cs, dsend
723 CITY city_id;
724 CITY_COORD worker_x, worker_y;
727 PACKET_CITY_MAKE_WORKER = 38; cs, dsend
728 CITY city_id;
729 CITY_COORD worker_x, worker_y;
732 PACKET_CITY_CHANGE_SPECIALIST = 39; cs, dsend
733 CITY city_id;
734 SPECIALIST from, to;
737 PACKET_CITY_RENAME = 40; cs, dsend
738 CITY city_id;
739 STRING name[MAX_LEN_NAME];
742 PACKET_CITY_OPTIONS_REQ = 41; cs, dsend
743 CITY city_id;
744 BV_CITY_OPTIONS options;
747 PACKET_CITY_REFRESH = 42; cs, dsend
748 CITY city_id;
751 # For city name suggestions, client sends unit id of unit building the
752 # city. The server does not use the id, but sends it back to the
753 # client so that the client knows what to do with the suggestion when
754 # it arrives back. (Currently, for city renaming, default is existing
755 # name; if wanted to suggest a new name, could do the same thing
756 # sending the city id as id, and only client needs to change.)
757 PACKET_CITY_NAME_SUGGESTION_REQ = 43; cs, dsend
758 UNIT unit_id;
761 PACKET_CITY_NAME_SUGGESTION_INFO = 44; sc, dsend, lsend
762 UNIT unit_id;
763 STRING name[MAX_LEN_NAME];
766 PACKET_CITY_SABOTAGE_LIST = 45; sc, lsend
767 UNIT diplomat_id;
768 CITY city_id;
769 BV_IMPRS improvements;
772 PACKET_WORKER_TASK = 241; cs, sc, lsend, handle-via-packet
773 CITY city_id;
774 TILE tile_id;
775 ACTIVITY activity;
776 EXTRA tgt;
777 UINT16 want;
780 /************** Player packets **********************/
782 PACKET_PLAYER_REMOVE = 50; sc, dsend, cancel(PACKET_PLAYER_INFO)
783 PLAYER playerno;
786 PACKET_PLAYER_INFO = 51; sc, is-info
787 PLAYER playerno; key
788 STRING name[MAX_LEN_NAME];
789 STRING username[MAX_LEN_NAME];
790 BOOL unassigned_user;
792 UINT32 score;
793 BOOL is_male;
794 BOOL was_created;
795 GOVERNMENT government;
796 GOVERNMENT target_government;
797 BOOL real_embassy[MAX_NUM_PLAYER_SLOTS];
798 MOOD mood;
799 UINT8 style;
800 SINT8 music_style;
801 NATION nation;
802 TEAM team;
803 BOOL is_ready;
804 BOOL phase_done;
805 TURN nturns_idle;
806 TURN turns_alive;
807 BOOL is_alive;
809 GOLD gold;
810 PERCENT tax, science,luxury;
812 UINT16 tech_upkeep;
813 UINT16 science_cost;
815 BOOL is_connected;
816 TURN revolution_finishes;
817 BOOL ai;
818 UINT8 ai_skill_level;
819 BARBARIAN_TYPE barbarian_type;
820 BV_PLAYER gives_shared_vision;
821 UINT16 culture;
822 SINT16 love[MAX_NUM_PLAYER_SLOTS];
824 BOOL color_valid;
825 BOOL color_changeable;
826 UINT8 color_red;
827 UINT8 color_green;
828 UINT8 color_blue;
830 CITYSPE wonders[B_LAST]; diff
832 UINT8 multip_count;
833 SINT32 multiplier[MAX_NUM_MULTIPLIERS:multip_count];
834 SINT32 multiplier_target[MAX_NUM_MULTIPLIERS:multip_count];
837 PACKET_PLAYER_PHASE_DONE = 52; cs, dsend
838 TURN turn;
841 PACKET_PLAYER_RATES = 53; cs, dsend
842 PERCENT tax, luxury, science;
845 PACKET_PLAYER_CHANGE_GOVERNMENT = 54; cs, dsend
846 GOVERNMENT government;
849 PACKET_PLAYER_ATTRIBUTE_BLOCK = 57; cs
852 PACKET_PLAYER_ATTRIBUTE_CHUNK = 58; pre-send, sc, cs, handle-via-packet
853 UINT32 offset; key
854 UINT32 total_length;
855 UINT16 chunk_length;
856 /* to keep memory management simple don't allocate dynamic memory */
857 MEMORY data[ATTRIBUTE_CHUNK_SIZE:chunk_length];
860 PACKET_PLAYER_DIPLSTATE = 59; sc
861 UINT32 diplstate_id; key
862 PLAYER plr1;
863 PLAYER plr2;
864 DIPLSTATE_TYPE type;
865 UINT16 turns_left;
866 UINT8 has_reason_to_cancel;
867 UINT16 contact_turns_left;
870 PACKET_PLAYER_MULTIPLIER = 242; cs
871 UINT16 count;
872 SINT32 multipliers[MAX_NUM_MULTIPLIERS:count];
875 /************** Research packets **********************/
877 PACKET_RESEARCH_INFO = 60; sc, lsend, is-game-info
878 RESEARCH id; key
879 UINT32 techs_researched;
880 UINT16 future_tech;
881 TECH researching;
882 UINT32 researching_cost;
883 UINT32 bulbs_researched;
884 TECH tech_goal;
885 SINT32 total_bulbs_prod;
886 STRING inventions[A_LAST + 1];
889 PACKET_PLAYER_RESEARCH = 55; cs, dsend
890 TECH tech;
893 PACKET_PLAYER_TECH_GOAL = 56; cs, dsend
894 TECH tech;
897 /************** Unit packets **********************/
899 PACKET_UNIT_REMOVE = 62; sc, dsend, lsend, cancel(PACKET_UNIT_INFO), cancel(PACKET_UNIT_SHORT_INFO)
900 UNIT unit_id;
903 PACKET_UNIT_INFO = 63; sc, lsend, is-game-info, cancel(PACKET_UNIT_SHORT_INFO)
904 UNIT id; key
905 PLAYER owner;
906 PLAYER nationality;
907 TILE tile;
908 DIRECTION facing;
909 CITY homecity;
911 UINT8 upkeep[O_LAST];
913 UINT8 veteran;
914 BOOL ai, paradropped;
915 BOOL occupied, transported, done_moving;
917 UNIT_TYPE type;
918 UNIT transported_by; /* Only valid if transported is set. */
919 MOVEFRAGS movesleft;
920 UINT8 hp, fuel;
921 /* UINT16 size for activity_count assumed in checks in ruleset.c */
922 UINT16 activity_count, changed_from_count;
923 TILE goto_tile;
924 ACTIVITY activity;
925 EXTRA activity_tgt;
926 ACTIVITY changed_from;
927 EXTRA changed_from_tgt;
929 SINT8 battlegroup;
931 BOOL has_orders;
932 UINT16 orders_length, orders_index;
933 BOOL orders_repeat, orders_vigilant;
934 ORDERS orders[MAX_LEN_ROUTE:orders_length];
935 DIRECTION orders_dirs[MAX_LEN_ROUTE:orders_length];
936 ACTIVITY orders_activities[MAX_LEN_ROUTE:orders_length];
937 EXTRA orders_targets[MAX_LEN_ROUTE:orders_length];
939 ACTION_DECISION action_decision_want;
940 TILE action_decision_tile;
943 PACKET_UNIT_SHORT_INFO = 64; sc, lsend, is-game-info, force, cancel(PACKET_UNIT_INFO)
944 UNIT id; key
945 PLAYER owner;
946 TILE tile;
947 DIRECTION facing;
948 UNIT_TYPE type;
950 UINT8 veteran;
951 BOOL occupied, transported;
953 UINT8 hp, activity;
954 EXTRA activity_tgt;
955 UNIT transported_by; /* Only valid if transported is set. */
957 /* in packet only, not in unit struct */
958 UINT8 packet_use; /* see enum unit_info_use */
959 CITY info_city_id; /* for UNIT_INFO_CITY_SUPPORTED
960 and UNIT_INFO_CITY_PRESENT uses */
963 PACKET_UNIT_COMBAT_INFO = 65; sc, lsend
964 UNIT attacker_unit_id;
965 UNIT defender_unit_id;
966 HP attacker_hp;
967 HP defender_hp;
968 BOOL make_winner_veteran;
971 PACKET_UNIT_BUILD_CITY = 67; cs, dsend
972 UNIT unit_id;
973 STRING name[MAX_LEN_NAME];
976 PACKET_UNIT_DISBAND = 68; cs, dsend
977 UNIT unit_id;
980 PACKET_UNIT_CHANGE_HOMECITY = 69; cs, dsend
981 UNIT unit_id;
982 CITY city_id;
985 PACKET_UNIT_BATTLEGROUP = 71; cs, dsend
986 UNIT unit_id;
987 SINT8 battlegroup;
990 # used for client orders: currently client-side goto and patrol
991 PACKET_UNIT_ORDERS = 73; cs
992 UNIT unit_id;
993 TILE src_tile; # Origin tile, included for sanity checking
995 UINT16 length;
996 BOOL repeat, vigilant;
997 ORDERS orders[MAX_LEN_ROUTE:length];
998 DIRECTION dir[MAX_LEN_ROUTE:length];
999 ACTIVITY activity[MAX_LEN_ROUTE:length];
1000 EXTRA target[MAX_LEN_ROUTE:length];
1001 TILE dest_tile;
1004 # Enable autosettlers for a unit. Only works for settler units naturally.
1005 PACKET_UNIT_AUTOSETTLERS = 74; cs, dsend
1006 UNIT unit_id;
1009 # Load the given cargo into the transporter.
1010 PACKET_UNIT_LOAD = 75; cs, dsend
1011 UNIT cargo_id;
1012 UNIT transporter_id;
1013 TILE transporter_tile;
1016 # Unload the given cargo from the transporter.
1017 PACKET_UNIT_UNLOAD = 76; cs, dsend
1018 UNIT cargo_id, transporter_id;
1021 PACKET_UNIT_UPGRADE = 77; cs, dsend
1022 UNIT unit_id;
1025 PACKET_UNIT_NUKE = 79; cs, dsend
1026 UNIT unit_id;
1029 PACKET_UNIT_PARADROP_TO = 80; cs, dsend
1030 UNIT unit_id;
1031 TILE tile;
1034 PACKET_UNIT_AIRLIFT = 81; cs, dsend
1035 UNIT unit_id;
1036 CITY city_id;
1039 PACKET_UNIT_ACTION_QUERY = 82; cs, handle-per-conn, dsend
1040 UNIT diplomat_id;
1041 UNIT target_id; # city_id or unit_id
1042 GEN_ACTION action_type;
1045 PACKET_UNIT_TYPE_UPGRADE = 83; cs, dsend
1046 UNIT_TYPE type;
1049 PACKET_UNIT_DO_ACTION = 84; cs, dsend
1050 UNIT actor_id;
1051 SINT32 target_id; # city_id, unit_id or tile_id
1052 SINT16 value;
1053 GEN_ACTION action_type;
1056 PACKET_UNIT_ACTION_ANSWER = 85; sc, dsend
1057 UNIT diplomat_id;
1058 UNIT target_id; # city_id or unit_id
1059 GOLD cost;
1060 GEN_ACTION action_type;
1063 PACKET_UNIT_GET_ACTIONS = 87; cs, handle-per-conn, dsend
1064 UNIT actor_unit_id;
1065 UNIT target_unit_id;
1066 CITY target_city_id;
1067 TILE target_tile_id;
1069 BOOL disturb_player;
1072 PACKET_UNIT_ACTIONS = 90; sc, dsend
1073 UNIT actor_unit_id;
1074 UNIT target_unit_id;
1075 CITY target_city_id;
1076 TILE target_tile_id;
1078 BOOL disturb_player;
1080 /* How to interpret action probabilities is documented in fc_types.h */
1081 ACT_PROB action_probabilities[ACTION_COUNT];
1084 PACKET_UNIT_CHANGE_ACTIVITY = 222; cs, dsend
1085 UNIT unit_id;
1086 ACTIVITY activity;
1087 EXTRA target;
1090 /* 88 & 89 are ping packets (not modifiable). */
1092 /************** Diplomacy packets **********************/
1094 PACKET_DIPLOMACY_INIT_MEETING_REQ = 95; cs, dsend
1095 PLAYER counterpart;
1098 PACKET_DIPLOMACY_INIT_MEETING = 96; sc, dsend, lsend
1099 PLAYER counterpart, initiated_from;
1102 PACKET_DIPLOMACY_CANCEL_MEETING_REQ = 97; cs, dsend
1103 PLAYER counterpart;
1106 PACKET_DIPLOMACY_CANCEL_MEETING = 98; sc, dsend, lsend
1107 PLAYER counterpart, initiated_from;
1110 PACKET_DIPLOMACY_CREATE_CLAUSE_REQ = 99; cs, dsend
1111 PLAYER counterpart, giver;
1112 CLAUSE type;
1113 UINT32 value;
1116 PACKET_DIPLOMACY_CREATE_CLAUSE = 100; sc, dsend, lsend
1117 PLAYER counterpart, giver;
1118 CLAUSE type;
1119 UINT32 value;
1122 PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ = 101; cs, dsend
1123 PLAYER counterpart, giver;
1124 CLAUSE type;
1125 UINT32 value;
1128 PACKET_DIPLOMACY_REMOVE_CLAUSE = 102; sc, dsend, lsend
1129 PLAYER counterpart, giver;
1130 CLAUSE type;
1131 UINT32 value;
1134 PACKET_DIPLOMACY_ACCEPT_TREATY_REQ = 103; cs, dsend
1135 PLAYER counterpart;
1138 PACKET_DIPLOMACY_ACCEPT_TREATY = 104;sc, dsend, lsend
1139 PLAYER counterpart;
1140 BOOL I_accepted, other_accepted;
1143 PACKET_DIPLOMACY_CANCEL_PACT = 105; cs, dsend
1144 PLAYER other_player_id;
1145 CLAUSE clause;
1148 /************** Report packets **********************/
1150 PACKET_PAGE_MSG = 110; sc, lsend
1151 STRING caption[MAX_LEN_MSG];
1152 STRING headline[MAX_LEN_MSG];
1153 EVENT event;
1154 UINT32 len;
1155 UINT16 parts;
1158 PACKET_PAGE_MSG_PART = 248; sc, lsend
1159 STRING lines[MAX_LEN_CONTENT];
1162 PACKET_REPORT_REQ = 111; cs, handle-per-conn, dsend
1163 REPORT_TYPE type;
1166 /************** Connection packets **********************/
1168 # For telling clients information about other connections to server.
1169 # Clients may not use all info, but supply now to avoid unnecessary
1170 # protocol changes later.
1171 PACKET_CONN_INFO = 115; sc, lsend, is-info
1172 CONNECTION id; key
1174 # 0 means client should forget its
1175 # info about this connection
1176 BOOL used;
1177 BOOL established;
1178 BOOL observer;
1179 PLAYER player_num;
1180 CMDLEVEL access_level;
1181 STRING username[MAX_LEN_NAME];
1182 STRING addr[MAX_LEN_ADDR];
1183 STRING capability[MAX_LEN_CAPSTR];
1186 # Information about the ping times of the connections.
1187 PACKET_CONN_PING_INFO = 116; sc, lsend
1188 UINT8 connections;
1189 CONNECTION conn_id[MAX_NUM_CONNECTIONS:connections];
1190 SFLOAT10x7 ping_time[MAX_NUM_CONNECTIONS:connections];
1193 # For compatibility with older versions, this number cannot be changed.
1194 # Freeciv servers version < 2.5.0 still can send this packet in
1195 # initial protocol.
1196 PACKET_CONN_PING = 88; sc
1199 # For compatibility with older versions, this number cannot be changed.
1200 # Can be used in initial protocol, if the client received a PACKET_CONN_PING.
1201 PACKET_CONN_PONG = 89; cs, handle-per-conn
1204 PACKET_CLIENT_HEARTBEAT = 251; cs, handle-per-conn
1207 PACKET_CLIENT_INFO = 119; cs, handle-per-conn
1208 GUI_TYPE gui;
1209 STRING distribution[MAX_LEN_NAME];
1212 /************** New turn packets **********************/
1214 PACKET_END_PHASE = 125; sc, lsend
1217 # sent to everyone, not just the player whose phase it is
1218 PACKET_START_PHASE = 126; sc, lsend, dsend
1219 PHASE phase;
1222 # send to each client whenever the turn has ended.
1223 PACKET_NEW_YEAR = 127; sc, lsend
1224 YEAR year;
1225 UINT16 fragments;
1226 TURN turn;
1229 # Server has finished processing turn change
1230 PACKET_BEGIN_TURN = 128; sc, lsend
1233 # Server starts processing turn change
1234 PACKET_END_TURN = 129; sc, lsend
1237 # Freeze reports and agents
1238 PACKET_FREEZE_CLIENT = 130; sc, lsend
1241 # Thaw reports and agents
1242 PACKET_THAW_CLIENT = 131; sc, lsend
1245 /************** Spaceship packets **********************/
1247 PACKET_SPACESHIP_LAUNCH = 135; cs
1250 PACKET_SPACESHIP_PLACE = 136; cs, dsend
1251 PLACE_TYPE type;
1253 # Meaning of num:
1254 # - if type==SSHIP_ACT_PLACE_STRUCTURAL:
1255 # index to sship->structure[]
1256 # - if type!=SSHIP_ACT_PLACE_STRUCTURAL:
1257 # new value for sship->fuel etc; should be just one more than
1258 # current value of ship->fuel etc Used to avoid possible
1259 # problems if we send duplicate packets when client
1260 # auto-builds?
1261 UINT8 num;
1264 PACKET_SPACESHIP_INFO = 137; sc, lsend, is-game-info
1265 PLAYER player_num; key
1266 UINT8 sship_state;
1267 UINT8 structurals;
1268 UINT8 components;
1269 UINT8 modules;
1270 UINT8 fuel;
1271 UINT8 propulsion;
1272 UINT8 habitation;
1273 UINT8 life_support;
1274 UINT8 solar_panels;
1275 YEAR launch_year;
1276 UINT32 population;
1277 UINT32 mass;
1278 BV_SPACESHIP_STRUCT structure;
1279 UFLOAT support_rate;
1280 UFLOAT energy_rate;
1281 UFLOAT success_rate;
1282 UFLOAT travel_time;
1285 /************** Ruleset packets **********************/
1287 PACKET_RULESET_UNIT = 140; sc, lsend
1288 UNIT_TYPE id;
1289 STRING name[MAX_LEN_NAME];
1290 STRING rule_name[MAX_LEN_NAME];
1291 STRING graphic_str[MAX_LEN_NAME];
1292 STRING graphic_alt[MAX_LEN_NAME];
1293 STRING sound_move[MAX_LEN_NAME];
1294 STRING sound_move_alt[MAX_LEN_NAME];
1295 STRING sound_fight[MAX_LEN_NAME];
1296 STRING sound_fight_alt[MAX_LEN_NAME];
1297 UINT8 unit_class_id;
1298 UINT16 build_cost;
1299 UINT8 pop_cost;
1300 UINT8 attack_strength;
1301 UINT8 defense_strength;
1302 MOVEFRAGS move_rate;
1303 TECH tech_requirement;
1304 UINT8 impr_requirement;
1305 GOVERNMENT gov_requirement;
1306 UINT16 vision_radius_sq;
1307 UINT8 transport_capacity;
1308 UINT8 hp;
1309 UINT8 firepower;
1310 SINT8 obsoleted_by;
1311 SINT8 converted_to;
1312 UINT8 convert_time;
1313 UINT8 fuel;
1315 UINT8 happy_cost; # unhappy people in home city
1316 UINT8 upkeep[O_LAST]; # normal upkeep cost (food, gold, shields)
1318 UINT16 paratroopers_range; # max range of paratroopers, UTYF_PARATROOPERS
1319 UINT8 paratroopers_mr_req; # whole move points, not MOVEFRAGS
1320 UINT8 paratroopers_mr_sub; # whole move points, not MOVEFRAGS
1322 UINT8 veteran_levels;
1323 STRING veteran_name[MAX_VET_LEVELS:veteran_levels][MAX_LEN_NAME];
1324 UINT16 power_fact[MAX_VET_LEVELS:veteran_levels];
1325 MOVEFRAGS move_bonus[MAX_VET_LEVELS:veteran_levels];
1327 UINT8 bombard_rate;
1328 UINT8 city_size;
1330 BV_UNIT_CLASSES cargo;
1331 BV_UNIT_CLASSES targets;
1332 BV_UNIT_CLASSES embarks;
1333 BV_UNIT_CLASSES disembarks;
1335 STRVEC helptext[MAX_LEN_PACKET];
1337 BV_UTYPE_FLAGS flags;
1338 BV_UTYPE_ROLES roles;
1341 PACKET_RULESET_UNIT_BONUS = 228; sc, lsend
1342 UNIT_TYPE unit;
1343 UTYF flag;
1344 CBONUS_TYPE type;
1345 UINT8 value;
1346 BOOL quiet;
1349 PACKET_RULESET_UNIT_FLAG = 229; sc, lsend
1350 UINT8 id;
1351 STRING name[MAX_LEN_NAME];
1352 STRING helptxt[MAX_LEN_PACKET];
1355 PACKET_RULESET_GAME = 141; sc, lsend
1356 UINT8 default_specialist;
1358 TECH_LIST global_init_techs[MAX_NUM_TECH_LIST];
1359 BUILDING_LIST global_init_buildings[MAX_NUM_BUILDING_LIST];
1361 UINT8 veteran_levels;
1362 STRING veteran_name[MAX_VET_LEVELS:veteran_levels][MAX_LEN_NAME];
1363 UINT16 power_fact[MAX_VET_LEVELS:veteran_levels];
1364 MOVEFRAGS move_bonus[MAX_VET_LEVELS:veteran_levels];
1366 UINT8 background_red;
1367 UINT8 background_green;
1368 UINT8 background_blue;
1371 PACKET_RULESET_SPECIALIST = 142; sc, lsend
1372 SPECIALIST id;
1374 STRING plural_name[MAX_LEN_NAME];
1375 STRING rule_name[MAX_LEN_NAME];
1376 STRING short_name[MAX_LEN_NAME];
1378 STRING graphic_alt[MAX_LEN_NAME];
1380 UINT8 reqs_count;
1381 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1383 STRVEC helptext[MAX_LEN_PACKET];
1386 PACKET_RULESET_GOVERNMENT_RULER_TITLE = 143; sc, lsend
1387 GOVERNMENT gov;
1388 NATION nation;
1389 STRING male_title[MAX_LEN_NAME];
1390 STRING female_title[MAX_LEN_NAME];
1393 PACKET_RULESET_TECH = 144; sc, lsend
1394 TECH id;
1395 TECH req[2];
1396 TECH root_req;
1397 BV_TECH_FLAGS flags;
1398 UFLOAT10x3 cost;
1399 UINT32 num_reqs;
1400 STRING name[MAX_LEN_NAME];
1401 STRING rule_name[MAX_LEN_NAME];
1402 STRVEC helptext[MAX_LEN_PACKET];
1403 STRING graphic_str[MAX_LEN_NAME];
1404 STRING graphic_alt[MAX_LEN_NAME];
1407 PACKET_RULESET_TECH_FLAG = 234; sc, lsend
1408 UINT8 id;
1409 STRING name[MAX_LEN_NAME];
1410 STRING helptxt[MAX_LEN_PACKET];
1413 PACKET_RULESET_GOVERNMENT = 145; sc, lsend
1414 GOVERNMENT id;
1416 UINT8 reqs_count;
1417 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1419 STRING name[MAX_LEN_NAME];
1420 STRING rule_name[MAX_LEN_NAME];
1421 STRING graphic_str[MAX_LEN_NAME];
1422 STRING graphic_alt[MAX_LEN_NAME];
1423 STRVEC helptext[MAX_LEN_PACKET];
1426 PACKET_RULESET_TERRAIN_CONTROL = 146; sc, lsend
1427 UINT8 ocean_reclaim_requirement_pct; /* # adjacent land tiles for reclaim */
1428 UINT8 land_channel_requirement_pct; /* # adjacent ocean tiles for channel */
1429 UINT8 terrain_thaw_requirement_pct; /* # adjacent unfrozen tiles for thaw */
1430 UINT8 terrain_freeze_requirement_pct; /* # adjacent frozen tiles */
1431 UINT8 lake_max_size; /* bodies of water up to this size are freshwater */
1432 UINT8 min_start_native_area;
1433 MOVEFRAGS move_fragments;
1434 MOVEFRAGS igter_cost;
1435 BOOL pythagorean_diagonal;
1436 STRING gui_type_base0[MAX_LEN_NAME];
1437 STRING gui_type_base1[MAX_LEN_NAME];
1440 PACKET_RULESETS_READY = 225; sc, lsend
1443 PACKET_RULESET_NATION_SETS = 236; sc, lsend
1444 UINT8 nsets;
1445 STRING names[MAX_NUM_NATION_SETS:nsets][MAX_LEN_NAME];
1446 STRING rule_names[MAX_NUM_NATION_SETS:nsets][MAX_LEN_NAME];
1447 /* This relies on MAX_NUM_NATION_SETS not being too big to overflow
1448 * the packet length: */
1449 STRING descriptions[MAX_NUM_NATION_SETS:nsets][MAX_LEN_MSG]; /*untranslated*/
1452 PACKET_RULESET_NATION_GROUPS = 147; sc, lsend
1453 UINT8 ngroups;
1454 STRING groups[MAX_NUM_NATION_GROUPS:ngroups][MAX_LEN_NAME];
1455 BOOL hidden[MAX_NUM_NATION_GROUPS:ngroups];
1458 PACKET_RULESET_NATION = 148; sc, lsend
1459 NATION id; key
1461 STRING translation_domain[MAX_LEN_NAME];
1462 /* Strings are untranslated */
1463 STRING adjective[MAX_LEN_NAME];
1464 STRING rule_name[MAX_LEN_NAME];
1465 STRING noun_plural[MAX_LEN_NAME];
1466 STRING graphic_str[MAX_LEN_NAME];
1467 STRING graphic_alt[MAX_LEN_NAME];
1468 STRING legend[MAX_LEN_MSG];
1470 UINT8 style;
1472 UINT8 leader_count;
1473 STRING leader_name[MAX_NUM_LEADERS:leader_count][MAX_LEN_NAME];
1474 BOOL leader_is_male[MAX_NUM_LEADERS:leader_count];
1476 BOOL is_playable;
1477 BARBARIAN_TYPE barbarian_type;
1479 UINT8 nsets;
1480 UINT8 sets[MAX_NUM_NATION_SETS:nsets];
1482 UINT8 ngroups;
1483 UINT8 groups[MAX_NUM_NATION_GROUPS:ngroups];
1485 GOVERNMENT init_government_id;
1486 TECH_LIST init_techs[MAX_NUM_TECH_LIST];
1487 UNIT_LIST init_units[MAX_NUM_UNIT_LIST];
1488 BUILDING_LIST init_buildings[MAX_NUM_BUILDING_LIST];
1491 # Separate from PACKET_RULESET_NATION since it can change in pregame
1492 # without a ruleset reload
1493 PACKET_NATION_AVAILABILITY = 237; sc, lsend
1494 UINT16 ncount;
1495 BOOL is_pickable[MAX_NUM_NATIONS:ncount];
1496 BOOL nationset_change;
1499 PACKET_RULESET_STYLE = 239; sc, lsend
1500 UINT8 id;
1501 STRING name[MAX_LEN_NAME];
1502 STRING rule_name[MAX_LEN_NAME];
1505 PACKET_RULESET_CITY = 149; sc, lsend
1506 UINT8 style_id;
1507 STRING name[MAX_LEN_NAME];
1508 STRING rule_name[MAX_LEN_NAME];
1509 STRING citizens_graphic[MAX_LEN_NAME];
1510 STRING citizens_graphic_alt[MAX_LEN_NAME];
1511 UINT8 reqs_count;
1512 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1513 STRING graphic[MAX_LEN_NAME];
1514 STRING graphic_alt[MAX_LEN_NAME];
1517 PACKET_RULESET_BUILDING = 150; sc, lsend
1518 IMPROVEMENT id;
1519 IMPR_GENUS genus;
1520 STRING name[MAX_LEN_NAME];
1521 STRING rule_name[MAX_LEN_NAME];
1522 STRING graphic_str[MAX_LEN_NAME];
1523 STRING graphic_alt[MAX_LEN_NAME];
1524 UINT8 reqs_count;
1525 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1526 UINT8 obs_count;
1527 REQUIREMENT obs_reqs[MAX_NUM_REQS:obs_count];
1528 UINT16 build_cost;
1529 UINT8 upkeep, sabotage;
1530 BV_IMPR_FLAGS flags;
1531 STRING soundtag[MAX_LEN_NAME];
1532 STRING soundtag_alt[MAX_LEN_NAME];
1533 STRVEC helptext[MAX_LEN_PACKET];
1536 PACKET_RULESET_TERRAIN = 151; sc, lsend
1537 TERRAIN id;
1539 UINT8 tclass;
1540 BV_TERRAIN_FLAGS flags;
1541 BV_UNIT_CLASSES native_to;
1543 STRING name[MAX_LEN_NAME];
1544 STRING rule_name[MAX_LEN_NAME];
1545 STRING graphic_str[MAX_LEN_NAME];
1546 STRING graphic_alt[MAX_LEN_NAME];
1548 UINT8 movement_cost; # Whole movement points (not multiplied by SINGLE_MOVE)
1549 SINT16 defense_bonus;
1551 UINT8 output[O_LAST];
1552 UINT8 num_resources;
1553 RESOURCE resources[MAX_NUM_RESOURCES:num_resources];
1555 UINT16 road_output_incr_pct[O_LAST];
1556 UINT8 base_time;
1557 UINT8 road_time;
1559 TERRAIN irrigation_result;
1560 UINT8 irrigation_food_incr;
1561 UINT8 irrigation_time;
1563 TERRAIN mining_result;
1564 UINT8 mining_shield_incr;
1565 UINT8 mining_time;
1567 SINT16 animal;
1569 TERRAIN transform_result;
1570 UINT8 transform_time;
1571 UINT8 clean_pollution_time;
1572 UINT8 clean_fallout_time;
1573 UINT8 pillage_time;
1575 UINT8 color_red;
1576 UINT8 color_green;
1577 UINT8 color_blue;
1579 STRVEC helptext[MAX_LEN_PACKET];
1582 PACKET_RULESET_TERRAIN_FLAG = 231; sc, lsend
1583 UINT8 id;
1584 STRING name[MAX_LEN_NAME];
1585 STRING helptxt[MAX_LEN_PACKET];
1588 PACKET_RULESET_UNIT_CLASS = 152; sc, lsend
1589 UINT8 id;
1590 STRING name[MAX_LEN_NAME];
1591 STRING rule_name[MAX_LEN_NAME];
1592 MOVEFRAGS min_speed;
1593 UINT8 hp_loss_pct;
1594 UINT8 hut_behavior;
1595 UINT16 non_native_def_pct;
1596 BV_UCLASS_FLAGS flags;
1598 STRVEC helptext[MAX_LEN_PACKET];
1601 PACKET_RULESET_EXTRA = 232; sc, lsend
1602 UINT8 id;
1603 STRING name[MAX_LEN_NAME];
1604 STRING rule_name[MAX_LEN_NAME];
1605 UINT8 category;
1606 UINT8 causes;
1607 UINT8 rmcauses;
1608 STRING activity_gfx[MAX_LEN_NAME];
1609 STRING act_gfx_alt[MAX_LEN_NAME];
1610 STRING act_gfx_alt2[MAX_LEN_NAME];
1611 STRING rmact_gfx[MAX_LEN_NAME];
1612 STRING rmact_gfx_alt[MAX_LEN_NAME];
1613 STRING graphic_str[MAX_LEN_NAME];
1614 STRING graphic_alt[MAX_LEN_NAME];
1615 UINT8 reqs_count;
1616 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1617 UINT8 rmreqs_count;
1618 REQUIREMENT rmreqs[MAX_NUM_REQS:rmreqs_count];
1619 BOOL buildable;
1620 UINT8 build_time;
1621 UINT8 build_time_factor;
1622 UINT8 removal_time;
1623 UINT8 removal_time_factor;
1624 UINT8 defense_bonus;
1625 BV_UNIT_CLASSES native_to;
1626 BV_EXTRA_FLAGS flags;
1627 BV_EXTRAS hidden_by;
1628 BV_EXTRAS conflicts;
1629 STRVEC helptext[MAX_LEN_PACKET];
1632 PACKET_RULESET_BASE = 153; sc, lsend
1633 UINT8 id;
1634 BASE_GUI gui_type;
1635 SINT8 border_sq;
1636 SINT8 vision_main_sq;
1637 SINT8 vision_invis_sq;
1638 BV_BASE_FLAGS flags;
1641 PACKET_RULESET_ROAD = 220; sc, lsend
1642 UINT8 id;
1643 UINT8 first_reqs_count;
1644 REQUIREMENT first_reqs[MAX_NUM_REQS:first_reqs_count];
1645 SINT16 move_cost; # not MOVEFRAGS because -1 is valid
1646 MOVE_MODE move_mode;
1647 UINT16 tile_incr_const[O_LAST];
1648 UINT16 tile_incr[O_LAST];
1649 UINT16 tile_bonus[O_LAST];
1650 ROAD_COMPAT compat;
1651 BV_ROADS integrates;
1652 BV_ROAD_FLAGS flags;
1655 PACKET_RULESET_DISASTER = 224; sc, lsend
1656 UINT8 id;
1657 STRING name[MAX_LEN_NAME];
1658 STRING rule_name[MAX_LEN_NAME];
1659 UINT8 reqs_count;
1660 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1661 UINT8 frequency;
1662 BV_DISASTER_EFFECTS effects;
1665 PACKET_RULESET_ACHIEVEMENT = 233; sc, lsend
1666 UINT8 id;
1667 STRING name[MAX_LEN_NAME];
1668 STRING rule_name[MAX_LEN_NAME];
1669 ACHIEVEMENT_TYPE type;
1670 BOOL unique;
1671 UINT16 value;
1674 PACKET_RULESET_TRADE = 227; sc, lsend
1675 UINT8 id;
1676 UINT16 trade_pct;
1677 TRI cancelling;
1678 TR_BONUS_TYPE bonus_type;
1681 PACKET_RULESET_ACTION = 246; sc, lsend
1682 GEN_ACTION id;
1684 STRING ui_name[MAX_LEN_NAME];
1685 BOOL quiet;
1688 PACKET_RULESET_ACTION_ENABLER = 235; sc, lsend
1689 GEN_ACTION enabled_action;
1690 UINT8 actor_reqs_count;
1691 REQUIREMENT actor_reqs[MAX_NUM_REQS:actor_reqs_count];
1692 UINT8 target_reqs_count;
1693 REQUIREMENT target_reqs[MAX_NUM_REQS:target_reqs_count];
1696 PACKET_RULESET_MUSIC = 240; sc, lsend
1697 UINT8 id;
1698 STRING music_peaceful[MAX_LEN_NAME];
1699 STRING music_combat[MAX_LEN_NAME];
1700 UINT8 reqs_count;
1701 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1704 PACKET_RULESET_MULTIPLIER = 243; sc, dsend, lsend
1705 MULTIPLIER id;
1706 SINT32 start;
1707 SINT32 stop;
1708 UINT32 step;
1709 SINT32 def;
1710 SINT32 offset;
1711 SINT32 factor;
1712 STRING name[MAX_LEN_NAME];
1713 STRING rule_name[MAX_LEN_NAME];
1714 STRVEC helptext[MAX_LEN_PACKET];
1717 /**************************************************************************
1718 Ruleset control values: single values, all of which are needed before
1719 sending other ruleset data. After sending this packet, resend every
1720 other part of the rulesets. (Terrain ruleset has enough info for its
1721 own "control" packet, done separately.)
1722 **************************************************************************/
1723 PACKET_RULESET_CONTROL = 155; sc, lsend
1724 UINT16 num_unit_classes;
1725 UINT16 num_unit_types;
1726 UINT16 num_impr_types;
1727 UINT16 num_tech_types;
1728 UINT16 num_extra_types;
1729 UINT16 num_base_types;
1730 UINT16 num_road_types;
1731 UINT16 num_disaster_types;
1732 UINT16 num_achievement_types;
1733 UINT16 num_multipliers;
1734 UINT16 num_styles;
1735 UINT16 num_music_styles;
1736 UINT16 government_count;
1737 UINT16 nation_count;
1738 UINT16 styles_count;
1739 UINT16 terrain_count;
1740 UINT16 resource_count;
1741 UINT16 num_specialist_types;
1743 STRING preferred_tileset[MAX_LEN_NAME];
1744 STRING preferred_soundset[MAX_LEN_NAME];
1745 STRING preferred_musicset[MAX_LEN_NAME];
1746 BOOL popup_tech_help;
1748 STRING name[MAX_LEN_NAME];
1749 STRING version[MAX_LEN_NAME];
1750 UINT16 desc_length;
1753 PACKET_RULESET_SUMMARY = 249; sc, lsend
1754 STRING text[MAX_LEN_CONTENT];
1757 PACKET_RULESET_DESCRIPTION_PART = 247; sc, lsend
1758 STRING text[MAX_LEN_CONTENT];
1761 /*********************************************************
1762 Below are the packets that control single-player mode.
1763 *********************************************************/
1764 PACKET_SINGLE_WANT_HACK_REQ = 160; cs, handle-per-conn, handle-via-packet
1765 STRING token[MAX_LEN_NAME];
1768 PACKET_SINGLE_WANT_HACK_REPLY = 161; sc, dsend
1769 BOOL you_have_hack;
1772 PACKET_RULESET_CHOICES = 162; sc
1773 UINT8 ruleset_count;
1774 STRING rulesets[MAX_NUM_RULESETS:ruleset_count][MAX_RULESET_NAME_LENGTH];
1777 PACKET_GAME_LOAD = 163; sc, lsend, dsend
1778 BOOL load_successful;
1779 STRING load_filename[MAX_LEN_PACKET];
1782 PACKET_SERVER_SETTING_CONTROL = 164; sc, handle-via-packet, is-info
1783 UINT16 settings_num;
1784 UINT8 categories_num;
1785 STRING category_names[256:categories_num][MAX_LEN_NAME]; /* untranslated */
1788 PACKET_SERVER_SETTING_CONST = 165; sc, handle-via-packet, is-info
1789 UINT16 id; key
1790 STRING name[MAX_LEN_NAME];
1791 STRING short_help[MAX_LEN_PACKET]; /* untranslated */
1792 STRING extra_help[MAX_LEN_PACKET]; /* untranslated */
1793 UINT8 category;
1796 PACKET_SERVER_SETTING_BOOL = 166; sc, handle-via-packet, is-info
1797 UINT16 id; key
1798 BOOL is_visible;
1799 BOOL is_changeable;
1800 BOOL initial_setting;
1802 BOOL val;
1803 BOOL default_val;
1806 PACKET_SERVER_SETTING_INT = 167; sc, handle-via-packet, is-info
1807 UINT16 id; key
1808 BOOL is_visible;
1809 BOOL is_changeable;
1810 BOOL initial_setting;
1812 SINT32 val;
1813 SINT32 default_val;
1814 SINT32 min_val;
1815 SINT32 max_val;
1818 PACKET_SERVER_SETTING_STR = 168; sc, handle-via-packet, is-info
1819 UINT16 id; key
1820 BOOL is_visible;
1821 BOOL is_changeable;
1822 BOOL initial_setting;
1824 STRING val[MAX_LEN_PACKET];
1825 STRING default_val[MAX_LEN_PACKET];
1828 PACKET_SERVER_SETTING_ENUM = 169; sc, handle-via-packet, is-info
1829 UINT16 id; key
1830 BOOL is_visible;
1831 BOOL is_changeable;
1832 BOOL initial_setting;
1834 SINT8 val;
1835 SINT8 default_val;
1836 SINT8 values_num;
1837 STRING support_names[64:values_num][MAX_LEN_NAME];
1838 STRING pretty_names[64:values_num][MAX_LEN_ENUM]; /* untranslated */
1841 PACKET_SERVER_SETTING_BITWISE = 170; sc, handle-via-packet, is-info
1842 UINT16 id; key
1843 BOOL is_visible;
1844 BOOL is_changeable;
1845 BOOL initial_setting;
1847 UINT16 val;
1848 UINT16 default_val;
1849 UINT8 bits_num;
1850 STRING support_names[64:bits_num][MAX_LEN_NAME];
1851 STRING pretty_names[64:bits_num][MAX_LEN_ENUM]; /* untranslated */
1854 PACKET_SET_TOPOLOGY = 250; sc
1855 UINT8 topology_id;
1858 /************** Effects hash packets **********************/
1860 PACKET_RULESET_EFFECT = 175; sc, lsend
1861 EFFECT_TYPE effect_type;
1862 SINT32 effect_value;
1863 BOOL has_multiplier;
1864 MULTIPLIER multiplier;
1866 UINT8 reqs_count;
1867 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1870 PACKET_RULESET_RESOURCE = 177; sc, lsend
1871 RESOURCE id;
1873 STRING name[MAX_LEN_NAME];
1874 STRING rule_name[MAX_LEN_NAME];
1875 UINT8 output[O_LAST];
1876 STRING graphic_str[MAX_LEN_NAME];
1877 STRING graphic_alt[MAX_LEN_NAME];
1880 /****************** Scenario Related Packets ******************/
1882 PACKET_SCENARIO_INFO = 180; sc, handle-via-packet, handle-per-conn
1883 BOOL is_scenario;
1884 STRING name[256];
1885 STRING authors[MAX_LEN_PACKET / 3];
1886 BOOL players;
1887 BOOL startpos_nations;
1888 BOOL save_random;
1889 BOOL prevent_new_cities;
1890 BOOL lake_flooding;
1891 BOOL handmade;
1892 BOOL allow_ai_type_fallback;
1894 /* Unused at client side. */
1895 BOOL have_resources;
1898 PACKET_SCENARIO_DESCRIPTION = 252; sc, handle-per-conn
1899 STRING description[MAX_LEN_CONTENT];
1902 PACKET_SAVE_SCENARIO = 181; cs, handle-per-conn, dsend
1903 STRING name[MAX_LEN_NAME];
1906 /*************** Vote Packets ***************/
1908 PACKET_VOTE_NEW = 185; sc, handle-via-packet
1909 UINT32 vote_no;
1910 STRING user[MAX_LEN_NAME];
1911 STRING desc[512];
1912 UINT8 percent_required;
1913 UINT32 flags;
1916 /* Sent to the client to give the new vote totals. */
1917 PACKET_VOTE_UPDATE = 186; sc, is-info
1918 UINT32 vote_no; key
1919 UINT8 yes;
1920 UINT8 no;
1921 UINT8 abstain;
1922 UINT8 num_voters;
1925 PACKET_VOTE_REMOVE = 187; sc
1926 UINT32 vote_no;
1929 PACKET_VOTE_RESOLVE = 188; sc
1930 UINT32 vote_no;
1931 BOOL passed;
1934 /* Sent to the server by the client when the client
1935 * votes:
1936 * - yes (value = +1)
1937 * - no (value = -1)
1938 * - abstain (value = 0) */
1939 PACKET_VOTE_SUBMIT = 189; cs, handle-per-conn, no-delta
1940 UINT32 vote_no;
1941 SINT8 value;
1944 /************** Client Editor Packets **********************/
1946 /* Always keep this as the first edit type packet sent by
1947 * the client, so that the test in server/srv_main.c in
1948 * the function is_client_edit_packet() is easy to write. */
1949 PACKET_EDIT_MODE = 190; cs, handle-per-conn, dsend
1950 BOOL state;
1953 PACKET_EDIT_RECALCULATE_BORDERS = 197; cs, handle-per-conn
1956 PACKET_EDIT_CHECK_TILES = 198; cs, handle-per-conn
1959 PACKET_EDIT_TOGGLE_FOGOFWAR = 199; cs, handle-per-conn, dsend
1960 PLAYER player;
1963 PACKET_EDIT_TILE_TERRAIN = 200; cs, handle-per-conn, dsend
1964 TILE tile; key
1965 TERRAIN terrain;
1966 UINT8 size;
1969 PACKET_EDIT_TILE_RESOURCE = 201; cs, handle-per-conn, dsend
1970 TILE tile; key
1971 RESOURCE resource;
1972 UINT8 size;
1975 PACKET_EDIT_TILE_EXTRA = 202; cs, handle-per-conn, dsend
1976 TILE tile; key
1977 EXTRA extra_type_id;
1978 BOOL removal;
1979 UINT8 size;
1982 PACKET_EDIT_STARTPOS = 204; cs, sc, dsend, handle-per-conn, handle-via-packet, no-delta
1983 TILE id;
1984 BOOL removal;
1985 SINT32 tag;
1988 PACKET_EDIT_STARTPOS_FULL = 205; cs, sc, handle-per-conn, handle-via-packet, no-delta
1989 TILE id;
1990 BOOL exclude;
1991 BV_STARTPOS_NATIONS nations;
1994 PACKET_EDIT_TILE = 206; cs, handle-per-conn, handle-via-packet
1995 TILE tile; key
1996 BV_EXTRAS extras;
1997 RESOURCE resource;
1998 TERRAIN terrain;
1999 NATION startpos_nation;
2000 STRING label[MAX_LEN_NAME];
2003 PACKET_EDIT_UNIT_CREATE = 207; cs, handle-per-conn, dsend
2004 PLAYER owner;
2005 TILE tile;
2006 UNIT_TYPE type;
2007 UINT8 count;
2008 SINT32 tag;
2011 PACKET_EDIT_UNIT_REMOVE = 208; cs, handle-per-conn, dsend
2012 PLAYER owner;
2013 TILE tile;
2014 UNIT_TYPE type;
2015 UINT8 count;
2018 PACKET_EDIT_UNIT_REMOVE_BY_ID = 209; cs, handle-per-conn, dsend
2019 UNIT id;
2022 PACKET_EDIT_UNIT = 210; cs, handle-per-conn, handle-via-packet
2023 UNIT id; key
2024 UNIT_TYPE utype;
2025 PLAYER owner;
2026 CITY homecity;
2027 MOVEFRAGS moves_left;
2028 UINT8 hp;
2029 UINT8 veteran;
2030 UINT8 fuel;
2031 ACTIVITY activity;
2032 UINT16 activity_count;
2033 BASE activity_base;
2034 BOOL debug;
2035 BOOL moved;
2036 BOOL paradropped;
2037 BOOL done_moving;
2038 UNIT transported_by;
2041 PACKET_EDIT_CITY_CREATE = 211; cs, handle-per-conn, dsend
2042 PLAYER owner;
2043 TILE tile;
2044 UINT8 size;
2045 SINT32 tag;
2048 PACKET_EDIT_CITY_REMOVE = 212; cs, handle-per-conn, dsend
2049 CITY id;
2052 PACKET_EDIT_CITY = 213; cs, handle-per-conn, handle-via-packet
2053 CITY id; key
2054 STRING name[MAX_LEN_NAME];
2055 PLAYER owner;
2056 PLAYER original;
2057 UINT8 size;
2058 UINT16 history;
2059 UINT8 ppl_happy[5], ppl_content[5], ppl_unhappy[5], ppl_angry[5];
2060 UINT8 specialists_size;
2061 UINT8 specialists[SP_MAX:specialists_size];
2062 UINT16 trade[MAX_TRADE_ROUTES];
2063 UINT16 food_stock, shield_stock;
2064 BOOL airlift;
2065 BOOL debug;
2066 BOOL did_buy;
2067 BOOL did_sell;
2068 BOOL was_happy;
2069 UINT8 anarchy;
2070 UINT8 rapture;
2071 UINT8 steal;
2072 TURN turn_founded;
2073 TURN turn_last_built;
2074 SINT32 built[B_LAST]; diff
2075 UINT8 production_kind;
2076 UINT8 production_value;
2077 UINT16 last_turns_shield_surplus;
2078 BV_CITY_OPTIONS city_options;
2081 PACKET_EDIT_PLAYER_CREATE = 214; cs, handle-per-conn, dsend
2082 SINT32 tag;
2085 PACKET_EDIT_PLAYER_REMOVE = 215; cs, handle-per-conn, dsend
2086 PLAYER id;
2089 PACKET_EDIT_PLAYER = 216; cs, handle-per-conn, lsend
2090 PLAYER id; key
2091 STRING name[MAX_LEN_NAME];
2092 STRING username[MAX_LEN_NAME];
2093 STRING ranked_username[MAX_LEN_NAME];
2094 TURN user_turns;
2096 BOOL is_male;
2097 GOVERNMENT government;
2098 GOVERNMENT target_government;
2099 NATION nation;
2100 TEAM team;
2102 BOOL phase_done;
2103 TURN nturns_idle;
2104 BOOL is_alive;
2105 TURN revolution_finishes;
2107 BOOL capital;
2108 BV_PLAYER embassy;
2109 GOLD gold;
2110 PERCENT tax, science, luxury;
2112 UINT16 future_tech;
2113 TECH researching;
2114 UINT32 bulbs_researched;
2115 BOOL inventions[A_LAST+1]; diff
2117 BOOL ai;
2120 PACKET_EDIT_PLAYER_VISION = 217; cs, handle-per-conn, dsend
2121 PLAYER player;
2122 TILE tile;
2123 BOOL known;
2124 UINT8 size;
2127 /* Always keep this as the last edit type packet sent by
2128 * the client, so that the test in server/srv_main.c in
2129 * the function is_client_edit_packet() is easy to write. */
2130 PACKET_EDIT_GAME = 218; cs, handle-per-conn, handle-via-packet
2131 YEAR year;
2132 BOOL scenario;
2133 STRING scenario_name[256];
2134 STRING scenario_authors[MAX_LEN_PACKET / 3];
2135 BOOL scenario_random;
2136 BOOL scenario_players;
2137 BOOL startpos_nations;
2138 BOOL prevent_new_cities;
2139 BOOL lake_flooding;
2142 PACKET_EDIT_SCENARIO_DESC = 253; cs, handle-per-conn
2143 STRING scenario_desc[MAX_LEN_CONTENT];
2146 /************** Server Editor Packets **********************/
2148 PACKET_EDIT_OBJECT_CREATED = 219; sc, dsend
2149 SINT32 tag;
2150 SINT32 id;
2153 /************** Client Activity Requests **********************/
2155 PACKET_PLAY_MUSIC = 245; sc, lsend
2156 STRING tag[MAX_LEN_NAME];