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
14 Range 256:511 is reserved for freeciv-web specific packets.
22 Supported are: c-style (/ * * /), c++-style (//) and python style
23 (#). Empty lines will be ignored.
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
31 freeciv-web build does not like comments on the end of the line.
32 Please put comments to lines of their own.
37 A packet definition starts with a header line, contains variable
38 field declarations, and ends with a single line containing the word
41 PACKET_<PACKET_NAME>=<packet num>; [<packet flags>]
42 <type1> <field1>; [<field flags>]
43 <type2> <field2>; [<field flags>]
50 The header line contains the packet name. The packet name is used
51 for the naming of the generated code struct and functions:
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.
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
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.
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
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>".
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.
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.
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
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.
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)
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)
291 type ACTION_TGT = SINT16
292 type BASE = sint8(Base_type_id)
293 type ROAD = sint8(Road_type_id)
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)
304 type RESEARCH = UINT8
305 type RESOURCE = uint8(Resource_type_id)
306 type SPECIALIST = uint8(Specialist_type_id)
309 type TERRAIN = uint8(Terrain_type_id)
312 type UNIT_TYPE = uint8(Unit_type_id)
313 type GOODS = uint8(Goods_type_id)
316 type CITY_COORD = UINT8
320 # units of TERRAIN_CONTROL.move_fragments
321 type MOVEFRAGS = UINT16
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:
332 Login/pregame/endgame
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
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
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
389 # Used in initial protocol.
390 PACKET_AUTHENTICATION_REQ
= 6; sc
, handle
-per
-conn
, dsend
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
408 STRING name[MAX_LEN_NAME];
412 PACKET_PLAYER_READY = 11; cs, dsend
417 PACKET_ENDGAME_REPORT = 12; sc, lsend, no-delta, handle-via-packet
419 STRING category_name[32:category_num][MAX_LEN_NAME];
424 PACKET_ENDGAME_PLAYER = 223; sc, lsend, no-delta, handle-via-packet
428 UINT32 category_score[32:category_num];
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
438 PACKET_TILE_INFO = 15; sc, lsend, is-game-info
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;
458 PERSISTENT_READY persistent_ready;
459 AIRLIFTING_STYLE airlifting_style;
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 */
474 UINT8 pop_report_zeroes;
475 BOOL citizen_nationality;
476 UINT16 citizen_convert_speed;
477 UINT8 citizen_partisans_pct;
481 DIPLOMACY_MODE diplomacy;
487 UINT8 forced_science;
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
495 UINT32 globalwarming;
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
506 HAPPYBORDERSTYPE happyborders;
508 UINT16 illness_base_factor;
509 UINT8 illness_min_size;
511 UINT16 illness_pollution_factor;
512 UINT16 illness_trade_infection;
513 UINT8 init_city_radius_sq;
514 /* If set, editing is allowed */
516 /* TRUE only in pregame for "new" (not loaded) games */
520 UINT8 min_city_center_output[O_LAST];
523 BOOL muuk_shield_wipe;
526 UINT32 nuclearwinter;
528 PHASE_MODE phase_mode;
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;
539 BOOL unreachable_protects;
544 VICTORY_CONDITIONS victory_conditions;
545 BOOL team_pooled_research;
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;
554 UINT32 first_timeout;
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
590 PACKET_NUKE_TILE_INFO = 18; sc, dsend,lsend
594 PACKET_TEAM_NAME_INFO = 19; sc, lsend
596 STRING team_name[MAX_LEN_NAME];
599 PACKET_ACHIEVEMENT_INFO = 238; sc, lsend
605 /************** Chat/event packets **********************/
607 /* This MUST have identical structure to PACKET_EARLY_CHAT_MSG as there's casting
609 PACKET_CHAT_MSG
= 25; sc
, lsend
610 STRING message
[MAX_LEN_MSG
];
618 /* This MUST have identical structure to PACKET_CHAT_MSG as there
's casting
620 PACKET_EARLY_CHAT_MSG = 28; sc, lsend
621 STRING message[MAX_LEN_MSG];
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)
644 PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO)
650 UINT8 city_radius_sq;
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];
668 SINT16 surplus[O_LAST];
669 UINT16 waste[O_LAST];
670 SINT16 unhappy_penalty[O_LAST];
672 SINT16 citizen_base[O_LAST];
673 SINT16 usage[O_LAST];
674 UINT16 food_stock, shield_stock;
676 UINT8 traderoute_count;
679 UINT16 illness_trade;
681 UINT8 production_kind;
682 UINT8 production_value;
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;
694 BOOL did_buy, did_sell, was_happy;
696 BOOL diplomat_investigate;
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)
723 BV_IMPRS improvements;
724 ESTRING name[MAX_LEN_CITYNAME];
727 PACKET_TRADEROUTE_INFO = 249; sc, lsend, handle-via-packet
736 PACKET_CITY_SELL = 33; cs, dsend
741 PACKET_CITY_BUY = 34; cs, dsend
745 PACKET_CITY_CHANGE = 35; cs, dsend
747 UINT8 production_kind;
748 UINT8 production_value;
751 PACKET_CITY_WORKLIST = 36; cs, dsend
756 PACKET_CITY_MAKE_SPECIALIST = 37; cs, dsend
758 CITY_COORD worker_x, worker_y;
761 PACKET_CITY_MAKE_WORKER = 38; cs, dsend
763 CITY_COORD worker_x, worker_y;
766 PACKET_CITY_CHANGE_SPECIALIST = 39; cs, dsend
771 PACKET_CITY_RENAME = 40; cs, dsend
773 ESTRING name[MAX_LEN_CITYNAME];
776 PACKET_CITY_OPTIONS_REQ = 41; cs, dsend
778 BV_CITY_OPTIONS options;
781 PACKET_CITY_REFRESH = 42; cs, dsend
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
795 PACKET_CITY_NAME_SUGGESTION_INFO = 44; sc, dsend, lsend
797 ESTRING name[MAX_LEN_CITYNAME];
800 PACKET_CITY_SABOTAGE_LIST = 45; sc, lsend
803 BV_IMPRS improvements;
804 GEN_ACTION action_id;
807 PACKET_WORKER_TASK = 241; cs, sc, lsend, handle-via-packet
815 /************** Player packets **********************/
817 PACKET_PLAYER_REMOVE = 50; sc, dsend, cancel(PACKET_PLAYER_INFO)
821 PACKET_PLAYER_INFO = 51; sc, is-info
823 STRING name[MAX_LEN_NAME];
824 STRING username[MAX_LEN_NAME];
825 BOOL unassigned_user;
830 GOVERNMENT government;
831 GOVERNMENT target_government;
832 BOOL real_embassy[MAX_NUM_PLAYER_SLOTS];
845 PERCENT tax, science,luxury;
851 TURN revolution_finishes;
852 UINT8 ai_skill_level;
853 BARBARIAN_TYPE barbarian_type;
854 BV_PLAYER gives_shared_vision;
856 SINT16 love[MAX_NUM_PLAYER_SLOTS];
859 BOOL color_changeable;
866 CITYSPE wonders[B_LAST]; diff
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
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
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
902 UINT8 has_reason_to_cancel
;
903 UINT16 contact_turns_left
;
906 PACKET_PLAYER_MULTIPLIER
= 242; cs
908 SINT32 multipliers
[MAX_NUM_MULTIPLIERS
:count
];
911 /************** Research packets
**********************/
913 PACKET_RESEARCH_INFO
= 60; sc
, lsend
, is
-game
-info
915 UINT32 techs_researched
;
918 UINT32 researching_cost
;
919 UINT32 bulbs_researched
;
921 SINT32 total_bulbs_prod
;
922 STRING inventions
[A_LAST
+ 1];
925 PACKET_PLAYER_RESEARCH
= 55; cs
, dsend
929 PACKET_PLAYER_TECH_GOAL
= 56; cs
, dsend
933 /************** Unit packets
**********************/
935 PACKET_UNIT_REMOVE
= 62; sc
, dsend
, lsend
, cancel(PACKET_UNIT_INFO
), cancel(PACKET_UNIT_SHORT_INFO
)
939 PACKET_UNIT_INFO
= 63; sc
, lsend
, is
-game
-info
, cancel(PACKET_UNIT_SHORT_INFO
)
947 UINT8 upkeep
[O_LAST
];
950 BOOL ai
, paradropped
;
951 BOOL occupied
, transported
, done_moving
;
954 UNIT transported_by
; /* Only valid if transported is set.
*/
958 /* UINT16 size for activity_count assumed in checks in ruleset.c
*/
959 UINT16 activity_count
, changed_from_count
;
963 ACTIVITY changed_from
;
964 EXTRA changed_from_tgt
;
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
)
989 BOOL occupied
, transported
;
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
;
1006 BOOL make_winner_veteran
;
1009 PACKET_UNIT_SSCS_SET
= 71; cs
, dsend
1011 UNIT_DATA_TYPE type
;
1015 # used for client orders
: currently client
-side goto and patrol
1016 PACKET_UNIT_ORDERS
= 73; cs
1018 TILE src_tile
; # Origin tile
, included for sanity checking
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
];
1030 # Enable autosettlers for a unit. Only works for settler units naturally.
1031 PACKET_UNIT_AUTOSETTLERS
= 74; cs
, dsend
1035 # Load the given cargo into the transporter.
1036 PACKET_UNIT_LOAD
= 75; cs
, dsend
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
1049 UNIT target_id
; # city_id or unit_id
1050 GEN_ACTION action_type
;
1053 PACKET_UNIT_TYPE_UPGRADE
= 83; cs
, dsend
1057 PACKET_UNIT_DO_ACTION
= 84; cs
, dsend
1059 SINT32 target_id
; # city_id
, unit_id or tile_id
1061 ESTRING name
[MAX_LEN_NAME
];
1062 GEN_ACTION action_type
;
1065 PACKET_UNIT_ACTION_ANSWER
= 85; sc
, dsend
1067 UNIT target_id
; # city_id or unit_id
1069 GEN_ACTION action_type
;
1072 PACKET_UNIT_GET_ACTIONS
= 87; cs
, handle
-per
-conn
, dsend
1074 UNIT target_unit_id
;
1075 TILE target_tile_id
;
1077 BOOL disturb_player
;
1080 PACKET_UNIT_ACTIONS
= 90; sc
, dsend
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
1098 /* 88 & 89 are ping
packets (not modifiable
).
*/
1100 /************** Diplomacy packets
**********************/
1102 PACKET_DIPLOMACY_INIT_MEETING_REQ
= 95; cs
, dsend
1106 PACKET_DIPLOMACY_INIT_MEETING
= 96; sc
, dsend
, lsend
1107 PLAYER counterpart
, initiated_from
;
1110 PACKET_DIPLOMACY_CANCEL_MEETING_REQ
= 97; cs
, dsend
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
;
1124 PACKET_DIPLOMACY_CREATE_CLAUSE
= 100; sc
, dsend
, lsend
1125 PLAYER counterpart
, giver
;
1130 PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ
= 101; cs
, dsend
1131 PLAYER counterpart
, giver
;
1136 PACKET_DIPLOMACY_REMOVE_CLAUSE
= 102; sc
, dsend
, lsend
1137 PLAYER counterpart
, giver
;
1142 PACKET_DIPLOMACY_ACCEPT_TREATY_REQ
= 103; cs
, dsend
1146 PACKET_DIPLOMACY_ACCEPT_TREATY
= 104;sc
, dsend
, lsend
1148 BOOL I_accepted
, other_accepted
;
1151 PACKET_DIPLOMACY_CANCEL_PACT
= 105; cs
, dsend
1152 PLAYER other_player_id
;
1156 /************** Report packets
**********************/
1158 PACKET_PAGE_MSG
= 110; sc
, lsend
1159 STRING caption
[MAX_LEN_MSG
];
1160 STRING headline
[MAX_LEN_MSG
];
1166 PACKET_PAGE_MSG_PART
= 250; sc
, lsend
1167 STRING lines
[MAX_LEN_CONTENT
];
1170 PACKET_REPORT_REQ
= 111; cs
, handle
-per
-conn
, dsend
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
1182 #
0 means client should forget its
1183 # info about this connection
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
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
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
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
1230 # send to each client whenever the turn has ended.
1231 PACKET_NEW_YEAR
= 127; sc
, lsend
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
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
1272 PACKET_SPACESHIP_INFO
= 137; sc
, lsend
, is
-game
-info
1273 PLAYER player_num
; key
1286 BV_SPACESHIP_STRUCT structure
;
1287 UFLOAT support_rate
;
1289 UFLOAT success_rate
;
1293 /************** Ruleset packets
**********************/
1295 PACKET_RULESET_UNIT
= 140; sc
, lsend
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
;
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
;
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
];
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
1358 PACKET_RULESET_UNIT_FLAG
= 229; sc
, lsend
1360 STRING name
[MAX_LEN_NAME
];
1361 STRING helptxt
[MAX_LEN_PACKET
];
1364 PACKET_RULESET_UNIT_CLASS_FLAG
= 230; sc
, lsend
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
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
];
1396 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1398 STRVEC helptext
[MAX_LEN_PACKET
];
1401 PACKET_RULESET_GOVERNMENT_RULER_TITLE
= 143; sc
, lsend
1404 STRING male_title
[MAX_LEN_NAME
];
1405 STRING female_title
[MAX_LEN_NAME
];
1408 PACKET_RULESET_TECH
= 144; sc
, lsend
1411 UINT8 research_reqs_count
;
1412 REQUIREMENT research_reqs
[MAX_NUM_REQS
:research_reqs_count
];
1415 BV_TECH_FLAGS flags
;
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
1427 STRING name
[MAX_LEN_NAME
];
1428 STRING rule_name
[MAX_LEN_NAME
];
1432 PACKET_RULESET_TECH_FLAG
= 234; sc
, lsend
1434 STRING name
[MAX_LEN_NAME
];
1435 STRING helptxt
[MAX_LEN_PACKET
];
1438 PACKET_RULESET_GOVERNMENT
= 145; sc
, lsend
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
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
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
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
];
1498 STRING leader_name
[MAX_NUM_LEADERS
:leader_count
][MAX_LEN_NAME
];
1499 BOOL leader_is_male
[MAX_NUM_LEADERS
:leader_count
];
1502 BARBARIAN_TYPE barbarian_type
;
1505 UINT8 sets
[MAX_NUM_NATION_SETS
:nsets
];
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
1520 BOOL is_pickable
[MAX_NUM_NATIONS
:ncount
];
1521 BOOL nationset_change
;
1524 PACKET_RULESET_STYLE
= 239; sc
, lsend
1526 STRING name
[MAX_LEN_NAME
];
1527 STRING rule_name
[MAX_LEN_NAME
];
1530 PACKET_RULESET_CITY
= 149; sc
, lsend
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
];
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
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
];
1550 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1552 REQUIREMENT obs_reqs
[MAX_NUM_REQS
:obs_count
];
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
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
];
1584 TERRAIN irrigation_result
;
1585 UINT8 irrigation_food_incr
;
1586 UINT8 irrigation_time
;
1588 TERRAIN mining_result
;
1589 UINT8 mining_shield_incr
;
1594 TERRAIN transform_result
;
1595 UINT8 transform_time
;
1596 UINT8 clean_pollution_time
;
1597 UINT8 clean_fallout_time
;
1604 STRVEC helptext
[MAX_LEN_PACKET
];
1607 PACKET_RULESET_TERRAIN_FLAG
= 231; sc
, lsend
1609 STRING name
[MAX_LEN_NAME
];
1610 STRING helptxt
[MAX_LEN_PACKET
];
1613 PACKET_RULESET_UNIT_CLASS
= 152; sc
, lsend
1615 STRING name
[MAX_LEN_NAME
];
1616 STRING rule_name
[MAX_LEN_NAME
];
1617 MOVEFRAGS min_speed
;
1620 UINT16 non_native_def_pct
;
1621 BV_UCLASS_FLAGS flags
;
1623 STRVEC helptext
[MAX_LEN_PACKET
];
1626 PACKET_RULESET_EXTRA
= 232; sc
, lsend
1628 STRING name
[MAX_LEN_NAME
];
1629 STRING rule_name
[MAX_LEN_NAME
];
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
];
1641 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_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
;
1653 UINT8 build_time_factor
;
1655 UINT8 removal_time_factor
;
1656 UINT8 defense_bonus
;
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
1667 STRING name
[MAX_LEN_NAME
];
1668 STRING helptxt
[MAX_LEN_PACKET
];
1671 PACKET_RULESET_BASE
= 153; sc
, lsend
1675 SINT8 vision_main_sq
;
1676 SINT8 vision_invis_sq
;
1677 BV_BASE_FLAGS flags
;
1680 PACKET_RULESET_ROAD
= 220; sc
, lsend
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
];
1690 BV_ROADS integrates
;
1691 BV_ROAD_FLAGS flags
;
1694 PACKET_RULESET_GOODS
= 248; sc
, lsend
1696 STRING name
[MAX_LEN_NAME
];
1697 STRING rule_name
[MAX_LEN_NAME
];
1699 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1702 BV_GOODS_FLAGS flags
;
1703 STRVEC helptext
[MAX_LEN_PACKET
];
1706 PACKET_RULESET_DISASTER
= 224; sc
, lsend
1708 STRING name
[MAX_LEN_NAME
];
1709 STRING rule_name
[MAX_LEN_NAME
];
1711 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1713 BV_DISASTER_EFFECTS effects
;
1716 PACKET_RULESET_ACHIEVEMENT
= 233; sc
, lsend
1718 STRING name
[MAX_LEN_NAME
];
1719 STRING rule_name
[MAX_LEN_NAME
];
1720 ACHIEVEMENT_TYPE type
;
1725 PACKET_RULESET_TRADE
= 227; sc
, lsend
1729 TR_BONUS_TYPE bonus_type
;
1732 PACKET_RULESET_ACTION
= 246; sc
, lsend
1735 STRING ui_name
[MAX_LEN_NAME
];
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
1757 ACTION_AUTO_CAUSE cause
;
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
1767 STRING music_peaceful
[MAX_LEN_NAME
];
1768 STRING music_combat
[MAX_LEN_NAME
];
1770 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1773 PACKET_RULESET_MULTIPLIER
= 243; sc
, dsend
, lsend
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
;
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
];
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
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
1861 STRING name
[MAX_LEN_NAME
];
1862 STRING short_help
[MAX_LEN_PACKET
]; /* untranslated
*/
1863 STRING extra_help
[MAX_LEN_PACKET
]; /* untranslated
*/
1867 PACKET_SERVER_SETTING_BOOL
= 166; sc
, handle
-via
-packet
, is
-info
1871 BOOL initial_setting
;
1877 PACKET_SERVER_SETTING_INT
= 167; sc
, handle
-via
-packet
, is
-info
1881 BOOL initial_setting
;
1889 PACKET_SERVER_SETTING_STR
= 168; sc
, handle
-via
-packet
, is
-info
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
1903 BOOL initial_setting
;
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
1916 BOOL initial_setting
;
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
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
;
1938 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1941 PACKET_RULESET_RESOURCE
= 177; sc
, lsend
1944 UINT8 output
[O_LAST
];
1947 /****************** Scenario Related Packets
******************/
1949 PACKET_SCENARIO_INFO
= 180; sc
, handle
-via
-packet
, handle
-per
-conn
1952 STRING authors
[MAX_LEN_PACKET
/ 3];
1954 BOOL startpos_nations
;
1956 BOOL prevent_new_cities
;
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
1978 STRING user
[MAX_LEN_NAME
];
1980 UINT8 percent_required
;
1984 /* Sent to the client to give the new vote totals.
*/
1985 PACKET_VOTE_UPDATE
= 186; sc
, is
-info
1993 PACKET_VOTE_REMOVE
= 187; sc
1997 PACKET_VOTE_RESOLVE
= 188; sc
2002 /* Sent to the server by the client when the client
2004 * - yes (value
= +1)
2006 * - abstain (value
= 0) */
2007 PACKET_VOTE_SUBMIT
= 189; cs
, handle
-per
-conn
, no
-delta
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
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
2031 PACKET_EDIT_TILE_TERRAIN
= 200; cs
, handle
-per
-conn
, dsend
2037 PACKET_EDIT_TILE_EXTRA
= 202; cs
, handle
-per
-conn
, dsend
2039 EXTRA extra_type_id
;
2044 PACKET_EDIT_STARTPOS
= 204; cs
, sc
, dsend
, handle
-per
-conn
, handle
-via
-packet
, no
-delta
2050 PACKET_EDIT_STARTPOS_FULL
= 205; cs
, sc
, handle
-per
-conn
, handle
-via
-packet
, no
-delta
2053 BV_STARTPOS_NATIONS nations
;
2056 PACKET_EDIT_TILE
= 206; cs
, handle
-per
-conn
, handle
-via
-packet
2061 NATION startpos_nation
;
2062 STRING label
[MAX_LEN_NAME
];
2065 PACKET_EDIT_UNIT_CREATE
= 207; cs
, handle
-per
-conn
, dsend
2073 PACKET_EDIT_UNIT_REMOVE
= 208; cs
, handle
-per
-conn
, dsend
2080 PACKET_EDIT_UNIT_REMOVE_BY_ID
= 209; cs
, handle
-per
-conn
, dsend
2084 PACKET_EDIT_UNIT
= 210; cs
, handle
-per
-conn
, handle
-via
-packet
2089 MOVEFRAGS moves_left
;
2094 UINT16 activity_count
;
2100 UNIT transported_by
;
2103 PACKET_EDIT_CITY_CREATE
= 211; cs
, handle
-per
-conn
, dsend
2110 PACKET_EDIT_CITY_REMOVE
= 212; cs
, handle
-per
-conn
, dsend
2114 PACKET_EDIT_CITY
= 213; cs
, handle
-per
-conn
, handle
-via
-packet
2116 ESTRING name
[MAX_LEN_CITYNAME
];
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
;
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
2147 PACKET_EDIT_PLAYER_REMOVE
= 215; cs
, handle
-per
-conn
, dsend
2151 PACKET_EDIT_PLAYER
= 216; cs
, handle
-per
-conn
, lsend
2153 STRING name
[MAX_LEN_NAME
];
2154 STRING username
[MAX_LEN_NAME
];
2155 STRING ranked_username
[MAX_LEN_NAME
];
2159 GOVERNMENT government
;
2160 GOVERNMENT target_government
;
2167 TURN revolution_finishes
;
2172 PERCENT tax
, science
, luxury
;
2176 UINT32 bulbs_researched
;
2177 BOOL inventions
[A_LAST
+1]; diff
2180 BOOL scenario_reserved
;
2183 PACKET_EDIT_PLAYER_VISION
= 217; cs
, handle
-per
-conn
, dsend
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
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
;
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
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
)
2229 UINT16 granary_size
;
2231 UINT16 buy_gold_cost
;