Comment fix: OS is not excluded from permissive.
[freeciv.git] / common / networking / packets.def
blob6b81afd39c9c64e9c44a7ca54d8ad3614b54344c
1 /*
3 Max used id:
4 ============
6 Max id: 255
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.
31 freeciv-web build does not like comments on the end of the line.
32 Please put comments to lines of their own.
34 Packets:
35 ========
37 A packet definition starts with a header line, contains variable
38 field declarations, and ends with a single line containing the word
39 "end".
41 PACKET_<PACKET_NAME>=<packet num>; [<packet flags>]
42 <type1> <field1>; [<field flags>]
43 <type2> <field2>; [<field flags>]
44 ...
45 end
47 Header line:
48 ------------
50 The header line contains the packet name. The packet name is used
51 for the naming of the generated code struct and functions:
52 struct packet_*;
53 send_packet_*
54 dsend_packet_*
55 dlsend_packet_*
56 lsend_packet_*
57 receive_packet_*
58 handle_packet_*
60 The header line also contains the packet number. The packet number
61 is used as a numeric identification of a packet between the client
62 and server. The packet number shall never change for an existing
63 packet without the adding of a mandatory capability. Packets which
64 are used for the capability checking PACKET_PROCESSING_STARTED,
65 PACKET_PROCESSING_FINISHED, PACKET_SERVER_JOIN_REQ and
66 PACKET_SERVER_JOIN_REPLY are excluded here. These packets should
67 never change their number. The packet number can be freely chosen
68 as long as it is below 65536 and unique. For backward compatibility
69 reasons, packets used for the initial protocol (notably before
70 checking the capabilities) must be in range 0-255.
72 Packet flags:
73 -------------
75 Packet flags is a comma separated list of:
77 is-info: a second packet with the same content can be discarded
78 WARNING: this flag is dangerous and should not be used for
79 a packet that contains information that may be changed in
80 the client outside of the reception of that packet, or for
81 any packet with side effects at the client.
83 is-game-info: same as is-info, but the state is reset every time a
84 connection changes of player target.
86 force: sending functions will take an extra argument 'force_to_send'
87 to force to send the packet (at least an empty one). In this
88 case, the is-info or is-game-info flags are ignored. It has no
89 effect if the packets doesn't have the is-info or is-game-info
90 flags.
92 cancel(PACKET_number): Cancel a packet with the same key (must be the
93 same key type at the start of the packet), useful for is-info packets.
95 pre-send:
96 post-recv:
97 post-send: generate calls to pre-send, post-receive and post-send
98 hooks. These hooks are named: pre_send_packet_*,
99 post_receive_packet_* and post_send_packet_*. The user has to
100 provide these. These functions may be used to do extra
101 preparations, conversions or checks.
103 no-delta: don't use the delta protocol. This is useful for
104 packets which contain always different data
105 (packet_generic_integer) or are only sent once
106 (packet_req_join_game). Sadly this also disables the use of 0 as
107 the default value.
109 no-packet: don't generate a packet argument for the send
110 function. Currently only used by packet_generic_empty.
112 no-handle: don't generate handle_* prototypes. The generated
113 switch statements (server/srv_main_gen.c, client/civclient_gen.c)
114 doesn't include code for this packet. You have to handle this by
115 yourself. This may be required for special packets which are
116 handled early in the sequence.
118 handle-via-packet: force the packet type of the handle
119 function. Otherwise the fields are passed to the handle function.
120 This is invoked automatically for packets with more than 5 fields
121 or packets whose names are of the form foo_ruleset.
123 handle-per-conn: normally the first parameter of the handle
124 function is the player. handle-per-conn changes this to the
125 connection the packet came from.
127 dsend: request the creation of a dsend_packet_* function. This is
128 similar to a send function but instead of taking a packet struct
129 as a parameter, it takes the fields of the packet as parameters.
131 lsend: request the creation of a lsend_packet_* function. This
132 function sends to list of connections instead of just one
133 connection, which is the case for the other send functions.
135 cs: a packet which is sent from the client to the server
137 sc: a packet which is sent from the server to the client
139 Each other packet line has the format "<type> <fields>;<flags>".
141 Type:
142 ----
144 <type> is an alias or a basic type. A basic type has the format
145 "<dataio-type>(<public-type>)". Exception here is the float
146 type. You can specify with the dataio-type "float<number>" the
147 transmission of a float in a uint32 multiplied by this factor.
149 Fields:
150 -------
152 Comma seperated list of names. Each name can have zero, one or
153 two array declarations. So "x", "x[10]" and "x[20][10]" is
154 possible. The array size in the "[]" can be specified plain as a
155 term. In this case all elements will be transmitted. If this is
156 not-desired you can specify the amount of elements to be
157 transfered by given the number. So the extended format is
158 "[<full-array-size>:<elements-to-transfer>]". elements-to-transfer
159 is relative to the packet.
161 Field flags:
162 ------------
164 key: create multiple entries in the cache indexed by the key set
165 (set of all fields which have the key attribute). This allow a
166 better delta compression.
168 diff: use the array-diff feature. This will reduce the amount of
169 traffic for large arrays in which only a few elements change.
171 add-cap: only transfer this field if the given capability is
172 available at runtime. If you have a capability named
173 "new_version" a field line may look like this:
174 TILE tile; add-cap(new_version)
175 when making an optional capability mandatory, go through and remove
176 the add-cap flag for it while leaving the field intact.
178 remove-cap: don't transfer this field if the given capability is
179 available at runtime. When making an optional capability manditory,
180 go through and remove entirely any fields marked as remove-cap with
181 that capability.
184 # typedefs for numbers
185 type BOOL = bool8(bool)
186 type SFLOAT10x3 = sfloat100(float)
187 type SFLOAT10x7 = sfloat1000000(float)
188 type SINT8 = sint8(int)
189 type SINT16 = sint16(int)
190 type SINT32 = sint32(int)
191 type UFLOAT10x3 = ufloat100(float)
192 type UFLOAT = ufloat10000(float)
193 type UINT8 = uint8(int)
194 type UINT16 = uint16(int)
195 type UINT32 = uint32(int)
197 # typedefs for arrays/structs
198 type MEMORY = memory(unsigned char)
199 type REQUIREMENT = requirement(struct requirement)
200 type ACT_PROB = action_probability(struct act_prob)
201 type STRING = string(char)
202 # A string vector encoded to a string outside the packet and field system.
203 # Marking it this way is useful as documentation. The marking can also be
204 # used in non vanilla generate_packets.py packet generators.
205 type STRVEC = STRING
206 type TECH_LIST = tech_list(int)
207 type UNIT_LIST = unit_list(int)
208 type BUILDING_LIST = building_list(int)
209 type WORKLIST = worklist(struct worklist)
210 # string that is URI encoded in the JSON protocol
211 type ESTRING = estring(char)
213 # typedefs for enums
214 type ACHIEVEMENT_TYPE = uint8(enum achievement_type)
215 type ACTIVITY = uint8(enum unit_activity)
216 type AIRLIFTING_STYLE = uint8(enum airlifting_style)
217 type PERSISTENT_READY = uint8(enum persistent_ready)
218 type VICTORY_CONDITIONS = uint8(enum victory_condition_type)
219 type TECH_UPKEEP_STYLE = uint8(enum tech_upkeep_style)
220 type AUTH_TYPE = uint8(enum authentication_type)
221 type BARBARIAN_TYPE = uint8(enum barbarian_type)
222 type BASE_GUI = uint8(enum base_gui_type)
223 type BORDERS_MODE = uint8(enum borders_mode)
224 type CLAUSE = uint8(enum clause_type)
225 type CMDLEVEL = uint8(enum cmdlevel)
226 type DIPLOMACY_MODE = uint8(enum diplomacy_mode)
227 type DIPLSTATE_TYPE = uint8(enum diplstate_type)
228 type DIRECTION = sint8(enum direction8)
229 type EFFECT_TYPE = uint8(enum effect_type)
230 type EVENT = sint16(enum event_type)
231 type GUI_TYPE = uint8(enum gui_type)
232 type IMPR_GENUS = uint8(enum impr_genus_id)
233 type KNOWN = uint8(enum known_type)
234 type MOOD = uint8(enum mood_type)
235 type ORDERS = uint8(enum unit_orders)
236 type PHASE_MODE = uint8(enum phase_mode_type)
237 type PLACE_TYPE = uint8(enum spaceship_place_type)
238 type REPORT_TYPE = uint8(enum report_type)
239 type SSET_CLASS = uint8(enum sset_class)
240 type SSET_TYPE = uint8(enum sset_type)
241 type ROAD_COMPAT = uint8(enum road_compat)
242 type FTM = uint8(enum free_tech_method)
243 type GLS = uint8(enum gameloss_style)
244 type UTYF = uint8(enum unit_type_flag_id)
245 type CBONUS_TYPE = uint8(enum combat_bonus_type)
246 type TRI = uint8(enum traderoute_illegal_cancelling)
247 type RDIR = uint8(enum route_direction)
248 type MOVE_MODE = uint8(enum road_move_mode)
249 type GEN_ACTION = uint8(enum gen_action)
250 type ACTION_AUTO_CAUSE = uint8(enum action_auto_perf_cause)
251 type ACTION_DECISION = uint8(enum action_decision)
252 type ACTOR_KIND = uint8(enum action_actor_kind)
253 type TARGET_KIND = uint8(enum action_target_kind)
254 type UNIT_DATA_TYPE = uint8(enum unit_ss_data_type)
255 type REVOLENTYPE = uint8(enum revolen_type)
256 type HAPPYBORDERSTYPE = uint8(enum happyborders_type)
257 type TECH_COST_STYLE = uint8(enum tech_cost_style)
258 type TECH_LEAKAGE_STYLE = uint8(enum tech_leakage_style)
259 type GOLD_UPKEEP_STYLE = uint8(enum gold_upkeep_style)
260 type TR_BONUS_TYPE = uint8(enum traderoute_bonus_type)
261 type GOODS_SELECTION = uint8(enum goods_selection_method)
262 type EUS = uint8(enum extra_unit_seen_type)
264 # typedefs for bit vectors
265 type BV_ACTIONS = bitvector(bv_actions)
266 type BV_EXTRA_FLAGS = bitvector(bv_extra_flags)
267 type BV_BASE_FLAGS = bitvector(bv_base_flags)
268 type BV_GOODS_FLAGS = bitvector(bv_goods_flags)
269 type BV_EXTRAS = bitvector(bv_extras)
270 type BV_BASES = bitvector(bv_bases)
271 type BV_ROADS = bitvector(bv_roads)
272 type BV_ROAD_FLAGS = bitvector(bv_road_flags)
273 type BV_CITY_OPTIONS = bitvector(bv_city_options)
274 type BV_IMPR_FLAGS = bitvector(bv_impr_flags)
275 type BV_IMPRS = bitvector(bv_imprs)
276 type BV_PLAYER = bitvector(bv_player)
277 type BV_SPECIAL = bitvector(bv_special)
278 type BV_STARTPOS_NATIONS= bitvector(bv_startpos_nations)
279 type BV_TECH_FLAGS = bitvector(bv_tech_flags)
280 type BV_TERRAIN_FLAGS = bitvector(bv_terrain_flags)
281 type BV_UCLASS_FLAGS = bitvector(bv_unit_class_flags)
282 type BV_PLR_FLAGS = bitvector(bv_plr_flags)
283 type BV_UNIT_CLASSES = bitvector(bv_unit_classes)
284 type BV_UTYPE_FLAGS = bitvector(bv_unit_type_flags)
285 type BV_UTYPE_ROLES = bitvector(bv_unit_type_roles)
286 type BV_DISASTER_EFFECTS = bitvector(bv_disaster_effects)
287 type BV_SPACESHIP_STRUCT = bitvector(bv_spaceship_structure)
289 # typedefs for IDs
290 type EXTRA = SINT8
291 type ACTION_TGT = SINT16
292 type BASE = sint8(Base_type_id)
293 type ROAD = sint8(Road_type_id)
294 type CITY = UINT16
295 # city id, with space for special values
296 type CITYSPE = SINT32
297 type CONNECTION = SINT16
298 type CONTINENT = sint16(Continent_id)
299 type GOVERNMENT = sint8(Government_type_id)
300 type IMPROVEMENT = uint8(Impr_type_id)
301 type MULTIPLIER = uint8(Multiplier_type_id)
302 type NATION = sint16(Nation_type_id)
303 type PLAYER = UINT8
304 type RESEARCH = UINT8
305 type RESOURCE = uint8(Resource_type_id)
306 type SPECIALIST = uint8(Specialist_type_id)
307 type TEAM = UINT8
308 type TECH = UINT8
309 type TERRAIN = uint8(Terrain_type_id)
310 type TILE = SINT32
311 type UNIT = UINT16
312 type UNIT_TYPE = uint8(Unit_type_id)
313 type GOODS = uint8(Goods_type_id)
315 # other typedefs
316 type CITY_COORD = UINT8
317 type GOLD = UINT32
318 type HP = UINT8
319 type PERCENT = UINT8
320 # units of TERRAIN_CONTROL.move_fragments
321 type MOVEFRAGS = UINT16
322 type PHASE = SINT16
323 type TURN = SINT16
324 type XYSIZE = UINT16
325 type YEAR = SINT16
326 type CITIZENS = UINT8
328 /****************************************************
329 The remaining lines are the definition of the packets. These are
330 grouped together. There are the following groups:
331 General
332 Login/pregame/endgame
333 Info
334 Chat/event
335 City
336 Player
337 Unit
338 Diplomacy
339 Report
340 Connection
341 New turn
342 Spaceship
343 Ruleset
344 Scenario
345 Voting
346 Editor
347 ****************************************************/
350 /************** General packets **********************/
352 # For compatibility with older versions, this number cannot be changed.
353 # Used in initial protocol.
354 PACKET_PROCESSING_STARTED = 0; sc
357 # For compatibility with older versions, this number cannot be changed.
358 # Used in initial protocol.
359 PACKET_PROCESSING_FINISHED = 1; sc
362 /************** Login/pregame/endgame packets **********************/
364 # This packet is the first real (freeciv specific) packet send by the
365 # client. The player hasn't been accepted yet.
366 # For compatibility with older versions, this number cannot be changed.
367 # Used in initial protocol.
368 # 48 used instead of MAX_LEN_NAME to keep compatibility with old versions
369 # even if MAX_LEN_NAME changes. Similarly 512 instead of MAX_LEN_CAPSTR.
370 PACKET_SERVER_JOIN_REQ = 4; cs, dsend, no-delta, no-handle
371 STRING username[48];
372 STRING capability[512];
373 STRING version_label[48];
374 UINT32 major_version, minor_version, patch_version;
377 # ... and the server replies.
378 # For compatibility with older versions, this number cannot be changed.
379 # Used in initial protocol.
380 PACKET_SERVER_JOIN_REPLY = 5; sc, no-delta, post-send, post-recv
381 BOOL you_can_join;
382 STRING message[1536]; /* MAX_LEN_MSG */
383 STRING capability[512]; /* MAX_LEN_CAPSTR */
384 STRING challenge_file[4095]; /* MAX_LEN_PATH */
385 # clients conn id as known in server
386 CONNECTION conn_id;
389 # Used in initial protocol.
390 PACKET_AUTHENTICATION_REQ = 6; sc, handle-per-conn, dsend
391 AUTH_TYPE type;
392 STRING message[MAX_LEN_MSG]; /* explain to the client if there's a problem */
395 # Used in initial protocol.
396 PACKET_AUTHENTICATION_REPLY = 7; cs, no-handle
397 STRING password[MAX_LEN_PASSWORD];
401 PACKET_SERVER_SHUTDOWN = 8; sc, lsend
404 PACKET_NATION_SELECT_REQ = 10; cs, handle-per-conn, dsend
405 PLAYER player_no;
406 NATION nation_no;
407 BOOL is_male;
408 STRING name[MAX_LEN_NAME];
409 UINT8 style;
412 PACKET_PLAYER_READY = 11; cs, dsend
413 PLAYER player_no;
414 BOOL is_ready;
417 PACKET_ENDGAME_REPORT = 12; sc, lsend, no-delta, handle-via-packet
418 UINT8 category_num;
419 STRING category_name[32:category_num][MAX_LEN_NAME];
421 UINT8 player_num;
424 PACKET_ENDGAME_PLAYER = 223; sc, lsend, no-delta, handle-via-packet
425 UINT8 category_num;
426 PLAYER player_id;
427 UINT16 score;
428 UINT32 category_score[32:category_num];
429 BOOL winner;
432 /************** Info packets **********************/
434 # Use of is-game-info on this packet is dangerous but speeds things up
435 # greatly. Packet spam from excess sending of tiles has slowed the client
436 # greatly in the past. However see the comment on is-game-info at the top
437 # about the dangers.
438 PACKET_TILE_INFO = 15; sc, lsend, is-game-info
439 TILE tile; key
441 CONTINENT continent;
442 KNOWN known;
443 PLAYER owner;
444 PLAYER extras_owner;
445 CITY worked;
447 TERRAIN terrain;
448 RESOURCE resource;
449 BV_EXTRAS extras;
450 STRING spec_sprite[MAX_LEN_NAME];
451 STRING label[MAX_LEN_NAME];
454 # The variables in the packet are listed in alphabetical order.
455 PACKET_GAME_INFO = 16; sc, is-info
456 UINT8 add_to_size_limit;
457 UINT8 aifill;
458 PERSISTENT_READY persistent_ready;
459 AIRLIFTING_STYLE airlifting_style;
460 UINT8 angrycitizen;
461 SINT16 base_pollution;
462 UINT8 base_tech_cost;
463 UINT16 border_city_radius_sq;
464 UINT8 border_size_effect;
465 SINT16 border_city_permanent_radius_sq;
466 BORDERS_MODE borders;
467 UINT32 base_bribe_cost;
468 UINT32 culture_vic_points;
469 UINT16 culture_vic_lead;
470 UINT16 culture_migration_pml;
471 /* size limit for cities before they can celebrate */
472 UINT8 celebratesize;
473 BOOL changable_tax;
474 UINT8 pop_report_zeroes;
475 BOOL citizen_nationality;
476 UINT16 citizen_convert_speed;
477 UINT8 citizen_partisans_pct;
478 UINT8 citymindist;
479 UINT32 cooling;
480 UINT32 coolinglevel;
481 DIPLOMACY_MODE diplomacy;
482 BOOL fogofwar;
483 UINT8 food_cost;
484 UINT32 foodbox;
485 UINT8 forced_gold;
486 UINT8 forced_luxury;
487 UINT8 forced_science;
488 UINT8 fulltradesize;
489 UINT8 trade_world_rel_pct;
490 GOODS_SELECTION goods_selection;
491 /* True if at least one civilization has researched a tech */
492 UINT16 global_advance_count;
493 BOOL global_advances[A_LAST]; diff
494 BOOL global_warming;
495 UINT32 globalwarming;
496 GOLD gold;
497 GOLD_UPKEEP_STYLE gold_upkeep_style;
498 REVOLENTYPE revolentype;
499 GOVERNMENT default_government_id;
500 GOVERNMENT government_during_revolution_id;
501 UINT8 granary_food_inc;
502 UINT8 granary_food_ini[MAX_GRANARY_INIS];
503 UINT8 granary_num_inis;
504 PLAYER great_wonder_owners[B_LAST]; diff
505 UINT8 happy_cost;
506 HAPPYBORDERSTYPE happyborders;
507 UINT32 heating;
508 UINT16 illness_base_factor;
509 UINT8 illness_min_size;
510 BOOL illness_on;
511 UINT16 illness_pollution_factor;
512 UINT16 illness_trade_infection;
513 UINT8 init_city_radius_sq;
514 /* If set, editing is allowed */
515 BOOL is_edit_mode;
516 /* TRUE only in pregame for "new" (not loaded) games */
517 BOOL is_new_game;
518 BOOL killcitizen;
519 BOOL killstack;
520 UINT8 min_city_center_output[O_LAST];
521 BOOL muuk_food_wipe;
522 BOOL muuk_gold_wipe;
523 BOOL muuk_shield_wipe;
524 UINT8 notradesize;
525 BOOL nuclear_winter;
526 UINT32 nuclearwinter;
527 PHASE phase;
528 PHASE_MODE phase_mode;
529 BOOL pillage_select;
530 BOOL poison_empties_food_stock;
531 BOOL tech_steal_allow_holes;
532 BOOL tech_trade_allow_holes;
533 BOOL tech_trade_loss_allow_holes;
534 BOOL tech_parasite_allow_holes;
535 BOOL tech_loss_allow_holes;
536 UINT8 rapturedelay;
537 UINT16 disasters;
538 BOOL restrictinfra;
539 BOOL unreachable_protects;
540 UINT32 sciencebox;
541 UINT32 shieldbox;
542 UINT32 skill_level;
543 BOOL slow_invasions;
544 VICTORY_CONDITIONS victory_conditions;
545 BOOL team_pooled_research;
546 UINT32 tech;
547 TECH_COST_STYLE tech_cost_style;
548 TECH_LEAKAGE_STYLE tech_leakage;
549 UINT16 tech_upkeep_divider;
550 TECH_UPKEEP_STYLE tech_upkeep_style;
551 FTM free_tech_method;
552 GLS gameloss_style;
553 UINT32 timeout;
554 UINT32 first_timeout;
555 BOOL tired_attack;
556 UINT16 trademindist;
557 BOOL trading_city;
558 BOOL trading_gold;
559 BOOL trading_tech;
560 TURN turn;
561 UINT32 warminglevel;
562 YEAR year;
563 BOOL year_0_hack;
564 UINT16 fragment_count;
565 BOOL civil_war_enabled;
566 BOOL paradrop_to_transport;
569 PACKET_CALENDAR_INFO = 255; sc, is-info, handle-via-packet
570 STRING positive_year_label[MAX_LEN_NAME];
571 STRING negative_year_label[MAX_LEN_NAME];
572 UINT16 calendar_fragments;
573 STRING calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME];
574 BOOL calendar_skip_0;
577 # This cannot have is-info set. Sending the same value a second time after a
578 # while has passed means a completely reset timeout.
579 PACKET_TIMEOUT_INFO = 244; sc
580 SFLOAT10x3 seconds_to_phasedone;
581 SFLOAT10x3 last_turn_change_time;
584 PACKET_MAP_INFO = 17; sc, lsend
585 XYSIZE xsize;
586 XYSIZE ysize;
587 UINT8 topology_id;
590 PACKET_NUKE_TILE_INFO = 18; sc, dsend,lsend
591 TILE tile;
594 PACKET_TEAM_NAME_INFO = 19; sc, lsend
595 TEAM team_id; key
596 STRING team_name[MAX_LEN_NAME];
599 PACKET_ACHIEVEMENT_INFO = 238; sc, lsend
600 UINT8 id;
601 BOOL gained;
602 BOOL first;
605 /************** Chat/event packets **********************/
607 /* This MUST have identical structure to PACKET_EARLY_CHAT_MSG as there's casting
608 * the two. */
609 PACKET_CHAT_MSG = 25; sc, lsend
610 STRING message[MAX_LEN_MSG];
611 TILE tile;
612 EVENT event;
613 TURN turn;
614 PHASE phase;
615 CONNECTION conn_id;
618 /* This MUST have identical structure to PACKET_CHAT_MSG as there's casting
619 * the two. */
620 PACKET_EARLY_CHAT_MSG = 28; sc, lsend
621 STRING message[MAX_LEN_MSG];
622 TILE tile;
623 EVENT event;
624 TURN turn;
625 PHASE phase;
626 CONNECTION conn_id;
629 PACKET_CHAT_MSG_REQ = 26; cs, handle-per-conn, dsend
630 ESTRING message[MAX_LEN_MSG];
633 # Used in initial protocol.
634 PACKET_CONNECT_MSG = 27; sc, dsend
635 STRING message[MAX_LEN_MSG];
638 /************** City packets **********************/
640 PACKET_CITY_REMOVE = 30; sc, dsend, lsend, cancel(PACKET_CITY_INFO), cancel(PACKET_WEB_CITY_INFO_ADDITION), cancel(PACKET_CITY_SHORT_INFO)
641 CITY city_id;
644 PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO)
645 CITY id; key
646 TILE tile;
648 PLAYER owner;
649 CITIZENS size;
650 UINT8 city_radius_sq;
651 UINT8 style;
653 CITIZENS ppl_happy[FEELING_LAST];
654 CITIZENS ppl_content[FEELING_LAST];
655 CITIZENS ppl_unhappy[FEELING_LAST];
656 CITIZENS ppl_angry[FEELING_LAST];
658 UINT8 specialists_size;
659 CITIZENS specialists[SP_MAX:specialists_size];
661 UINT8 nationalities_count;
662 PLAYER nation_id[MAX_NUM_PLAYER_SLOTS:nationalities_count];
663 CITIZENS nation_citizens[MAX_NUM_PLAYER_SLOTS:nationalities_count];
665 UINT16 history;
666 UINT16 culture;
668 SINT16 surplus[O_LAST];
669 UINT16 waste[O_LAST];
670 SINT16 unhappy_penalty[O_LAST];
671 UINT16 prod[O_LAST];
672 SINT16 citizen_base[O_LAST];
673 SINT16 usage[O_LAST];
674 UINT16 food_stock, shield_stock;
676 UINT8 traderoute_count;
678 UINT16 pollution;
679 UINT16 illness_trade;
681 UINT8 production_kind;
682 UINT8 production_value;
684 TURN turn_founded;
685 TURN turn_last_built;
686 UINT8 changed_from_kind;
687 UINT8 changed_from_value;
688 UINT16 before_change_shields;
689 UINT16 disbanded_shields;
690 UINT16 caravan_shields;
691 UINT16 last_turns_shield_surplus;
693 UINT8 airlift;
694 BOOL did_buy, did_sell, was_happy;
696 BOOL diplomat_investigate;
697 UINT8 walls;
698 SINT8 city_image;
700 WORKLIST worklist;
702 BV_IMPRS improvements;
703 BV_CITY_OPTIONS city_options;
704 ESTRING name[MAX_LEN_CITYNAME];
707 PACKET_CITY_SHORT_INFO = 32; sc, lsend, is-game-info, cancel(PACKET_CITY_INFO), cancel(PACKET_WEB_CITY_INFO_ADDITION)
708 CITY id; key
709 TILE tile;
711 PLAYER owner;
712 UINT8 size;
713 UINT8 style;
715 BOOL occupied;
716 UINT8 walls;
718 BOOL happy;
719 BOOL unhappy;
721 SINT8 city_image;
723 BV_IMPRS improvements;
724 ESTRING name[MAX_LEN_CITYNAME];
727 PACKET_TRADEROUTE_INFO = 249; sc, lsend, handle-via-packet
728 CITY city;
729 UINT8 index;
730 CITY partner;
731 UINT16 value;
732 RDIR direction;
733 GOODS goods;
736 PACKET_CITY_SELL = 33; cs, dsend
737 CITY city_id;
738 UINT8 build_id;
741 PACKET_CITY_BUY = 34; cs, dsend
742 CITY city_id;
745 PACKET_CITY_CHANGE = 35; cs, dsend
746 CITY city_id;
747 UINT8 production_kind;
748 UINT8 production_value;
751 PACKET_CITY_WORKLIST = 36; cs, dsend
752 CITY city_id;
753 WORKLIST worklist;
756 PACKET_CITY_MAKE_SPECIALIST = 37; cs, dsend
757 CITY city_id;
758 CITY_COORD worker_x, worker_y;
761 PACKET_CITY_MAKE_WORKER = 38; cs, dsend
762 CITY city_id;
763 CITY_COORD worker_x, worker_y;
766 PACKET_CITY_CHANGE_SPECIALIST = 39; cs, dsend
767 CITY city_id;
768 SPECIALIST from, to;
771 PACKET_CITY_RENAME = 40; cs, dsend
772 CITY city_id;
773 ESTRING name[MAX_LEN_CITYNAME];
776 PACKET_CITY_OPTIONS_REQ = 41; cs, dsend
777 CITY city_id;
778 BV_CITY_OPTIONS options;
781 PACKET_CITY_REFRESH = 42; cs, dsend
782 CITY city_id;
785 # For city name suggestions, client sends unit id of unit building the
786 # city. The server does not use the id, but sends it back to the
787 # client so that the client knows what to do with the suggestion when
788 # it arrives back. (Currently, for city renaming, default is existing
789 # name; if wanted to suggest a new name, could do the same thing
790 # sending the city id as id, and only client needs to change.)
791 PACKET_CITY_NAME_SUGGESTION_REQ = 43; cs, dsend
792 UNIT unit_id;
795 PACKET_CITY_NAME_SUGGESTION_INFO = 44; sc, dsend, lsend
796 UNIT unit_id;
797 ESTRING name[MAX_LEN_CITYNAME];
800 PACKET_CITY_SABOTAGE_LIST = 45; sc, lsend
801 UNIT diplomat_id;
802 CITY city_id;
803 BV_IMPRS improvements;
804 GEN_ACTION action_id;
807 PACKET_WORKER_TASK = 241; cs, sc, lsend, handle-via-packet
808 CITY city_id;
809 TILE tile_id;
810 ACTIVITY activity;
811 EXTRA tgt;
812 UINT16 want;
815 /************** Player packets **********************/
817 PACKET_PLAYER_REMOVE = 50; sc, dsend, cancel(PACKET_PLAYER_INFO)
818 PLAYER playerno;
821 PACKET_PLAYER_INFO = 51; sc, is-info
822 PLAYER playerno; key
823 STRING name[MAX_LEN_NAME];
824 STRING username[MAX_LEN_NAME];
825 BOOL unassigned_user;
827 UINT32 score;
828 BOOL is_male;
829 BOOL was_created;
830 GOVERNMENT government;
831 GOVERNMENT target_government;
832 BOOL real_embassy[MAX_NUM_PLAYER_SLOTS];
833 MOOD mood;
834 UINT8 style;
835 SINT8 music_style;
836 NATION nation;
837 TEAM team;
838 BOOL is_ready;
839 BOOL phase_done;
840 TURN nturns_idle;
841 TURN turns_alive;
842 BOOL is_alive;
844 GOLD gold;
845 PERCENT tax, science,luxury;
847 UINT16 tech_upkeep;
848 UINT16 science_cost;
850 BOOL is_connected;
851 TURN revolution_finishes;
852 UINT8 ai_skill_level;
853 BARBARIAN_TYPE barbarian_type;
854 BV_PLAYER gives_shared_vision;
855 UINT16 culture;
856 SINT16 love[MAX_NUM_PLAYER_SLOTS];
858 BOOL color_valid;
859 BOOL color_changeable;
860 UINT8 color_red;
861 UINT8 color_green;
862 UINT8 color_blue;
864 BV_PLR_FLAGS flags;
866 CITYSPE wonders[B_LAST]; diff
868 UINT8 multip_count;
869 SINT32 multiplier[MAX_NUM_MULTIPLIERS:multip_count];
870 SINT32 multiplier_target[MAX_NUM_MULTIPLIERS:multip_count];
873 PACKET_PLAYER_PHASE_DONE = 52; cs, dsend
874 TURN turn;
877 PACKET_PLAYER_RATES = 53; cs, dsend
878 PERCENT tax, luxury, science;
881 PACKET_PLAYER_CHANGE_GOVERNMENT = 54; cs, dsend
882 GOVERNMENT government;
885 PACKET_PLAYER_ATTRIBUTE_BLOCK = 57; cs
888 PACKET_PLAYER_ATTRIBUTE_CHUNK = 58; pre-send, sc, cs, handle-via-packet
889 UINT32 offset; key
890 UINT32 total_length;
891 UINT16 chunk_length;
892 /* to keep memory management simple don't allocate dynamic memory */
893 MEMORY data[ATTRIBUTE_CHUNK_SIZE:chunk_length];
896 PACKET_PLAYER_DIPLSTATE = 59; sc
897 UINT32 diplstate_id; key
898 PLAYER plr1;
899 PLAYER plr2;
900 DIPLSTATE_TYPE type;
901 UINT16 turns_left;
902 UINT8 has_reason_to_cancel;
903 UINT16 contact_turns_left;
906 PACKET_PLAYER_MULTIPLIER = 242; cs
907 UINT16 count;
908 SINT32 multipliers[MAX_NUM_MULTIPLIERS:count];
911 /************** Research packets **********************/
913 PACKET_RESEARCH_INFO = 60; sc, lsend, is-game-info
914 RESEARCH id; key
915 UINT32 techs_researched;
916 UINT16 future_tech;
917 TECH researching;
918 UINT32 researching_cost;
919 UINT32 bulbs_researched;
920 TECH tech_goal;
921 SINT32 total_bulbs_prod;
922 STRING inventions[A_LAST + 1];
925 PACKET_PLAYER_RESEARCH = 55; cs, dsend
926 TECH tech;
929 PACKET_PLAYER_TECH_GOAL = 56; cs, dsend
930 TECH tech;
933 /************** Unit packets **********************/
935 PACKET_UNIT_REMOVE = 62; sc, dsend, lsend, cancel(PACKET_UNIT_INFO), cancel(PACKET_UNIT_SHORT_INFO)
936 UNIT unit_id;
939 PACKET_UNIT_INFO = 63; sc, lsend, is-game-info, cancel(PACKET_UNIT_SHORT_INFO)
940 UNIT id; key
941 PLAYER owner;
942 PLAYER nationality;
943 TILE tile;
944 DIRECTION facing;
945 CITY homecity;
947 UINT8 upkeep[O_LAST];
949 UINT8 veteran;
950 BOOL ai, paradropped;
951 BOOL occupied, transported, done_moving;
953 UNIT_TYPE type;
954 UNIT transported_by; /* Only valid if transported is set. */
955 SINT8 carrying;
956 MOVEFRAGS movesleft;
957 UINT8 hp, fuel;
958 /* UINT16 size for activity_count assumed in checks in ruleset.c */
959 UINT16 activity_count, changed_from_count;
960 TILE goto_tile;
961 ACTIVITY activity;
962 EXTRA activity_tgt;
963 ACTIVITY changed_from;
964 EXTRA changed_from_tgt;
966 SINT8 battlegroup;
968 BOOL has_orders;
969 UINT16 orders_length, orders_index;
970 BOOL orders_repeat, orders_vigilant;
971 ORDERS orders[MAX_LEN_ROUTE:orders_length];
972 DIRECTION orders_dirs[MAX_LEN_ROUTE:orders_length];
973 ACTIVITY orders_activities[MAX_LEN_ROUTE:orders_length];
974 ACTION_TGT orders_targets[MAX_LEN_ROUTE:orders_length];
975 GEN_ACTION orders_actions[MAX_LEN_ROUTE:orders_length];
977 ACTION_DECISION action_decision_want;
978 TILE action_decision_tile;
981 PACKET_UNIT_SHORT_INFO = 64; sc, lsend, is-game-info, force, cancel(PACKET_UNIT_INFO)
982 UNIT id; key
983 PLAYER owner;
984 TILE tile;
985 DIRECTION facing;
986 UNIT_TYPE type;
988 UINT8 veteran;
989 BOOL occupied, transported;
991 UINT8 hp, activity;
992 EXTRA activity_tgt;
993 UNIT transported_by; /* Only valid if transported is set. */
995 /* in packet only, not in unit struct */
996 UINT8 packet_use; /* see enum unit_info_use */
997 CITY info_city_id; /* for UNIT_INFO_CITY_SUPPORTED
998 and UNIT_INFO_CITY_PRESENT uses */
1001 PACKET_UNIT_COMBAT_INFO = 65; sc, lsend
1002 UNIT attacker_unit_id;
1003 UNIT defender_unit_id;
1004 HP attacker_hp;
1005 HP defender_hp;
1006 BOOL make_winner_veteran;
1009 PACKET_UNIT_SSCS_SET = 71; cs, dsend
1010 UNIT unit_id;
1011 UNIT_DATA_TYPE type;
1012 SINT32 value;
1015 # used for client orders: currently client-side goto and patrol
1016 PACKET_UNIT_ORDERS = 73; cs
1017 UNIT unit_id;
1018 TILE src_tile; # Origin tile, included for sanity checking
1020 UINT16 length;
1021 BOOL repeat, vigilant;
1022 ORDERS orders[MAX_LEN_ROUTE:length];
1023 DIRECTION dir[MAX_LEN_ROUTE:length];
1024 ACTIVITY activity[MAX_LEN_ROUTE:length];
1025 ACTION_TGT target[MAX_LEN_ROUTE:length];
1026 GEN_ACTION action[MAX_LEN_ROUTE:length];
1027 TILE dest_tile;
1030 # Enable autosettlers for a unit. Only works for settler units naturally.
1031 PACKET_UNIT_AUTOSETTLERS = 74; cs, dsend
1032 UNIT unit_id;
1035 # Load the given cargo into the transporter.
1036 PACKET_UNIT_LOAD = 75; cs, dsend
1037 UNIT cargo_id;
1038 UNIT transporter_id;
1039 TILE transporter_tile;
1042 # Unload the given cargo from the transporter.
1043 PACKET_UNIT_UNLOAD = 76; cs, dsend
1044 UNIT cargo_id, transporter_id;
1047 PACKET_UNIT_ACTION_QUERY = 82; cs, handle-per-conn, dsend
1048 UNIT diplomat_id;
1049 UNIT target_id; # city_id or unit_id
1050 GEN_ACTION action_type;
1053 PACKET_UNIT_TYPE_UPGRADE = 83; cs, dsend
1054 UNIT_TYPE type;
1057 PACKET_UNIT_DO_ACTION = 84; cs, dsend
1058 UNIT actor_id;
1059 SINT32 target_id; # city_id, unit_id or tile_id
1060 ACTION_TGT value;
1061 ESTRING name[MAX_LEN_NAME];
1062 GEN_ACTION action_type;
1065 PACKET_UNIT_ACTION_ANSWER = 85; sc, dsend
1066 UNIT diplomat_id;
1067 UNIT target_id; # city_id or unit_id
1068 GOLD cost;
1069 GEN_ACTION action_type;
1072 PACKET_UNIT_GET_ACTIONS = 87; cs, handle-per-conn, dsend
1073 UNIT actor_unit_id;
1074 UNIT target_unit_id;
1075 TILE target_tile_id;
1077 BOOL disturb_player;
1080 PACKET_UNIT_ACTIONS = 90; sc, dsend
1081 UNIT actor_unit_id;
1082 UNIT target_unit_id;
1083 CITY target_city_id;
1084 TILE target_tile_id;
1086 BOOL disturb_player;
1088 /* How to interpret action probabilities is documented in fc_types.h */
1089 ACT_PROB action_probabilities[MAX_NUM_ACTIONS];
1092 PACKET_UNIT_CHANGE_ACTIVITY = 222; cs, dsend
1093 UNIT unit_id;
1094 ACTIVITY activity;
1095 EXTRA target;
1098 /* 88 & 89 are ping packets (not modifiable). */
1100 /************** Diplomacy packets **********************/
1102 PACKET_DIPLOMACY_INIT_MEETING_REQ = 95; cs, dsend
1103 PLAYER counterpart;
1106 PACKET_DIPLOMACY_INIT_MEETING = 96; sc, dsend, lsend
1107 PLAYER counterpart, initiated_from;
1110 PACKET_DIPLOMACY_CANCEL_MEETING_REQ = 97; cs, dsend
1111 PLAYER counterpart;
1114 PACKET_DIPLOMACY_CANCEL_MEETING = 98; sc, dsend, lsend
1115 PLAYER counterpart, initiated_from;
1118 PACKET_DIPLOMACY_CREATE_CLAUSE_REQ = 99; cs, dsend
1119 PLAYER counterpart, giver;
1120 CLAUSE type;
1121 UINT32 value;
1124 PACKET_DIPLOMACY_CREATE_CLAUSE = 100; sc, dsend, lsend
1125 PLAYER counterpart, giver;
1126 CLAUSE type;
1127 UINT32 value;
1130 PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ = 101; cs, dsend
1131 PLAYER counterpart, giver;
1132 CLAUSE type;
1133 UINT32 value;
1136 PACKET_DIPLOMACY_REMOVE_CLAUSE = 102; sc, dsend, lsend
1137 PLAYER counterpart, giver;
1138 CLAUSE type;
1139 UINT32 value;
1142 PACKET_DIPLOMACY_ACCEPT_TREATY_REQ = 103; cs, dsend
1143 PLAYER counterpart;
1146 PACKET_DIPLOMACY_ACCEPT_TREATY = 104;sc, dsend, lsend
1147 PLAYER counterpart;
1148 BOOL I_accepted, other_accepted;
1151 PACKET_DIPLOMACY_CANCEL_PACT = 105; cs, dsend
1152 PLAYER other_player_id;
1153 CLAUSE clause;
1156 /************** Report packets **********************/
1158 PACKET_PAGE_MSG = 110; sc, lsend
1159 STRING caption[MAX_LEN_MSG];
1160 STRING headline[MAX_LEN_MSG];
1161 EVENT event;
1162 UINT32 len;
1163 UINT16 parts;
1166 PACKET_PAGE_MSG_PART = 250; sc, lsend
1167 STRING lines[MAX_LEN_CONTENT];
1170 PACKET_REPORT_REQ = 111; cs, handle-per-conn, dsend
1171 REPORT_TYPE type;
1174 /************** Connection packets **********************/
1176 # For telling clients information about other connections to server.
1177 # Clients may not use all info, but supply now to avoid unnecessary
1178 # protocol changes later.
1179 PACKET_CONN_INFO = 115; sc, lsend, is-info
1180 CONNECTION id; key
1182 # 0 means client should forget its
1183 # info about this connection
1184 BOOL used;
1185 BOOL established;
1186 BOOL observer;
1187 PLAYER player_num;
1188 CMDLEVEL access_level;
1189 STRING username[MAX_LEN_NAME];
1190 STRING addr[MAX_LEN_ADDR];
1191 STRING capability[MAX_LEN_CAPSTR];
1194 # Information about the ping times of the connections.
1195 PACKET_CONN_PING_INFO = 116; sc, lsend
1196 UINT8 connections;
1197 CONNECTION conn_id[MAX_NUM_CONNECTIONS:connections];
1198 SFLOAT10x7 ping_time[MAX_NUM_CONNECTIONS:connections];
1201 # For compatibility with older versions, this number cannot be changed.
1202 # Freeciv servers version < 2.5.0 still can send this packet in
1203 # initial protocol.
1204 PACKET_CONN_PING = 88; sc
1207 # For compatibility with older versions, this number cannot be changed.
1208 # Can be used in initial protocol, if the client received a PACKET_CONN_PING.
1209 PACKET_CONN_PONG = 89; cs, handle-per-conn
1212 PACKET_CLIENT_HEARTBEAT = 254; cs, handle-per-conn
1215 PACKET_CLIENT_INFO = 119; cs, handle-per-conn
1216 GUI_TYPE gui;
1217 STRING distribution[MAX_LEN_NAME];
1220 /************** New turn packets **********************/
1222 PACKET_END_PHASE = 125; sc, lsend
1225 # sent to everyone, not just the player whose phase it is
1226 PACKET_START_PHASE = 126; sc, lsend, dsend
1227 PHASE phase;
1230 # send to each client whenever the turn has ended.
1231 PACKET_NEW_YEAR = 127; sc, lsend
1232 YEAR year;
1233 UINT16 fragments;
1234 TURN turn;
1237 # Server has finished processing turn change
1238 PACKET_BEGIN_TURN = 128; sc, lsend
1241 # Server starts processing turn change
1242 PACKET_END_TURN = 129; sc, lsend
1245 # Freeze reports and agents
1246 PACKET_FREEZE_CLIENT = 130; sc, lsend
1249 # Thaw reports and agents
1250 PACKET_THAW_CLIENT = 131; sc, lsend
1253 /************** Spaceship packets **********************/
1255 PACKET_SPACESHIP_LAUNCH = 135; cs
1258 PACKET_SPACESHIP_PLACE = 136; cs, dsend
1259 PLACE_TYPE type;
1261 # Meaning of num:
1262 # - if type == SSHIP_ACT_PLACE_STRUCTURAL:
1263 # index to sship->structure[]
1264 # - if type != SSHIP_ACT_PLACE_STRUCTURAL:
1265 # new value for sship->fuel etc; should be just one more than
1266 # current value of ship->fuel etc Used to avoid possible
1267 # problems if we send duplicate packets when client
1268 # auto-builds?
1269 UINT8 num;
1272 PACKET_SPACESHIP_INFO = 137; sc, lsend, is-game-info
1273 PLAYER player_num; key
1274 UINT8 sship_state;
1275 UINT8 structurals;
1276 UINT8 components;
1277 UINT8 modules;
1278 UINT8 fuel;
1279 UINT8 propulsion;
1280 UINT8 habitation;
1281 UINT8 life_support;
1282 UINT8 solar_panels;
1283 YEAR launch_year;
1284 UINT32 population;
1285 UINT32 mass;
1286 BV_SPACESHIP_STRUCT structure;
1287 UFLOAT support_rate;
1288 UFLOAT energy_rate;
1289 UFLOAT success_rate;
1290 UFLOAT travel_time;
1293 /************** Ruleset packets **********************/
1295 PACKET_RULESET_UNIT = 140; sc, lsend
1296 UNIT_TYPE id;
1297 STRING name[MAX_LEN_NAME];
1298 STRING rule_name[MAX_LEN_NAME];
1299 STRING graphic_str[MAX_LEN_NAME];
1300 STRING graphic_alt[MAX_LEN_NAME];
1301 STRING sound_move[MAX_LEN_NAME];
1302 STRING sound_move_alt[MAX_LEN_NAME];
1303 STRING sound_fight[MAX_LEN_NAME];
1304 STRING sound_fight_alt[MAX_LEN_NAME];
1305 UINT8 unit_class_id;
1306 UINT16 build_cost;
1307 UINT8 pop_cost;
1308 UINT8 attack_strength;
1309 UINT8 defense_strength;
1310 MOVEFRAGS move_rate;
1311 TECH tech_requirement;
1312 UINT8 impr_requirement;
1313 GOVERNMENT gov_requirement;
1314 UINT16 vision_radius_sq;
1315 UINT8 transport_capacity;
1316 UINT8 hp;
1317 UINT8 firepower;
1318 SINT8 obsoleted_by;
1319 SINT8 converted_to;
1320 UINT8 convert_time;
1321 UINT8 fuel;
1323 UINT8 happy_cost; # unhappy people in home city
1324 UINT8 upkeep[O_LAST]; # normal upkeep cost (food, gold, shields)
1326 UINT16 paratroopers_range; # max range of paratroopers, ACTION_PARADROP
1327 UINT8 paratroopers_mr_req; # whole move points, not MOVEFRAGS
1328 UINT8 paratroopers_mr_sub; # whole move points, not MOVEFRAGS
1330 UINT8 veteran_levels;
1331 STRING veteran_name[MAX_VET_LEVELS:veteran_levels][MAX_LEN_NAME];
1332 UINT16 power_fact[MAX_VET_LEVELS:veteran_levels];
1333 MOVEFRAGS move_bonus[MAX_VET_LEVELS:veteran_levels];
1335 UINT8 bombard_rate;
1336 UINT8 city_size;
1337 UINT8 city_slots;
1339 BV_UNIT_CLASSES cargo;
1340 BV_UNIT_CLASSES targets;
1341 BV_UNIT_CLASSES embarks;
1342 BV_UNIT_CLASSES disembarks;
1344 STRVEC helptext[MAX_LEN_PACKET];
1346 BV_UTYPE_FLAGS flags;
1347 BV_UTYPE_ROLES roles;
1350 PACKET_RULESET_UNIT_BONUS = 228; sc, lsend
1351 UNIT_TYPE unit;
1352 UTYF flag;
1353 CBONUS_TYPE type;
1354 UINT8 value;
1355 BOOL quiet;
1358 PACKET_RULESET_UNIT_FLAG = 229; sc, lsend
1359 UINT8 id;
1360 STRING name[MAX_LEN_NAME];
1361 STRING helptxt[MAX_LEN_PACKET];
1364 PACKET_RULESET_UNIT_CLASS_FLAG = 230; sc, lsend
1365 UINT8 id;
1366 STRING name[MAX_LEN_NAME];
1367 STRING helptxt[MAX_LEN_PACKET];
1370 PACKET_RULESET_GAME = 141; sc, lsend
1371 UINT8 default_specialist;
1373 TECH_LIST global_init_techs[MAX_NUM_TECH_LIST];
1374 BUILDING_LIST global_init_buildings[MAX_NUM_BUILDING_LIST];
1376 UINT8 veteran_levels;
1377 STRING veteran_name[MAX_VET_LEVELS:veteran_levels][MAX_LEN_NAME];
1378 UINT16 power_fact[MAX_VET_LEVELS:veteran_levels];
1379 MOVEFRAGS move_bonus[MAX_VET_LEVELS:veteran_levels];
1381 UINT8 background_red;
1382 UINT8 background_green;
1383 UINT8 background_blue;
1386 PACKET_RULESET_SPECIALIST = 142; sc, lsend
1387 SPECIALIST id;
1389 STRING plural_name[MAX_LEN_NAME];
1390 STRING rule_name[MAX_LEN_NAME];
1391 STRING short_name[MAX_LEN_NAME];
1393 STRING graphic_alt[MAX_LEN_NAME];
1395 UINT8 reqs_count;
1396 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1398 STRVEC helptext[MAX_LEN_PACKET];
1401 PACKET_RULESET_GOVERNMENT_RULER_TITLE = 143; sc, lsend
1402 GOVERNMENT gov;
1403 NATION nation;
1404 STRING male_title[MAX_LEN_NAME];
1405 STRING female_title[MAX_LEN_NAME];
1408 PACKET_RULESET_TECH = 144; sc, lsend
1409 TECH id;
1410 TECH root_req;
1411 UINT8 research_reqs_count;
1412 REQUIREMENT research_reqs[MAX_NUM_REQS:research_reqs_count];
1413 UINT8 tclass;
1414 BOOL removed;
1415 BV_TECH_FLAGS flags;
1416 UFLOAT10x3 cost;
1417 UINT32 num_reqs;
1418 STRING name[MAX_LEN_NAME];
1419 STRING rule_name[MAX_LEN_NAME];
1420 STRVEC helptext[MAX_LEN_PACKET];
1421 STRING graphic_str[MAX_LEN_NAME];
1422 STRING graphic_alt[MAX_LEN_NAME];
1425 PACKET_RULESET_TECH_CLASS = 9; sc, lsend
1426 UINT16 id;
1427 STRING name[MAX_LEN_NAME];
1428 STRING rule_name[MAX_LEN_NAME];
1429 UINT16 cost_pct;
1432 PACKET_RULESET_TECH_FLAG = 234; sc, lsend
1433 UINT8 id;
1434 STRING name[MAX_LEN_NAME];
1435 STRING helptxt[MAX_LEN_PACKET];
1438 PACKET_RULESET_GOVERNMENT = 145; sc, lsend
1439 GOVERNMENT id;
1441 UINT8 reqs_count;
1442 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1444 STRING name[MAX_LEN_NAME];
1445 STRING rule_name[MAX_LEN_NAME];
1446 STRING graphic_str[MAX_LEN_NAME];
1447 STRING graphic_alt[MAX_LEN_NAME];
1448 STRVEC helptext[MAX_LEN_PACKET];
1451 PACKET_RULESET_TERRAIN_CONTROL = 146; sc, lsend
1452 UINT8 ocean_reclaim_requirement_pct; /* # adjacent land tiles for reclaim */
1453 UINT8 land_channel_requirement_pct; /* # adjacent ocean tiles for channel */
1454 UINT8 terrain_thaw_requirement_pct; /* # adjacent unfrozen tiles for thaw */
1455 UINT8 terrain_freeze_requirement_pct; /* # adjacent frozen tiles */
1456 UINT8 lake_max_size; /* bodies of water up to this size are freshwater */
1457 UINT8 min_start_native_area;
1458 MOVEFRAGS move_fragments;
1459 MOVEFRAGS igter_cost;
1460 BOOL pythagorean_diagonal;
1461 STRING gui_type_base0[MAX_LEN_NAME];
1462 STRING gui_type_base1[MAX_LEN_NAME];
1465 PACKET_RULESETS_READY = 225; sc, lsend
1468 PACKET_RULESET_NATION_SETS = 236; sc, lsend
1469 UINT8 nsets;
1470 STRING names[MAX_NUM_NATION_SETS:nsets][MAX_LEN_NAME];
1471 STRING rule_names[MAX_NUM_NATION_SETS:nsets][MAX_LEN_NAME];
1472 /* This relies on MAX_NUM_NATION_SETS not being too big to overflow
1473 * the packet length: */
1474 STRING descriptions[MAX_NUM_NATION_SETS:nsets][MAX_LEN_MSG]; /*untranslated*/
1477 PACKET_RULESET_NATION_GROUPS = 147; sc, lsend
1478 UINT8 ngroups;
1479 STRING groups[MAX_NUM_NATION_GROUPS:ngroups][MAX_LEN_NAME];
1480 BOOL hidden[MAX_NUM_NATION_GROUPS:ngroups];
1483 PACKET_RULESET_NATION = 148; sc, lsend
1484 NATION id; key
1486 STRING translation_domain[MAX_LEN_NAME];
1487 /* Strings are untranslated */
1488 STRING adjective[MAX_LEN_NAME];
1489 STRING rule_name[MAX_LEN_NAME];
1490 STRING noun_plural[MAX_LEN_NAME];
1491 STRING graphic_str[MAX_LEN_NAME];
1492 STRING graphic_alt[MAX_LEN_NAME];
1493 STRING legend[MAX_LEN_MSG];
1495 UINT8 style;
1497 UINT8 leader_count;
1498 STRING leader_name[MAX_NUM_LEADERS:leader_count][MAX_LEN_NAME];
1499 BOOL leader_is_male[MAX_NUM_LEADERS:leader_count];
1501 BOOL is_playable;
1502 BARBARIAN_TYPE barbarian_type;
1504 UINT8 nsets;
1505 UINT8 sets[MAX_NUM_NATION_SETS:nsets];
1507 UINT8 ngroups;
1508 UINT8 groups[MAX_NUM_NATION_GROUPS:ngroups];
1510 GOVERNMENT init_government_id;
1511 TECH_LIST init_techs[MAX_NUM_TECH_LIST];
1512 UNIT_LIST init_units[MAX_NUM_UNIT_LIST];
1513 BUILDING_LIST init_buildings[MAX_NUM_BUILDING_LIST];
1516 # Separate from PACKET_RULESET_NATION since it can change in pregame
1517 # without a ruleset reload
1518 PACKET_NATION_AVAILABILITY = 237; sc, lsend
1519 UINT16 ncount;
1520 BOOL is_pickable[MAX_NUM_NATIONS:ncount];
1521 BOOL nationset_change;
1524 PACKET_RULESET_STYLE = 239; sc, lsend
1525 UINT8 id;
1526 STRING name[MAX_LEN_NAME];
1527 STRING rule_name[MAX_LEN_NAME];
1530 PACKET_RULESET_CITY = 149; sc, lsend
1531 UINT8 style_id;
1532 STRING name[MAX_LEN_NAME];
1533 STRING rule_name[MAX_LEN_NAME];
1534 STRING citizens_graphic[MAX_LEN_NAME];
1535 STRING citizens_graphic_alt[MAX_LEN_NAME];
1536 UINT8 reqs_count;
1537 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1538 STRING graphic[MAX_LEN_NAME];
1539 STRING graphic_alt[MAX_LEN_NAME];
1542 PACKET_RULESET_BUILDING = 150; sc, lsend
1543 IMPROVEMENT id;
1544 IMPR_GENUS genus;
1545 STRING name[MAX_LEN_NAME];
1546 STRING rule_name[MAX_LEN_NAME];
1547 STRING graphic_str[MAX_LEN_NAME];
1548 STRING graphic_alt[MAX_LEN_NAME];
1549 UINT8 reqs_count;
1550 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1551 UINT8 obs_count;
1552 REQUIREMENT obs_reqs[MAX_NUM_REQS:obs_count];
1553 UINT16 build_cost;
1554 UINT8 upkeep, sabotage;
1555 BV_IMPR_FLAGS flags;
1556 STRING soundtag[MAX_LEN_NAME];
1557 STRING soundtag_alt[MAX_LEN_NAME];
1558 STRVEC helptext[MAX_LEN_PACKET];
1561 PACKET_RULESET_TERRAIN = 151; sc, lsend
1562 TERRAIN id;
1564 UINT8 tclass;
1565 BV_TERRAIN_FLAGS flags;
1566 BV_UNIT_CLASSES native_to;
1568 STRING name[MAX_LEN_NAME];
1569 STRING rule_name[MAX_LEN_NAME];
1570 STRING graphic_str[MAX_LEN_NAME];
1571 STRING graphic_alt[MAX_LEN_NAME];
1573 UINT8 movement_cost; # Whole movement points (not multiplied by SINGLE_MOVE)
1574 SINT16 defense_bonus;
1576 UINT8 output[O_LAST];
1577 UINT8 num_resources;
1578 RESOURCE resources[MAX_RESOURCE_TYPES:num_resources];
1580 UINT16 road_output_incr_pct[O_LAST];
1581 UINT8 base_time;
1582 UINT8 road_time;
1584 TERRAIN irrigation_result;
1585 UINT8 irrigation_food_incr;
1586 UINT8 irrigation_time;
1588 TERRAIN mining_result;
1589 UINT8 mining_shield_incr;
1590 UINT8 mining_time;
1592 SINT16 animal;
1594 TERRAIN transform_result;
1595 UINT8 transform_time;
1596 UINT8 clean_pollution_time;
1597 UINT8 clean_fallout_time;
1598 UINT8 pillage_time;
1600 UINT8 color_red;
1601 UINT8 color_green;
1602 UINT8 color_blue;
1604 STRVEC helptext[MAX_LEN_PACKET];
1607 PACKET_RULESET_TERRAIN_FLAG = 231; sc, lsend
1608 UINT8 id;
1609 STRING name[MAX_LEN_NAME];
1610 STRING helptxt[MAX_LEN_PACKET];
1613 PACKET_RULESET_UNIT_CLASS = 152; sc, lsend
1614 UINT8 id;
1615 STRING name[MAX_LEN_NAME];
1616 STRING rule_name[MAX_LEN_NAME];
1617 MOVEFRAGS min_speed;
1618 UINT8 hp_loss_pct;
1619 UINT8 hut_behavior;
1620 UINT16 non_native_def_pct;
1621 BV_UCLASS_FLAGS flags;
1623 STRVEC helptext[MAX_LEN_PACKET];
1626 PACKET_RULESET_EXTRA = 232; sc, lsend
1627 UINT8 id;
1628 STRING name[MAX_LEN_NAME];
1629 STRING rule_name[MAX_LEN_NAME];
1630 UINT8 category;
1631 UINT16 causes;
1632 UINT8 rmcauses;
1633 STRING activity_gfx[MAX_LEN_NAME];
1634 STRING act_gfx_alt[MAX_LEN_NAME];
1635 STRING act_gfx_alt2[MAX_LEN_NAME];
1636 STRING rmact_gfx[MAX_LEN_NAME];
1637 STRING rmact_gfx_alt[MAX_LEN_NAME];
1638 STRING graphic_str[MAX_LEN_NAME];
1639 STRING graphic_alt[MAX_LEN_NAME];
1640 UINT8 reqs_count;
1641 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1642 UINT8 rmreqs_count;
1643 REQUIREMENT rmreqs[MAX_NUM_REQS:rmreqs_count];
1644 UINT16 appearance_chance;
1645 UINT8 appearance_reqs_count;
1646 REQUIREMENT appearance_reqs[MAX_NUM_REQS:appearance_reqs_count];
1647 UINT16 disappearance_chance;
1648 UINT8 disappearance_reqs_count;
1649 REQUIREMENT disappearance_reqs[MAX_NUM_REQS:disappearance_reqs_count];
1650 TECH visibility_req;
1651 BOOL buildable;
1652 UINT8 build_time;
1653 UINT8 build_time_factor;
1654 UINT8 removal_time;
1655 UINT8 removal_time_factor;
1656 UINT8 defense_bonus;
1657 EUS eus;
1658 BV_UNIT_CLASSES native_to;
1659 BV_EXTRA_FLAGS flags;
1660 BV_EXTRAS hidden_by;
1661 BV_EXTRAS conflicts;
1662 STRVEC helptext[MAX_LEN_PACKET];
1665 PACKET_RULESET_EXTRA_FLAG = 226; sc, lsend
1666 UINT8 id;
1667 STRING name[MAX_LEN_NAME];
1668 STRING helptxt[MAX_LEN_PACKET];
1671 PACKET_RULESET_BASE = 153; sc, lsend
1672 UINT8 id;
1673 BASE_GUI gui_type;
1674 SINT8 border_sq;
1675 SINT8 vision_main_sq;
1676 SINT8 vision_invis_sq;
1677 BV_BASE_FLAGS flags;
1680 PACKET_RULESET_ROAD = 220; sc, lsend
1681 UINT8 id;
1682 UINT8 first_reqs_count;
1683 REQUIREMENT first_reqs[MAX_NUM_REQS:first_reqs_count];
1684 SINT16 move_cost; # not MOVEFRAGS because -1 is valid
1685 MOVE_MODE move_mode;
1686 UINT16 tile_incr_const[O_LAST];
1687 UINT16 tile_incr[O_LAST];
1688 UINT16 tile_bonus[O_LAST];
1689 ROAD_COMPAT compat;
1690 BV_ROADS integrates;
1691 BV_ROAD_FLAGS flags;
1694 PACKET_RULESET_GOODS = 248; sc, lsend
1695 UINT8 id;
1696 STRING name[MAX_LEN_NAME];
1697 STRING rule_name[MAX_LEN_NAME];
1698 UINT8 reqs_count;
1699 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1700 UINT16 from_pct;
1701 UINT16 to_pct;
1702 BV_GOODS_FLAGS flags;
1703 STRVEC helptext[MAX_LEN_PACKET];
1706 PACKET_RULESET_DISASTER = 224; sc, lsend
1707 UINT8 id;
1708 STRING name[MAX_LEN_NAME];
1709 STRING rule_name[MAX_LEN_NAME];
1710 UINT8 reqs_count;
1711 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1712 UINT8 frequency;
1713 BV_DISASTER_EFFECTS effects;
1716 PACKET_RULESET_ACHIEVEMENT = 233; sc, lsend
1717 UINT8 id;
1718 STRING name[MAX_LEN_NAME];
1719 STRING rule_name[MAX_LEN_NAME];
1720 ACHIEVEMENT_TYPE type;
1721 BOOL unique;
1722 UINT16 value;
1725 PACKET_RULESET_TRADE = 227; sc, lsend
1726 UINT8 id;
1727 UINT16 trade_pct;
1728 TRI cancelling;
1729 TR_BONUS_TYPE bonus_type;
1732 PACKET_RULESET_ACTION = 246; sc, lsend
1733 GEN_ACTION id;
1735 STRING ui_name[MAX_LEN_NAME];
1736 BOOL quiet;
1738 ACTOR_KIND act_kind;
1739 TARGET_KIND tgt_kind;
1741 SINT32 min_distance;
1742 SINT32 max_distance;
1743 BV_ACTIONS blocked_by;
1746 PACKET_RULESET_ACTION_ENABLER = 235; sc, lsend
1747 GEN_ACTION enabled_action;
1748 UINT8 actor_reqs_count;
1749 REQUIREMENT actor_reqs[MAX_NUM_REQS:actor_reqs_count];
1750 UINT8 target_reqs_count;
1751 REQUIREMENT target_reqs[MAX_NUM_REQS:target_reqs_count];
1754 PACKET_RULESET_ACTION_AUTO = 252; sc, lsend
1755 UINT8 id;
1757 ACTION_AUTO_CAUSE cause;
1758 UINT8 reqs_count;
1759 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1761 UINT8 alternatives_count;
1762 GEN_ACTION alternatives[MAX_NUM_ACTIONS:alternatives_count];
1765 PACKET_RULESET_MUSIC = 240; sc, lsend
1766 UINT8 id;
1767 STRING music_peaceful[MAX_LEN_NAME];
1768 STRING music_combat[MAX_LEN_NAME];
1769 UINT8 reqs_count;
1770 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1773 PACKET_RULESET_MULTIPLIER = 243; sc, dsend, lsend
1774 MULTIPLIER id;
1775 SINT32 start;
1776 SINT32 stop;
1777 UINT32 step;
1778 SINT32 def;
1779 SINT32 offset;
1780 SINT32 factor;
1781 STRING name[MAX_LEN_NAME];
1782 STRING rule_name[MAX_LEN_NAME];
1783 STRVEC helptext[MAX_LEN_PACKET];
1786 /**************************************************************************
1787 Ruleset control values: single values, all of which are needed before
1788 sending other ruleset data. After sending this packet, resend every
1789 other part of the rulesets. (Terrain ruleset has enough info for its
1790 own "control" packet, done separately.)
1791 **************************************************************************/
1792 PACKET_RULESET_CONTROL = 155; sc, lsend
1793 UINT16 num_unit_classes;
1794 UINT16 num_unit_types;
1795 UINT16 num_impr_types;
1796 UINT16 num_tech_classes;
1797 UINT16 num_tech_types;
1798 UINT16 num_extra_types;
1799 UINT16 num_base_types;
1800 UINT16 num_road_types;
1801 UINT16 num_resource_types;
1802 UINT16 num_goods_types;
1803 UINT16 num_disaster_types;
1804 UINT16 num_achievement_types;
1805 UINT16 num_multipliers;
1806 UINT16 num_styles;
1807 UINT16 num_music_styles;
1808 UINT16 government_count;
1809 UINT16 nation_count;
1810 UINT16 styles_count;
1811 UINT16 terrain_count;
1812 UINT16 num_specialist_types;
1814 STRING preferred_tileset[MAX_LEN_NAME];
1815 STRING preferred_soundset[MAX_LEN_NAME];
1816 STRING preferred_musicset[MAX_LEN_NAME];
1817 BOOL popup_tech_help;
1819 STRING name[MAX_LEN_NAME];
1820 STRING version[MAX_LEN_NAME];
1821 UINT16 desc_length;
1824 PACKET_RULESET_SUMMARY = 251; sc, lsend
1825 STRING text[MAX_LEN_CONTENT];
1828 PACKET_RULESET_DESCRIPTION_PART = 247; sc, lsend
1829 STRING text[MAX_LEN_CONTENT];
1832 /*********************************************************
1833 Below are the packets that control single-player mode.
1834 *********************************************************/
1835 PACKET_SINGLE_WANT_HACK_REQ = 160; cs, handle-per-conn, handle-via-packet
1836 STRING token[MAX_LEN_NAME];
1839 PACKET_SINGLE_WANT_HACK_REPLY = 161; sc, dsend
1840 BOOL you_have_hack;
1843 PACKET_RULESET_CHOICES = 162; sc
1844 UINT8 ruleset_count;
1845 STRING rulesets[MAX_NUM_RULESETS:ruleset_count][MAX_RULESET_NAME_LENGTH];
1848 PACKET_GAME_LOAD = 163; sc, lsend, dsend
1849 BOOL load_successful;
1850 STRING load_filename[MAX_LEN_PACKET];
1853 PACKET_SERVER_SETTING_CONTROL = 164; sc, handle-via-packet, is-info
1854 UINT16 settings_num;
1855 UINT8 categories_num;
1856 STRING category_names[256:categories_num][MAX_LEN_NAME]; /* untranslated */
1859 PACKET_SERVER_SETTING_CONST = 165; sc, handle-via-packet, is-info
1860 UINT16 id; key
1861 STRING name[MAX_LEN_NAME];
1862 STRING short_help[MAX_LEN_PACKET]; /* untranslated */
1863 STRING extra_help[MAX_LEN_PACKET]; /* untranslated */
1864 UINT8 category;
1867 PACKET_SERVER_SETTING_BOOL = 166; sc, handle-via-packet, is-info
1868 UINT16 id; key
1869 BOOL is_visible;
1870 BOOL is_changeable;
1871 BOOL initial_setting;
1873 BOOL val;
1874 BOOL default_val;
1877 PACKET_SERVER_SETTING_INT = 167; sc, handle-via-packet, is-info
1878 UINT16 id; key
1879 BOOL is_visible;
1880 BOOL is_changeable;
1881 BOOL initial_setting;
1883 SINT32 val;
1884 SINT32 default_val;
1885 SINT32 min_val;
1886 SINT32 max_val;
1889 PACKET_SERVER_SETTING_STR = 168; sc, handle-via-packet, is-info
1890 UINT16 id; key
1891 BOOL is_visible;
1892 BOOL is_changeable;
1893 BOOL initial_setting;
1895 STRING val[MAX_LEN_PACKET];
1896 STRING default_val[MAX_LEN_PACKET];
1899 PACKET_SERVER_SETTING_ENUM = 169; sc, handle-via-packet, is-info
1900 UINT16 id; key
1901 BOOL is_visible;
1902 BOOL is_changeable;
1903 BOOL initial_setting;
1905 SINT8 val;
1906 SINT8 default_val;
1907 SINT8 values_num;
1908 STRING support_names[64:values_num][MAX_LEN_NAME];
1909 STRING pretty_names[64:values_num][MAX_LEN_ENUM]; /* untranslated */
1912 PACKET_SERVER_SETTING_BITWISE = 170; sc, handle-via-packet, is-info
1913 UINT16 id; key
1914 BOOL is_visible;
1915 BOOL is_changeable;
1916 BOOL initial_setting;
1918 UINT16 val;
1919 UINT16 default_val;
1920 UINT8 bits_num;
1921 STRING support_names[64:bits_num][MAX_LEN_NAME];
1922 STRING pretty_names[64:bits_num][MAX_LEN_ENUM]; /* untranslated */
1925 PACKET_SET_TOPOLOGY = 253; sc
1926 UINT8 topology_id;
1929 /************** Effects hash packets **********************/
1931 PACKET_RULESET_EFFECT = 175; sc, lsend
1932 EFFECT_TYPE effect_type;
1933 SINT32 effect_value;
1934 BOOL has_multiplier;
1935 MULTIPLIER multiplier;
1937 UINT8 reqs_count;
1938 REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
1941 PACKET_RULESET_RESOURCE = 177; sc, lsend
1942 UINT8 id;
1944 UINT8 output[O_LAST];
1947 /****************** Scenario Related Packets ******************/
1949 PACKET_SCENARIO_INFO = 180; sc, handle-via-packet, handle-per-conn
1950 BOOL is_scenario;
1951 STRING name[256];
1952 STRING authors[MAX_LEN_PACKET / 3];
1953 BOOL players;
1954 BOOL startpos_nations;
1955 BOOL save_random;
1956 BOOL prevent_new_cities;
1957 BOOL lake_flooding;
1958 BOOL handmade;
1959 BOOL allow_ai_type_fallback;
1960 BOOL ruleset_locked;
1962 /* Unused at client side. */
1963 BOOL have_resources;
1966 PACKET_SCENARIO_DESCRIPTION = 13; sc, handle-per-conn
1967 STRING description[MAX_LEN_CONTENT];
1970 PACKET_SAVE_SCENARIO = 181; cs, handle-per-conn, dsend
1971 STRING name[MAX_LEN_NAME];
1974 /*************** Vote Packets ***************/
1976 PACKET_VOTE_NEW = 185; sc, handle-via-packet
1977 UINT32 vote_no;
1978 STRING user[MAX_LEN_NAME];
1979 STRING desc[512];
1980 UINT8 percent_required;
1981 UINT32 flags;
1984 /* Sent to the client to give the new vote totals. */
1985 PACKET_VOTE_UPDATE = 186; sc, is-info
1986 UINT32 vote_no; key
1987 UINT8 yes;
1988 UINT8 no;
1989 UINT8 abstain;
1990 UINT8 num_voters;
1993 PACKET_VOTE_REMOVE = 187; sc
1994 UINT32 vote_no;
1997 PACKET_VOTE_RESOLVE = 188; sc
1998 UINT32 vote_no;
1999 BOOL passed;
2002 /* Sent to the server by the client when the client
2003 * votes:
2004 * - yes (value = +1)
2005 * - no (value = -1)
2006 * - abstain (value = 0) */
2007 PACKET_VOTE_SUBMIT = 189; cs, handle-per-conn, no-delta
2008 UINT32 vote_no;
2009 SINT8 value;
2012 /************** Client Editor Packets **********************/
2014 /* Always keep this as the first edit type packet sent by
2015 * the client, so that the test in server/srv_main.c in
2016 * the function is_client_edit_packet() is easy to write. */
2017 PACKET_EDIT_MODE = 190; cs, handle-per-conn, dsend
2018 BOOL state;
2021 PACKET_EDIT_RECALCULATE_BORDERS = 197; cs, handle-per-conn
2024 PACKET_EDIT_CHECK_TILES = 198; cs, handle-per-conn
2027 PACKET_EDIT_TOGGLE_FOGOFWAR = 199; cs, handle-per-conn, dsend
2028 PLAYER player;
2031 PACKET_EDIT_TILE_TERRAIN = 200; cs, handle-per-conn, dsend
2032 TILE tile; key
2033 TERRAIN terrain;
2034 UINT8 size;
2037 PACKET_EDIT_TILE_EXTRA = 202; cs, handle-per-conn, dsend
2038 TILE tile; key
2039 EXTRA extra_type_id;
2040 BOOL removal;
2041 UINT8 size;
2044 PACKET_EDIT_STARTPOS = 204; cs, sc, dsend, handle-per-conn, handle-via-packet, no-delta
2045 TILE id;
2046 BOOL removal;
2047 SINT32 tag;
2050 PACKET_EDIT_STARTPOS_FULL = 205; cs, sc, handle-per-conn, handle-via-packet, no-delta
2051 TILE id;
2052 BOOL exclude;
2053 BV_STARTPOS_NATIONS nations;
2056 PACKET_EDIT_TILE = 206; cs, handle-per-conn, handle-via-packet
2057 TILE tile; key
2058 BV_EXTRAS extras;
2059 RESOURCE resource;
2060 TERRAIN terrain;
2061 NATION startpos_nation;
2062 STRING label[MAX_LEN_NAME];
2065 PACKET_EDIT_UNIT_CREATE = 207; cs, handle-per-conn, dsend
2066 PLAYER owner;
2067 TILE tile;
2068 UNIT_TYPE type;
2069 UINT8 count;
2070 SINT32 tag;
2073 PACKET_EDIT_UNIT_REMOVE = 208; cs, handle-per-conn, dsend
2074 PLAYER owner;
2075 TILE tile;
2076 UNIT_TYPE type;
2077 UINT8 count;
2080 PACKET_EDIT_UNIT_REMOVE_BY_ID = 209; cs, handle-per-conn, dsend
2081 UNIT id;
2084 PACKET_EDIT_UNIT = 210; cs, handle-per-conn, handle-via-packet
2085 UNIT id; key
2086 UNIT_TYPE utype;
2087 PLAYER owner;
2088 CITY homecity;
2089 MOVEFRAGS moves_left;
2090 UINT8 hp;
2091 UINT8 veteran;
2092 UINT8 fuel;
2093 ACTIVITY activity;
2094 UINT16 activity_count;
2095 BASE activity_base;
2096 BOOL debug;
2097 BOOL moved;
2098 BOOL paradropped;
2099 BOOL done_moving;
2100 UNIT transported_by;
2103 PACKET_EDIT_CITY_CREATE = 211; cs, handle-per-conn, dsend
2104 PLAYER owner;
2105 TILE tile;
2106 UINT8 size;
2107 SINT32 tag;
2110 PACKET_EDIT_CITY_REMOVE = 212; cs, handle-per-conn, dsend
2111 CITY id;
2114 PACKET_EDIT_CITY = 213; cs, handle-per-conn, handle-via-packet
2115 CITY id; key
2116 ESTRING name[MAX_LEN_CITYNAME];
2117 PLAYER owner;
2118 PLAYER original;
2119 UINT8 size;
2120 UINT16 history;
2121 UINT8 ppl_happy[5], ppl_content[5], ppl_unhappy[5], ppl_angry[5];
2122 UINT8 specialists_size;
2123 UINT8 specialists[SP_MAX:specialists_size];
2124 UINT16 trade[MAX_TRADE_ROUTES];
2125 UINT16 food_stock, shield_stock;
2126 BOOL airlift;
2127 BOOL debug;
2128 BOOL did_buy;
2129 BOOL did_sell;
2130 BOOL was_happy;
2131 UINT8 anarchy;
2132 UINT8 rapture;
2133 UINT8 steal;
2134 TURN turn_founded;
2135 TURN turn_last_built;
2136 SINT32 built[B_LAST]; diff
2137 UINT8 production_kind;
2138 UINT8 production_value;
2139 UINT16 last_turns_shield_surplus;
2140 BV_CITY_OPTIONS city_options;
2143 PACKET_EDIT_PLAYER_CREATE = 214; cs, handle-per-conn, dsend
2144 SINT32 tag;
2147 PACKET_EDIT_PLAYER_REMOVE = 215; cs, handle-per-conn, dsend
2148 PLAYER id;
2151 PACKET_EDIT_PLAYER = 216; cs, handle-per-conn, lsend
2152 PLAYER id; key
2153 STRING name[MAX_LEN_NAME];
2154 STRING username[MAX_LEN_NAME];
2155 STRING ranked_username[MAX_LEN_NAME];
2156 TURN user_turns;
2158 BOOL is_male;
2159 GOVERNMENT government;
2160 GOVERNMENT target_government;
2161 NATION nation;
2162 TEAM team;
2164 BOOL phase_done;
2165 TURN nturns_idle;
2166 BOOL is_alive;
2167 TURN revolution_finishes;
2169 BOOL capital;
2170 BV_PLAYER embassy;
2171 GOLD gold;
2172 PERCENT tax, science, luxury;
2174 UINT16 future_tech;
2175 TECH researching;
2176 UINT32 bulbs_researched;
2177 BOOL inventions[A_LAST+1]; diff
2179 BOOL ai;
2180 BOOL scenario_reserved;
2183 PACKET_EDIT_PLAYER_VISION = 217; cs, handle-per-conn, dsend
2184 PLAYER player;
2185 TILE tile;
2186 BOOL known;
2187 UINT8 size;
2190 /* Always keep this as the last edit type packet sent by
2191 * the client, so that the test in server/srv_main.c in
2192 * the function is_client_edit_packet() is easy to write. */
2193 PACKET_EDIT_GAME = 218; cs, handle-per-conn, handle-via-packet
2194 YEAR year;
2195 BOOL scenario;
2196 STRING scenario_name[256];
2197 STRING scenario_authors[MAX_LEN_PACKET / 3];
2198 BOOL scenario_random;
2199 BOOL scenario_players;
2200 BOOL startpos_nations;
2201 BOOL prevent_new_cities;
2202 BOOL lake_flooding;
2203 BOOL ruleset_locked;
2206 PACKET_EDIT_SCENARIO_DESC = 14; cs, handle-per-conn
2207 STRING scenario_desc[MAX_LEN_CONTENT];
2210 /************** Server Editor Packets **********************/
2212 PACKET_EDIT_OBJECT_CREATED = 219; sc, dsend
2213 SINT32 tag;
2214 SINT32 id;
2217 /************** Client Activity Requests **********************/
2219 PACKET_PLAY_MUSIC = 245; sc, lsend
2220 STRING tag[MAX_LEN_NAME];
2223 /*************** Webclient specific packets ****************/
2224 /* Use range 256:511 for these */
2226 PACKET_WEB_CITY_INFO_ADDITION = 256; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO)
2227 CITY id; key
2229 UINT16 granary_size;
2230 TURN granary_turns;
2231 UINT16 buy_gold_cost;