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
35 A packet definition starts with a header line, contains variable
36 field declarations, and ends with a single line containing the word
39 PACKET_<PACKET_NAME>=<packet num>; [<packet flags>]
40 <type1> <field1>; [<field flags>]
41 <type2> <field2>; [<field flags>]
48 The header line contains the packet name. The packet name is used
49 for the naming of the generated code struct and functions:
58 The header line also contains the packet number. The packet number
59 is used as a numeric identification of a packet between the client
60 and server. The packet number shall never change for an existing
61 packet without the adding of a mandatory capability. Packets which
62 are used for the capability checking PACKET_PROCESSING_STARTED,
63 PACKET_PROCESSING_FINISHED, PACKET_SERVER_JOIN_REQ and
64 PACKET_SERVER_JOIN_REPLY are excluded here. These packets should
65 never change their number. The packet number can be freely chosen
66 as long as it is below 65536 and unique. For backward compatibility
67 reasons, packets used for the initial protocol (notably before
68 checking the capabilities) must be in range 0-255.
73 Packet flags is a comma separated list of:
75 is-info: a second packet with the same content can be discarded
76 WARNING: this flag is dangerous and should not be used for
77 a packet that contains information that may be changed in
78 the client outside of the reception of that packet, or for
79 any packet with side effects at the client.
81 is-game-info: same as is-info, but the state is reset every time a
82 connection changes of player target.
84 force: sending functions will take an extra argument 'force_to_send
'
85 to force to send the packet (at least an empty one). In this
86 case, the is-info or is-game-info flags are ignored. It has no
87 effect if the packets doesn't have the is
-info or is
-game
-info
90 cancel(PACKET_number
): Cancel a packet with the same
key (must be the
91 same key type at the start of the packet
), useful for is
-info packets.
95 post
-send
: generate calls to pre
-send
, post
-receive and post
-send
96 hooks. These hooks are named
: pre_send_packet_
*,
97 post_receive_packet_
* and post_send_packet_
*. The user has to
98 provide these. These functions may be used to do extra
99 preparations
, conversions or checks.
101 no
-delta
: don
't use the delta protocol. This is useful for
102 packets which contain always different data
103 (packet_generic_integer) or are only sent once
104 (packet_req_join_game). Sadly this also disables the use of 0 as
107 no-packet: don't generate a packet argument for the send
108 function. Currently only used by packet_generic_empty.
110 no
-handle
: don
't generate handle_* prototypes. The generated
111 switch statements (server/srv_main_gen.c, client/civclient_gen.c)
112 doesn't include code for this packet. You have to handle this by
113 yourself. This may be required for special packets which are
114 handled early in the sequence.
116 handle
-via
-packet
: force the packet type of the handle
117 function. Otherwise the fields are passed to the handle function.
118 This is invoked automatically for packets with more than
5 fields
119 or packets whose names are of the form foo_ruleset.
121 handle
-per
-conn
: normally the first parameter of the handle
122 function is the player. handle
-per
-conn changes this to the
123 connection the packet came from.
125 dsend
: request the creation of a dsend_packet_
* function. This is
126 similar to a send function but instead of taking a packet struct
127 as a parameter
, it takes the fields of the packet as parameters.
129 lsend
: request the creation of a lsend_packet_
* function. This
130 function sends to list of connections instead of just one
131 connection
, which is the case for the other send functions.
133 cs
: a packet which is sent from the client to the server
135 sc
: a packet which is sent from the server to the client
137 Each other packet line has the format
"<type> <fields>;<flags>".
142 <type
> is an alias or a basic type. A basic type has the format
143 "<dataio-type>(<public-type>)". Exception here is the float
144 type. You can specify with the dataio
-type
"float<number>" the
145 transmission of a float in a uint32 multiplied by this factor.
150 Comma seperated list of names. Each name can have zero
, one or
151 two array declarations. So
"x", "x[10]" and
"x[20][10]" is
152 possible. The array size in the
"[]" can be specified plain as a
153 term. In this case all elements will be transmitted. If this is
154 not
-desired you can specify the amount of elements to be
155 transfered by given the number. So the extended format is
156 "[<full-array-size>:<elements-to-transfer>]". elements
-to
-transfer
157 is relative to the packet.
162 key
: create multiple entries in the cache indexed by the key set
163 (set of all fields which have the key attribute
). This allow a
164 better delta compression.
166 diff
: use the array
-diff feature. This will reduce the amount of
167 traffic for large arrays in which only a few elements change.
169 add
-cap
: only transfer this field if the given capability is
170 available at runtime. If you have a capability named
171 "new_version" a field line may look like this
:
172 TILE tile
; add
-cap(new_version
)
173 when making an optional capability mandatory
, go through and remove
174 the add
-cap flag for it while leaving the field intact.
176 remove
-cap
: don
't transfer this field if the given capability is
177 available at runtime. When making an optional capability manditory,
178 go through and remove entirely any fields marked as remove-cap with
182 # typedefs for numbers
183 type BOOL = bool8(bool)
184 type SFLOAT10x3 = sfloat100(float)
185 type SFLOAT10x7 = sfloat1000000(float)
186 type SINT8 = sint8(int)
187 type SINT16 = sint16(int)
188 type SINT32 = sint32(int)
189 type UFLOAT10x3 = ufloat100(float)
190 type UFLOAT = ufloat10000(float)
191 type UINT8 = uint8(int)
192 type UINT16 = uint16(int)
193 type UINT32 = uint32(int)
195 # typedefs for arrays/structs
196 type MEMORY = memory(unsigned char)
197 type REQUIREMENT = requirement(struct requirement)
198 type ACT_PROB = action_probability(struct act_prob)
199 type STRING = string(char)
200 # A string vector encoded to a string outside the packet and field system.
201 # Marking it this way is useful as documentation. The marking can also be
202 # used in non vanilla generate_packets.py packet generators.
204 type TECH_LIST = tech_list(int)
205 type UNIT_LIST = unit_list(int)
206 type BUILDING_LIST = building_list(int)
207 type WORKLIST = worklist(struct worklist)
210 type ACHIEVEMENT_TYPE = uint8(enum achievement_type)
211 type ACTIVITY = uint8(enum unit_activity)
212 type AIRLIFTING_STYLE = uint8(enum airlifting_style)
213 type PERSISTENT_READY = uint8(enum persistent_ready)
214 type VICTORY_CONDITIONS = uint8(enum victory_condition_type)
215 type TECH_UPKEEP_STYLE = uint8(enum tech_upkeep_style)
216 type AUTH_TYPE = uint8(enum authentication_type)
217 type BARBARIAN_TYPE = uint8(enum barbarian_type)
218 type BASE_GUI = uint8(enum base_gui_type)
219 type BORDERS_MODE = uint8(enum borders_mode)
220 type CLAUSE = uint8(enum clause_type)
221 type CMDLEVEL = uint8(enum cmdlevel)
222 type DIPLOMACY_MODE = uint8(enum diplomacy_mode)
223 type DIPLSTATE_TYPE = uint8(enum diplstate_type)
224 type DIRECTION = sint8(enum direction8)
225 type EFFECT_TYPE = uint8(enum effect_type)
226 type EVENT = sint16(enum event_type)
227 type GUI_TYPE = uint8(enum gui_type)
228 type IMPR_GENUS = uint8(enum impr_genus_id)
229 type KNOWN = uint8(enum known_type)
230 type MOOD = uint8(enum mood_type)
231 type ORDERS = uint8(enum unit_orders)
232 type PHASE_MODE = uint8(enum phase_mode_types)
233 type PLACE_TYPE = uint8(enum spaceship_place_type)
234 type REPORT_TYPE = uint8(enum report_type)
235 type SSET_CLASS = uint8(enum sset_class)
236 type SSET_TYPE = uint8(enum sset_type)
237 type ROAD_COMPAT = uint8(enum road_compat)
238 type FTM = uint8(enum free_tech_method)
239 type GLS = uint8(enum gameloss_style)
240 type UTYF = uint8(enum unit_type_flag_id)
241 type CBONUS_TYPE = uint8(enum combat_bonus_type)
242 type TRI = uint8(enum traderoute_illegal_cancelling)
243 type MOVE_MODE = uint8(enum road_move_mode)
244 type GEN_ACTION = uint8(enum gen_action)
245 type ACTION_DECISION = uint8(enum action_decision)
246 type REVOLENTYPE = uint8(enum revolen_type)
247 type HAPPYBORDERSTYPE = uint8(enum happyborders_type)
248 type TECH_COST_STYLE = uint8(enum tech_cost_style)
249 type TECH_LEAKAGE_STYLE = uint8(enum tech_leakage_style)
250 type GOLD_UPKEEP_STYLE = uint8(enum gold_upkeep_style)
251 type TR_BONUS_TYPE = uint8(enum traderoute_bonus_type)
253 # typedefs for bit vectors
254 type BV_EXTRA_FLAGS = bitvector(bv_extra_flags)
255 type BV_BASE_FLAGS = bitvector(bv_base_flags)
256 type BV_EXTRAS = bitvector(bv_extras)
257 type BV_BASES = bitvector(bv_bases)
258 type BV_ROADS = bitvector(bv_roads)
259 type BV_ROAD_FLAGS = bitvector(bv_road_flags)
260 type BV_CITY_OPTIONS = bitvector(bv_city_options)
261 type BV_IMPR_FLAGS = bitvector(bv_impr_flags)
262 type BV_IMPRS = bitvector(bv_imprs)
263 type BV_PLAYER = bitvector(bv_player)
264 type BV_SPECIAL = bitvector(bv_special)
265 type BV_STARTPOS_NATIONS= bitvector(bv_startpos_nations)
266 type BV_TECH_FLAGS = bitvector(bv_tech_flags)
267 type BV_TERRAIN_FLAGS = bitvector(bv_terrain_flags)
268 type BV_UCLASS_FLAGS = bitvector(bv_unit_class_flags)
269 type BV_UNIT_CLASSES = bitvector(bv_unit_classes)
270 type BV_UTYPE_FLAGS = bitvector(bv_unit_type_flags)
271 type BV_UTYPE_ROLES = bitvector(bv_unit_type_roles)
272 type BV_DISASTER_EFFECTS = bitvector(bv_disaster_effects)
273 type BV_SPACESHIP_STRUCT = bitvector(bv_spaceship_structure)
277 type BASE = sint8(Base_type_id)
278 type ROAD = sint8(Road_type_id)
280 # city id, with space for special values
281 type CITYSPE = SINT32
282 type CONNECTION = SINT16
283 type CONTINENT = sint16(Continent_id)
284 type GOVERNMENT = sint8(Government_type_id)
285 type IMPROVEMENT = uint8(Impr_type_id)
286 type MULTIPLIER = uint8(Multiplier_type_id)
287 type NATION = sint16(Nation_type_id)
289 type RESEARCH = UINT8
290 type RESOURCE = uint8(Resource_type_id)
291 type SPECIALIST = uint8(Specialist_type_id)
294 type TERRAIN = uint8(Terrain_type_id)
297 type UNIT_TYPE = uint8(Unit_type_id)
300 type CITY_COORD = UINT8
304 type MOVEFRAGS = UINT16 # units of TERRAIN_CONTROL.move_fragments
309 type CITIZENS = UINT8
311 /****************************************************
312 The remaining lines are the definition of the packets. These are
313 grouped together. There are the following groups:
315 Login/pregame/endgame
330 ****************************************************/
333 /************** General packets **********************/
335 # For compatibility with older versions, this number cannot be changed.
336 # Used in initial protocol.
337 PACKET_PROCESSING_STARTED = 0; sc
340 # For compatibility with older versions, this number cannot be changed.
341 # Used in initial protocol.
342 PACKET_PROCESSING_FINISHED = 1; sc
345 /************** Login/pregame/endgame packets **********************/
347 # This packet is the first real (freeciv specific) packet send by the
348 # client. The player hasn't been accepted yet.
349 # For compatibility with older versions
, this number cannot be changed.
350 # Used in initial protocol.
351 #
48 used instead of MAX_LEN_NAME to keep compatibility with old versions
352 # even if MAX_LEN_NAME changes. Similarly
512 instead of MAX_LEN_CAPSTR.
353 PACKET_SERVER_JOIN_REQ
= 4; cs
, dsend
, no
-delta
, no
-handle
355 STRING capability
[512];
356 STRING version_label
[48];
357 UINT32 major_version
, minor_version
, patch_version
;
360 # ... and the server replies.
361 # For compatibility with older versions
, this number cannot be changed.
362 # Used in initial protocol.
363 PACKET_SERVER_JOIN_REPLY
= 5; sc
, no
-delta
, post
-send
, post
-recv
365 STRING message
[1536]; /* MAX_LEN_MSG
*/
366 STRING capability
[512]; /* MAX_LEN_CAPSTR
*/
367 STRING challenge_file
[4095]; /* MAX_LEN_PATH
*/
368 # clients conn id as known in server
372 # Used in initial protocol.
373 PACKET_AUTHENTICATION_REQ
= 6; sc
, handle
-per
-conn
, dsend
375 STRING message
[MAX_LEN_MSG
]; /* explain to the client if there
's a problem */
378 # Used in initial protocol.
379 PACKET_AUTHENTICATION_REPLY = 7; cs, no-handle
380 STRING password[MAX_LEN_PASSWORD];
384 PACKET_SERVER_SHUTDOWN = 8; sc, lsend
387 PACKET_NATION_SELECT_REQ = 10; cs, handle-per-conn, dsend
391 STRING name[MAX_LEN_NAME];
395 PACKET_PLAYER_READY = 11; cs, dsend
400 PACKET_ENDGAME_REPORT = 12; sc, lsend, no-delta, handle-via-packet
402 STRING category_name[32:category_num][MAX_LEN_NAME];
407 PACKET_ENDGAME_PLAYER = 223; sc, lsend, no-delta, handle-via-packet
411 UINT32 category_score[32:category_num];
415 /************** Info packets **********************/
417 # Use of is-game-info on this packet is dangerous but speeds things up
418 # greatly. Packet spam from excess sending of tiles has slowed the client
419 # greatly in the past. However see the comment on is-game-info at the top
421 PACKET_TILE_INFO = 15; sc, lsend, is-game-info
433 STRING spec_sprite[MAX_LEN_NAME];
434 STRING label[MAX_LEN_NAME];
437 # The variables in the packet are listed in alphabetical order.
438 PACKET_GAME_INFO = 16; sc, is-info
439 UINT8 add_to_size_limit;
441 PERSISTENT_READY persistent_ready;
442 AIRLIFTING_STYLE airlifting_style;
444 SINT16 base_pollution;
445 UINT8 base_tech_cost;
446 UINT16 border_city_radius_sq;
447 UINT8 border_size_effect;
448 SINT16 border_city_permanent_radius_sq;
449 BORDERS_MODE borders;
450 UINT32 base_bribe_cost;
451 UINT32 culture_vic_points;
452 UINT16 culture_vic_lead;
453 UINT16 culture_migration_pml;
454 BOOL calendar_skip_0;
455 /* size limit for cities before they can celebrate */
458 UINT8 pop_report_zeroes;
459 BOOL citizen_nationality;
460 UINT16 citizen_convert_speed;
461 UINT8 citizen_partisans_pct;
465 DIPLOMACY_MODE diplomacy;
471 UINT8 forced_science;
473 /* True if at least one civilization has researched a tech */
474 BOOL global_advances[A_LAST]; diff
476 UINT32 globalwarming;
478 GOLD_UPKEEP_STYLE gold_upkeep_style;
479 REVOLENTYPE revolentype;
480 GOVERNMENT default_government_id;
481 GOVERNMENT government_during_revolution_id;
482 UINT8 granary_food_inc;
483 UINT8 granary_food_ini[MAX_GRANARY_INIS];
484 UINT8 granary_num_inis;
485 PLAYER great_wonder_owners[B_LAST]; diff
487 HAPPYBORDERSTYPE happyborders;
489 UINT16 illness_base_factor;
490 UINT8 illness_min_size;
492 UINT16 illness_pollution_factor;
493 UINT16 illness_trade_infection;
494 UINT8 init_city_radius_sq;
495 /* If set, editing is allowed */
497 /* TRUE only in pregame for "new" (not loaded) games */
501 UINT8 min_city_center_output[O_LAST];
502 STRING negative_year_label[MAX_LEN_NAME];
505 UINT32 nuclearwinter;
507 PHASE_MODE phase_mode;
509 BOOL tech_steal_allow_holes;
510 BOOL tech_trade_allow_holes;
511 BOOL tech_trade_loss_allow_holes;
512 BOOL tech_parasite_allow_holes;
513 BOOL tech_loss_allow_holes;
514 STRING positive_year_label[MAX_LEN_NAME];
518 BOOL unreachable_protects;
523 VICTORY_CONDITIONS victory_conditions;
524 BOOL team_pooled_research;
526 TECH_COST_STYLE tech_cost_style;
527 TECH_LEAKAGE_STYLE tech_leakage;
528 UINT16 tech_upkeep_divider;
529 TECH_UPKEEP_STYLE tech_upkeep_style;
530 FTM free_tech_method;
533 UINT32 first_timeout;
536 BOOL force_trade_route;
544 UINT16 calendar_fragments;
545 UINT16 fragment_count;
546 STRING calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME];
547 BOOL civil_war_enabled;
548 BOOL paradrop_to_transport;
551 # This cannot have is-info set. Sending the same value a second time after a
552 # while has passed means a completely reset timeout.
553 PACKET_TIMEOUT_INFO = 244; sc
554 SFLOAT10x3 seconds_to_phasedone;
555 SFLOAT10x3 last_turn_change_time;
558 PACKET_MAP_INFO = 17; sc, lsend
564 PACKET_NUKE_TILE_INFO = 18; sc, dsend,lsend
568 PACKET_TEAM_NAME_INFO = 19; sc, lsend
570 STRING team_name[MAX_LEN_NAME];
573 PACKET_ACHIEVEMENT_INFO = 238; sc, lsend
579 /************** Chat/event packets **********************/
581 /* This MUST have identical structure to PACKET_EARLY_CHAT_MSG as there's casting
583 PACKET_CHAT_MSG
= 25; sc
, lsend
584 STRING message
[MAX_LEN_MSG
];
592 /* This MUST have identical structure to PACKET_CHAT_MSG as there
's casting
594 PACKET_EARLY_CHAT_MSG = 28; sc, lsend
595 STRING message[MAX_LEN_MSG];
603 PACKET_CHAT_MSG_REQ = 26; cs, handle-per-conn, dsend
604 STRING message[MAX_LEN_MSG];
607 # Used in initial protocol.
608 PACKET_CONNECT_MSG = 27; sc, dsend
609 STRING message[MAX_LEN_MSG];
612 /************** City packets **********************/
614 PACKET_CITY_REMOVE = 30; sc, dsend, lsend, cancel(PACKET_CITY_INFO), cancel(PACKET_CITY_SHORT_INFO)
618 PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO)
624 UINT8 city_radius_sq;
627 CITIZENS ppl_happy[FEELING_LAST];
628 CITIZENS ppl_content[FEELING_LAST];
629 CITIZENS ppl_unhappy[FEELING_LAST];
630 CITIZENS ppl_angry[FEELING_LAST];
632 UINT8 specialists_size;
633 CITIZENS specialists[SP_MAX:specialists_size];
635 UINT8 nationalities_count;
636 PLAYER nation_id[MAX_NUM_PLAYER_SLOTS:nationalities_count];
637 CITIZENS nation_citizens[MAX_NUM_PLAYER_SLOTS:nationalities_count];
642 SINT16 surplus[O_LAST];
643 UINT16 waste[O_LAST];
644 SINT16 unhappy_penalty[O_LAST];
646 SINT16 citizen_base[O_LAST];
647 SINT16 usage[O_LAST];
648 UINT16 food_stock, shield_stock;
650 UINT16 trade[MAX_TRADE_ROUTES];
651 UINT8 trade_value[MAX_TRADE_ROUTES];
654 UINT16 illness_trade;
656 UINT8 production_kind;
657 UINT8 production_value;
660 TURN turn_last_built;
661 UINT8 changed_from_kind;
662 UINT8 changed_from_value;
663 UINT16 before_change_shields;
664 UINT16 disbanded_shields;
665 UINT16 caravan_shields;
666 UINT16 last_turns_shield_surplus;
669 BOOL did_buy, did_sell, was_happy;
671 BOOL diplomat_investigate;
677 BV_IMPRS improvements;
678 BV_CITY_OPTIONS city_options;
679 STRING name[MAX_LEN_NAME];
682 PACKET_CITY_SHORT_INFO = 32; sc, lsend, is-game-info, cancel(PACKET_CITY_INFO)
698 BV_IMPRS improvements;
699 STRING name[MAX_LEN_NAME];
702 PACKET_CITY_SELL = 33; cs, dsend
707 PACKET_CITY_BUY = 34; cs, dsend
711 PACKET_CITY_CHANGE = 35; cs, dsend
713 UINT8 production_kind;
714 UINT8 production_value;
717 PACKET_CITY_WORKLIST = 36; cs, dsend
722 PACKET_CITY_MAKE_SPECIALIST = 37; cs, dsend
724 CITY_COORD worker_x, worker_y;
727 PACKET_CITY_MAKE_WORKER = 38; cs, dsend
729 CITY_COORD worker_x, worker_y;
732 PACKET_CITY_CHANGE_SPECIALIST = 39; cs, dsend
737 PACKET_CITY_RENAME = 40; cs, dsend
739 STRING name[MAX_LEN_NAME];
742 PACKET_CITY_OPTIONS_REQ = 41; cs, dsend
744 BV_CITY_OPTIONS options;
747 PACKET_CITY_REFRESH = 42; cs, dsend
751 # For city name suggestions, client sends unit id of unit building the
752 # city. The server does not use the id, but sends it back to the
753 # client so that the client knows what to do with the suggestion when
754 # it arrives back. (Currently, for city renaming, default is existing
755 # name; if wanted to suggest a new name, could do the same thing
756 # sending the city id as id, and only client needs to change.)
757 PACKET_CITY_NAME_SUGGESTION_REQ = 43; cs, dsend
761 PACKET_CITY_NAME_SUGGESTION_INFO = 44; sc, dsend, lsend
763 STRING name[MAX_LEN_NAME];
766 PACKET_CITY_SABOTAGE_LIST = 45; sc, lsend
769 BV_IMPRS improvements;
772 PACKET_WORKER_TASK = 241; cs, sc, lsend, handle-via-packet
780 /************** Player packets **********************/
782 PACKET_PLAYER_REMOVE = 50; sc, dsend, cancel(PACKET_PLAYER_INFO)
786 PACKET_PLAYER_INFO = 51; sc, is-info
788 STRING name[MAX_LEN_NAME];
789 STRING username[MAX_LEN_NAME];
790 BOOL unassigned_user;
795 GOVERNMENT government;
796 GOVERNMENT target_government;
797 BOOL real_embassy[MAX_NUM_PLAYER_SLOTS];
810 PERCENT tax, science,luxury;
816 TURN revolution_finishes;
818 UINT8 ai_skill_level;
819 BARBARIAN_TYPE barbarian_type;
820 BV_PLAYER gives_shared_vision;
822 SINT16 love[MAX_NUM_PLAYER_SLOTS];
825 BOOL color_changeable;
830 CITYSPE wonders[B_LAST]; diff
833 SINT32 multiplier[MAX_NUM_MULTIPLIERS:multip_count];
834 SINT32 multiplier_target[MAX_NUM_MULTIPLIERS:multip_count];
837 PACKET_PLAYER_PHASE_DONE = 52; cs, dsend
841 PACKET_PLAYER_RATES = 53; cs, dsend
842 PERCENT tax, luxury, science;
845 PACKET_PLAYER_CHANGE_GOVERNMENT = 54; cs, dsend
846 GOVERNMENT government;
849 PACKET_PLAYER_ATTRIBUTE_BLOCK = 57; cs
852 PACKET_PLAYER_ATTRIBUTE_CHUNK = 58; pre-send, sc, cs, handle-via-packet
856 /* to keep memory management simple don't allocate dynamic memory
*/
857 MEMORY data
[ATTRIBUTE_CHUNK_SIZE
:chunk_length
];
860 PACKET_PLAYER_DIPLSTATE
= 59; sc
861 UINT32 diplstate_id
; key
866 UINT8 has_reason_to_cancel
;
867 UINT16 contact_turns_left
;
870 PACKET_PLAYER_MULTIPLIER
= 242; cs
872 SINT32 multipliers
[MAX_NUM_MULTIPLIERS
:count
];
875 /************** Research packets
**********************/
877 PACKET_RESEARCH_INFO
= 60; sc
, lsend
, is
-game
-info
879 UINT32 techs_researched
;
882 UINT32 researching_cost
;
883 UINT32 bulbs_researched
;
885 SINT32 total_bulbs_prod
;
886 STRING inventions
[A_LAST
+ 1];
889 PACKET_PLAYER_RESEARCH
= 55; cs
, dsend
893 PACKET_PLAYER_TECH_GOAL
= 56; cs
, dsend
897 /************** Unit packets
**********************/
899 PACKET_UNIT_REMOVE
= 62; sc
, dsend
, lsend
, cancel(PACKET_UNIT_INFO
), cancel(PACKET_UNIT_SHORT_INFO
)
903 PACKET_UNIT_INFO
= 63; sc
, lsend
, is
-game
-info
, cancel(PACKET_UNIT_SHORT_INFO
)
911 UINT8 upkeep
[O_LAST
];
914 BOOL ai
, paradropped
;
915 BOOL occupied
, transported
, done_moving
;
918 UNIT transported_by
; /* Only valid if transported is set.
*/
921 /* UINT16 size for activity_count assumed in checks in ruleset.c
*/
922 UINT16 activity_count
, changed_from_count
;
926 ACTIVITY changed_from
;
927 EXTRA changed_from_tgt
;
932 UINT16 orders_length
, orders_index
;
933 BOOL orders_repeat
, orders_vigilant
;
934 ORDERS orders
[MAX_LEN_ROUTE
:orders_length
];
935 DIRECTION orders_dirs
[MAX_LEN_ROUTE
:orders_length
];
936 ACTIVITY orders_activities
[MAX_LEN_ROUTE
:orders_length
];
937 EXTRA orders_targets
[MAX_LEN_ROUTE
:orders_length
];
939 ACTION_DECISION action_decision_want
;
940 TILE action_decision_tile
;
943 PACKET_UNIT_SHORT_INFO
= 64; sc
, lsend
, is
-game
-info
, force
, cancel(PACKET_UNIT_INFO
)
951 BOOL occupied
, transported
;
955 UNIT transported_by
; /* Only valid if transported is set.
*/
957 /* in packet only
, not in unit struct
*/
958 UINT8 packet_use
; /* see enum unit_info_use
*/
959 CITY info_city_id
; /* for UNIT_INFO_CITY_SUPPORTED
960 and UNIT_INFO_CITY_PRESENT uses
*/
963 PACKET_UNIT_COMBAT_INFO
= 65; sc
, lsend
964 UNIT attacker_unit_id
;
965 UNIT defender_unit_id
;
968 BOOL make_winner_veteran
;
971 PACKET_UNIT_BUILD_CITY
= 67; cs
, dsend
973 STRING name
[MAX_LEN_NAME
];
976 PACKET_UNIT_DISBAND
= 68; cs
, dsend
980 PACKET_UNIT_CHANGE_HOMECITY
= 69; cs
, dsend
985 PACKET_UNIT_BATTLEGROUP
= 71; cs
, dsend
990 # used for client orders
: currently client
-side goto and patrol
991 PACKET_UNIT_ORDERS
= 73; cs
993 TILE src_tile
; # Origin tile
, included for sanity checking
996 BOOL repeat
, vigilant
;
997 ORDERS orders
[MAX_LEN_ROUTE
:length
];
998 DIRECTION dir
[MAX_LEN_ROUTE
:length
];
999 ACTIVITY activity
[MAX_LEN_ROUTE
:length
];
1000 EXTRA target
[MAX_LEN_ROUTE
:length
];
1004 # Enable autosettlers for a unit. Only works for settler units naturally.
1005 PACKET_UNIT_AUTOSETTLERS
= 74; cs
, dsend
1009 # Load the given cargo into the transporter.
1010 PACKET_UNIT_LOAD
= 75; cs
, dsend
1012 UNIT transporter_id
;
1013 TILE transporter_tile
;
1016 # Unload the given cargo from the transporter.
1017 PACKET_UNIT_UNLOAD
= 76; cs
, dsend
1018 UNIT cargo_id
, transporter_id
;
1021 PACKET_UNIT_UPGRADE
= 77; cs
, dsend
1025 PACKET_UNIT_NUKE
= 79; cs
, dsend
1029 PACKET_UNIT_PARADROP_TO
= 80; cs
, dsend
1034 PACKET_UNIT_AIRLIFT
= 81; cs
, dsend
1039 PACKET_UNIT_ACTION_QUERY
= 82; cs
, handle
-per
-conn
, dsend
1041 UNIT target_id
; # city_id or unit_id
1042 GEN_ACTION action_type
;
1045 PACKET_UNIT_TYPE_UPGRADE
= 83; cs
, dsend
1049 PACKET_UNIT_DO_ACTION
= 84; cs
, dsend
1051 SINT32 target_id
; # city_id
, unit_id or tile_id
1053 GEN_ACTION action_type
;
1056 PACKET_UNIT_ACTION_ANSWER
= 85; sc
, dsend
1058 UNIT target_id
; # city_id or unit_id
1060 GEN_ACTION action_type
;
1063 PACKET_UNIT_GET_ACTIONS
= 87; cs
, handle
-per
-conn
, dsend
1065 UNIT target_unit_id
;
1066 CITY target_city_id
;
1067 TILE target_tile_id
;
1069 BOOL disturb_player
;
1072 PACKET_UNIT_ACTIONS
= 90; sc
, dsend
1074 UNIT target_unit_id
;
1075 CITY target_city_id
;
1076 TILE target_tile_id
;
1078 BOOL disturb_player
;
1080 /* How to interpret action probabilities is documented in fc_types.h
*/
1081 ACT_PROB action_probabilities
[ACTION_COUNT
];
1084 PACKET_UNIT_CHANGE_ACTIVITY
= 222; cs
, dsend
1090 /* 88 & 89 are ping
packets (not modifiable
).
*/
1092 /************** Diplomacy packets
**********************/
1094 PACKET_DIPLOMACY_INIT_MEETING_REQ
= 95; cs
, dsend
1098 PACKET_DIPLOMACY_INIT_MEETING
= 96; sc
, dsend
, lsend
1099 PLAYER counterpart
, initiated_from
;
1102 PACKET_DIPLOMACY_CANCEL_MEETING_REQ
= 97; cs
, dsend
1106 PACKET_DIPLOMACY_CANCEL_MEETING
= 98; sc
, dsend
, lsend
1107 PLAYER counterpart
, initiated_from
;
1110 PACKET_DIPLOMACY_CREATE_CLAUSE_REQ
= 99; cs
, dsend
1111 PLAYER counterpart
, giver
;
1116 PACKET_DIPLOMACY_CREATE_CLAUSE
= 100; sc
, dsend
, lsend
1117 PLAYER counterpart
, giver
;
1122 PACKET_DIPLOMACY_REMOVE_CLAUSE_REQ
= 101; cs
, dsend
1123 PLAYER counterpart
, giver
;
1128 PACKET_DIPLOMACY_REMOVE_CLAUSE
= 102; sc
, dsend
, lsend
1129 PLAYER counterpart
, giver
;
1134 PACKET_DIPLOMACY_ACCEPT_TREATY_REQ
= 103; cs
, dsend
1138 PACKET_DIPLOMACY_ACCEPT_TREATY
= 104;sc
, dsend
, lsend
1140 BOOL I_accepted
, other_accepted
;
1143 PACKET_DIPLOMACY_CANCEL_PACT
= 105; cs
, dsend
1144 PLAYER other_player_id
;
1148 /************** Report packets
**********************/
1150 PACKET_PAGE_MSG
= 110; sc
, lsend
1151 STRING caption
[MAX_LEN_MSG
];
1152 STRING headline
[MAX_LEN_MSG
];
1158 PACKET_PAGE_MSG_PART
= 248; sc
, lsend
1159 STRING lines
[MAX_LEN_CONTENT
];
1162 PACKET_REPORT_REQ
= 111; cs
, handle
-per
-conn
, dsend
1166 /************** Connection packets
**********************/
1168 # For telling clients information about other connections to server.
1169 # Clients may not use all info
, but supply now to avoid unnecessary
1170 # protocol changes later.
1171 PACKET_CONN_INFO
= 115; sc
, lsend
, is
-info
1174 #
0 means client should forget its
1175 # info about this connection
1180 CMDLEVEL access_level
;
1181 STRING username
[MAX_LEN_NAME
];
1182 STRING addr
[MAX_LEN_ADDR
];
1183 STRING capability
[MAX_LEN_CAPSTR
];
1186 # Information about the ping times of the connections.
1187 PACKET_CONN_PING_INFO
= 116; sc
, lsend
1189 CONNECTION conn_id
[MAX_NUM_CONNECTIONS
:connections
];
1190 SFLOAT10x7 ping_time
[MAX_NUM_CONNECTIONS
:connections
];
1193 # For compatibility with older versions
, this number cannot be changed.
1194 # Freeciv servers version
< 2.5.0 still can send this packet in
1196 PACKET_CONN_PING
= 88; sc
1199 # For compatibility with older versions
, this number cannot be changed.
1200 # Can be used in initial protocol
, if the client received a PACKET_CONN_PING.
1201 PACKET_CONN_PONG
= 89; cs
, handle
-per
-conn
1204 PACKET_CLIENT_HEARTBEAT
= 251; cs
, handle
-per
-conn
1207 PACKET_CLIENT_INFO
= 119; cs
, handle
-per
-conn
1209 STRING distribution
[MAX_LEN_NAME
];
1212 /************** New turn packets
**********************/
1214 PACKET_END_PHASE
= 125; sc
, lsend
1217 # sent to everyone
, not just the player whose phase it is
1218 PACKET_START_PHASE
= 126; sc
, lsend
, dsend
1222 # send to each client whenever the turn has ended.
1223 PACKET_NEW_YEAR
= 127; sc
, lsend
1229 # Server has finished processing turn change
1230 PACKET_BEGIN_TURN
= 128; sc
, lsend
1233 # Server starts processing turn change
1234 PACKET_END_TURN
= 129; sc
, lsend
1237 # Freeze reports and agents
1238 PACKET_FREEZE_CLIENT
= 130; sc
, lsend
1241 # Thaw reports and agents
1242 PACKET_THAW_CLIENT
= 131; sc
, lsend
1245 /************** Spaceship packets
**********************/
1247 PACKET_SPACESHIP_LAUNCH
= 135; cs
1250 PACKET_SPACESHIP_PLACE
= 136; cs
, dsend
1254 #
- if type
==SSHIP_ACT_PLACE_STRUCTURAL
:
1255 # index to sship
->structure
[]
1256 #
- if type
!=SSHIP_ACT_PLACE_STRUCTURAL
:
1257 # new value for sship
->fuel etc
; should be just one more than
1258 # current value of ship
->fuel etc Used to avoid possible
1259 # problems if we send duplicate packets when client
1264 PACKET_SPACESHIP_INFO
= 137; sc
, lsend
, is
-game
-info
1265 PLAYER player_num
; key
1278 BV_SPACESHIP_STRUCT structure
;
1279 UFLOAT support_rate
;
1281 UFLOAT success_rate
;
1285 /************** Ruleset packets
**********************/
1287 PACKET_RULESET_UNIT
= 140; sc
, lsend
1289 STRING name
[MAX_LEN_NAME
];
1290 STRING rule_name
[MAX_LEN_NAME
];
1291 STRING graphic_str
[MAX_LEN_NAME
];
1292 STRING graphic_alt
[MAX_LEN_NAME
];
1293 STRING sound_move
[MAX_LEN_NAME
];
1294 STRING sound_move_alt
[MAX_LEN_NAME
];
1295 STRING sound_fight
[MAX_LEN_NAME
];
1296 STRING sound_fight_alt
[MAX_LEN_NAME
];
1297 UINT8 unit_class_id
;
1300 UINT8 attack_strength
;
1301 UINT8 defense_strength
;
1302 MOVEFRAGS move_rate
;
1303 TECH tech_requirement
;
1304 UINT8 impr_requirement
;
1305 GOVERNMENT gov_requirement
;
1306 UINT16 vision_radius_sq
;
1307 UINT8 transport_capacity
;
1315 UINT8 happy_cost
; # unhappy people in home city
1316 UINT8 upkeep
[O_LAST
]; # normal upkeep
cost (food
, gold
, shields
)
1318 UINT16 paratroopers_range
; # max range of paratroopers
, UTYF_PARATROOPERS
1319 UINT8 paratroopers_mr_req
; # whole move points
, not MOVEFRAGS
1320 UINT8 paratroopers_mr_sub
; # whole move points
, not MOVEFRAGS
1322 UINT8 veteran_levels
;
1323 STRING veteran_name
[MAX_VET_LEVELS
:veteran_levels
][MAX_LEN_NAME
];
1324 UINT16 power_fact
[MAX_VET_LEVELS
:veteran_levels
];
1325 MOVEFRAGS move_bonus
[MAX_VET_LEVELS
:veteran_levels
];
1330 BV_UNIT_CLASSES cargo
;
1331 BV_UNIT_CLASSES targets
;
1332 BV_UNIT_CLASSES embarks
;
1333 BV_UNIT_CLASSES disembarks
;
1335 STRVEC helptext
[MAX_LEN_PACKET
];
1337 BV_UTYPE_FLAGS flags
;
1338 BV_UTYPE_ROLES roles
;
1341 PACKET_RULESET_UNIT_BONUS
= 228; sc
, lsend
1349 PACKET_RULESET_UNIT_FLAG
= 229; sc
, lsend
1351 STRING name
[MAX_LEN_NAME
];
1352 STRING helptxt
[MAX_LEN_PACKET
];
1355 PACKET_RULESET_GAME
= 141; sc
, lsend
1356 UINT8 default_specialist
;
1358 TECH_LIST global_init_techs
[MAX_NUM_TECH_LIST
];
1359 BUILDING_LIST global_init_buildings
[MAX_NUM_BUILDING_LIST
];
1361 UINT8 veteran_levels
;
1362 STRING veteran_name
[MAX_VET_LEVELS
:veteran_levels
][MAX_LEN_NAME
];
1363 UINT16 power_fact
[MAX_VET_LEVELS
:veteran_levels
];
1364 MOVEFRAGS move_bonus
[MAX_VET_LEVELS
:veteran_levels
];
1366 UINT8 background_red
;
1367 UINT8 background_green
;
1368 UINT8 background_blue
;
1371 PACKET_RULESET_SPECIALIST
= 142; sc
, lsend
1374 STRING plural_name
[MAX_LEN_NAME
];
1375 STRING rule_name
[MAX_LEN_NAME
];
1376 STRING short_name
[MAX_LEN_NAME
];
1378 STRING graphic_alt
[MAX_LEN_NAME
];
1381 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1383 STRVEC helptext
[MAX_LEN_PACKET
];
1386 PACKET_RULESET_GOVERNMENT_RULER_TITLE
= 143; sc
, lsend
1389 STRING male_title
[MAX_LEN_NAME
];
1390 STRING female_title
[MAX_LEN_NAME
];
1393 PACKET_RULESET_TECH
= 144; sc
, lsend
1397 BV_TECH_FLAGS flags
;
1400 STRING name
[MAX_LEN_NAME
];
1401 STRING rule_name
[MAX_LEN_NAME
];
1402 STRVEC helptext
[MAX_LEN_PACKET
];
1403 STRING graphic_str
[MAX_LEN_NAME
];
1404 STRING graphic_alt
[MAX_LEN_NAME
];
1407 PACKET_RULESET_TECH_FLAG
= 234; sc
, lsend
1409 STRING name
[MAX_LEN_NAME
];
1410 STRING helptxt
[MAX_LEN_PACKET
];
1413 PACKET_RULESET_GOVERNMENT
= 145; sc
, lsend
1417 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1419 STRING name
[MAX_LEN_NAME
];
1420 STRING rule_name
[MAX_LEN_NAME
];
1421 STRING graphic_str
[MAX_LEN_NAME
];
1422 STRING graphic_alt
[MAX_LEN_NAME
];
1423 STRVEC helptext
[MAX_LEN_PACKET
];
1426 PACKET_RULESET_TERRAIN_CONTROL
= 146; sc
, lsend
1427 UINT8 ocean_reclaim_requirement_pct
; /* # adjacent land tiles for reclaim
*/
1428 UINT8 land_channel_requirement_pct
; /* # adjacent ocean tiles for channel
*/
1429 UINT8 terrain_thaw_requirement_pct
; /* # adjacent unfrozen tiles for thaw
*/
1430 UINT8 terrain_freeze_requirement_pct
; /* # adjacent frozen tiles
*/
1431 UINT8 lake_max_size
; /* bodies of water up to this size are freshwater
*/
1432 UINT8 min_start_native_area
;
1433 MOVEFRAGS move_fragments
;
1434 MOVEFRAGS igter_cost
;
1435 BOOL pythagorean_diagonal
;
1436 STRING gui_type_base0
[MAX_LEN_NAME
];
1437 STRING gui_type_base1
[MAX_LEN_NAME
];
1440 PACKET_RULESETS_READY
= 225; sc
, lsend
1443 PACKET_RULESET_NATION_SETS
= 236; sc
, lsend
1445 STRING names
[MAX_NUM_NATION_SETS
:nsets
][MAX_LEN_NAME
];
1446 STRING rule_names
[MAX_NUM_NATION_SETS
:nsets
][MAX_LEN_NAME
];
1447 /* This relies on MAX_NUM_NATION_SETS not being too big to overflow
1448 * the packet length
: */
1449 STRING descriptions
[MAX_NUM_NATION_SETS
:nsets
][MAX_LEN_MSG
]; /*untranslated
*/
1452 PACKET_RULESET_NATION_GROUPS
= 147; sc
, lsend
1454 STRING groups
[MAX_NUM_NATION_GROUPS
:ngroups
][MAX_LEN_NAME
];
1455 BOOL hidden
[MAX_NUM_NATION_GROUPS
:ngroups
];
1458 PACKET_RULESET_NATION
= 148; sc
, lsend
1461 STRING translation_domain
[MAX_LEN_NAME
];
1462 /* Strings are untranslated
*/
1463 STRING adjective
[MAX_LEN_NAME
];
1464 STRING rule_name
[MAX_LEN_NAME
];
1465 STRING noun_plural
[MAX_LEN_NAME
];
1466 STRING graphic_str
[MAX_LEN_NAME
];
1467 STRING graphic_alt
[MAX_LEN_NAME
];
1468 STRING legend
[MAX_LEN_MSG
];
1473 STRING leader_name
[MAX_NUM_LEADERS
:leader_count
][MAX_LEN_NAME
];
1474 BOOL leader_is_male
[MAX_NUM_LEADERS
:leader_count
];
1477 BARBARIAN_TYPE barbarian_type
;
1480 UINT8 sets
[MAX_NUM_NATION_SETS
:nsets
];
1483 UINT8 groups
[MAX_NUM_NATION_GROUPS
:ngroups
];
1485 GOVERNMENT init_government_id
;
1486 TECH_LIST init_techs
[MAX_NUM_TECH_LIST
];
1487 UNIT_LIST init_units
[MAX_NUM_UNIT_LIST
];
1488 BUILDING_LIST init_buildings
[MAX_NUM_BUILDING_LIST
];
1491 # Separate from PACKET_RULESET_NATION since it can change in pregame
1492 # without a ruleset reload
1493 PACKET_NATION_AVAILABILITY
= 237; sc
, lsend
1495 BOOL is_pickable
[MAX_NUM_NATIONS
:ncount
];
1496 BOOL nationset_change
;
1499 PACKET_RULESET_STYLE
= 239; sc
, lsend
1501 STRING name
[MAX_LEN_NAME
];
1502 STRING rule_name
[MAX_LEN_NAME
];
1505 PACKET_RULESET_CITY
= 149; sc
, lsend
1507 STRING name
[MAX_LEN_NAME
];
1508 STRING rule_name
[MAX_LEN_NAME
];
1509 STRING citizens_graphic
[MAX_LEN_NAME
];
1510 STRING citizens_graphic_alt
[MAX_LEN_NAME
];
1512 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1513 STRING graphic
[MAX_LEN_NAME
];
1514 STRING graphic_alt
[MAX_LEN_NAME
];
1517 PACKET_RULESET_BUILDING
= 150; sc
, lsend
1520 STRING name
[MAX_LEN_NAME
];
1521 STRING rule_name
[MAX_LEN_NAME
];
1522 STRING graphic_str
[MAX_LEN_NAME
];
1523 STRING graphic_alt
[MAX_LEN_NAME
];
1525 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1527 REQUIREMENT obs_reqs
[MAX_NUM_REQS
:obs_count
];
1529 UINT8 upkeep
, sabotage
;
1530 BV_IMPR_FLAGS flags
;
1531 STRING soundtag
[MAX_LEN_NAME
];
1532 STRING soundtag_alt
[MAX_LEN_NAME
];
1533 STRVEC helptext
[MAX_LEN_PACKET
];
1536 PACKET_RULESET_TERRAIN
= 151; sc
, lsend
1540 BV_TERRAIN_FLAGS flags
;
1541 BV_UNIT_CLASSES native_to
;
1543 STRING name
[MAX_LEN_NAME
];
1544 STRING rule_name
[MAX_LEN_NAME
];
1545 STRING graphic_str
[MAX_LEN_NAME
];
1546 STRING graphic_alt
[MAX_LEN_NAME
];
1548 UINT8 movement_cost
; # Whole movement
points (not multiplied by SINGLE_MOVE
)
1549 SINT16 defense_bonus
;
1551 UINT8 output
[O_LAST
];
1552 UINT8 num_resources
;
1553 RESOURCE resources
[MAX_NUM_RESOURCES
:num_resources
];
1555 UINT16 road_output_incr_pct
[O_LAST
];
1559 TERRAIN irrigation_result
;
1560 UINT8 irrigation_food_incr
;
1561 UINT8 irrigation_time
;
1563 TERRAIN mining_result
;
1564 UINT8 mining_shield_incr
;
1569 TERRAIN transform_result
;
1570 UINT8 transform_time
;
1571 UINT8 clean_pollution_time
;
1572 UINT8 clean_fallout_time
;
1579 STRVEC helptext
[MAX_LEN_PACKET
];
1582 PACKET_RULESET_TERRAIN_FLAG
= 231; sc
, lsend
1584 STRING name
[MAX_LEN_NAME
];
1585 STRING helptxt
[MAX_LEN_PACKET
];
1588 PACKET_RULESET_UNIT_CLASS
= 152; sc
, lsend
1590 STRING name
[MAX_LEN_NAME
];
1591 STRING rule_name
[MAX_LEN_NAME
];
1592 MOVEFRAGS min_speed
;
1595 UINT16 non_native_def_pct
;
1596 BV_UCLASS_FLAGS flags
;
1598 STRVEC helptext
[MAX_LEN_PACKET
];
1601 PACKET_RULESET_EXTRA
= 232; sc
, lsend
1603 STRING name
[MAX_LEN_NAME
];
1604 STRING rule_name
[MAX_LEN_NAME
];
1608 STRING activity_gfx
[MAX_LEN_NAME
];
1609 STRING act_gfx_alt
[MAX_LEN_NAME
];
1610 STRING act_gfx_alt2
[MAX_LEN_NAME
];
1611 STRING rmact_gfx
[MAX_LEN_NAME
];
1612 STRING rmact_gfx_alt
[MAX_LEN_NAME
];
1613 STRING graphic_str
[MAX_LEN_NAME
];
1614 STRING graphic_alt
[MAX_LEN_NAME
];
1616 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1618 REQUIREMENT rmreqs
[MAX_NUM_REQS
:rmreqs_count
];
1621 UINT8 build_time_factor
;
1623 UINT8 removal_time_factor
;
1624 UINT8 defense_bonus
;
1625 BV_UNIT_CLASSES native_to
;
1626 BV_EXTRA_FLAGS flags
;
1627 BV_EXTRAS hidden_by
;
1628 BV_EXTRAS conflicts
;
1629 STRVEC helptext
[MAX_LEN_PACKET
];
1632 PACKET_RULESET_BASE
= 153; sc
, lsend
1636 SINT8 vision_main_sq
;
1637 SINT8 vision_invis_sq
;
1638 BV_BASE_FLAGS flags
;
1641 PACKET_RULESET_ROAD
= 220; sc
, lsend
1643 UINT8 first_reqs_count
;
1644 REQUIREMENT first_reqs
[MAX_NUM_REQS
:first_reqs_count
];
1645 SINT16 move_cost
; # not MOVEFRAGS because
-1 is valid
1646 MOVE_MODE move_mode
;
1647 UINT16 tile_incr_const
[O_LAST
];
1648 UINT16 tile_incr
[O_LAST
];
1649 UINT16 tile_bonus
[O_LAST
];
1651 BV_ROADS integrates
;
1652 BV_ROAD_FLAGS flags
;
1655 PACKET_RULESET_DISASTER
= 224; sc
, lsend
1657 STRING name
[MAX_LEN_NAME
];
1658 STRING rule_name
[MAX_LEN_NAME
];
1660 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1662 BV_DISASTER_EFFECTS effects
;
1665 PACKET_RULESET_ACHIEVEMENT
= 233; sc
, lsend
1667 STRING name
[MAX_LEN_NAME
];
1668 STRING rule_name
[MAX_LEN_NAME
];
1669 ACHIEVEMENT_TYPE type
;
1674 PACKET_RULESET_TRADE
= 227; sc
, lsend
1678 TR_BONUS_TYPE bonus_type
;
1681 PACKET_RULESET_ACTION
= 246; sc
, lsend
1684 STRING ui_name
[MAX_LEN_NAME
];
1688 PACKET_RULESET_ACTION_ENABLER
= 235; sc
, lsend
1689 GEN_ACTION enabled_action
;
1690 UINT8 actor_reqs_count
;
1691 REQUIREMENT actor_reqs
[MAX_NUM_REQS
:actor_reqs_count
];
1692 UINT8 target_reqs_count
;
1693 REQUIREMENT target_reqs
[MAX_NUM_REQS
:target_reqs_count
];
1696 PACKET_RULESET_MUSIC
= 240; sc
, lsend
1698 STRING music_peaceful
[MAX_LEN_NAME
];
1699 STRING music_combat
[MAX_LEN_NAME
];
1701 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1704 PACKET_RULESET_MULTIPLIER
= 243; sc
, dsend
, lsend
1712 STRING name
[MAX_LEN_NAME
];
1713 STRING rule_name
[MAX_LEN_NAME
];
1714 STRVEC helptext
[MAX_LEN_PACKET
];
1717 /**************************************************************************
1718 Ruleset control values
: single values
, all of which are needed before
1719 sending other ruleset data. After sending this packet
, resend every
1720 other part of the rulesets.
(Terrain ruleset has enough info for its
1721 own
"control" packet
, done separately.
)
1722 **************************************************************************/
1723 PACKET_RULESET_CONTROL
= 155; sc
, lsend
1724 UINT16 num_unit_classes
;
1725 UINT16 num_unit_types
;
1726 UINT16 num_impr_types
;
1727 UINT16 num_tech_types
;
1728 UINT16 num_extra_types
;
1729 UINT16 num_base_types
;
1730 UINT16 num_road_types
;
1731 UINT16 num_disaster_types
;
1732 UINT16 num_achievement_types
;
1733 UINT16 num_multipliers
;
1735 UINT16 num_music_styles
;
1736 UINT16 government_count
;
1737 UINT16 nation_count
;
1738 UINT16 styles_count
;
1739 UINT16 terrain_count
;
1740 UINT16 resource_count
;
1741 UINT16 num_specialist_types
;
1743 STRING preferred_tileset
[MAX_LEN_NAME
];
1744 STRING preferred_soundset
[MAX_LEN_NAME
];
1745 STRING preferred_musicset
[MAX_LEN_NAME
];
1746 BOOL popup_tech_help
;
1748 STRING name
[MAX_LEN_NAME
];
1749 STRING version
[MAX_LEN_NAME
];
1753 PACKET_RULESET_SUMMARY
= 249; sc
, lsend
1754 STRING text
[MAX_LEN_CONTENT
];
1757 PACKET_RULESET_DESCRIPTION_PART
= 247; sc
, lsend
1758 STRING text
[MAX_LEN_CONTENT
];
1761 /*********************************************************
1762 Below are the packets that control single
-player mode.
1763 *********************************************************/
1764 PACKET_SINGLE_WANT_HACK_REQ
= 160; cs
, handle
-per
-conn
, handle
-via
-packet
1765 STRING token
[MAX_LEN_NAME
];
1768 PACKET_SINGLE_WANT_HACK_REPLY
= 161; sc
, dsend
1772 PACKET_RULESET_CHOICES
= 162; sc
1773 UINT8 ruleset_count
;
1774 STRING rulesets
[MAX_NUM_RULESETS
:ruleset_count
][MAX_RULESET_NAME_LENGTH
];
1777 PACKET_GAME_LOAD
= 163; sc
, lsend
, dsend
1778 BOOL load_successful
;
1779 STRING load_filename
[MAX_LEN_PACKET
];
1782 PACKET_SERVER_SETTING_CONTROL
= 164; sc
, handle
-via
-packet
, is
-info
1783 UINT16 settings_num
;
1784 UINT8 categories_num
;
1785 STRING category_names
[256:categories_num
][MAX_LEN_NAME
]; /* untranslated
*/
1788 PACKET_SERVER_SETTING_CONST
= 165; sc
, handle
-via
-packet
, is
-info
1790 STRING name
[MAX_LEN_NAME
];
1791 STRING short_help
[MAX_LEN_PACKET
]; /* untranslated
*/
1792 STRING extra_help
[MAX_LEN_PACKET
]; /* untranslated
*/
1796 PACKET_SERVER_SETTING_BOOL
= 166; sc
, handle
-via
-packet
, is
-info
1800 BOOL initial_setting
;
1806 PACKET_SERVER_SETTING_INT
= 167; sc
, handle
-via
-packet
, is
-info
1810 BOOL initial_setting
;
1818 PACKET_SERVER_SETTING_STR
= 168; sc
, handle
-via
-packet
, is
-info
1822 BOOL initial_setting
;
1824 STRING val
[MAX_LEN_PACKET
];
1825 STRING default_val
[MAX_LEN_PACKET
];
1828 PACKET_SERVER_SETTING_ENUM
= 169; sc
, handle
-via
-packet
, is
-info
1832 BOOL initial_setting
;
1837 STRING support_names
[64:values_num
][MAX_LEN_NAME
];
1838 STRING pretty_names
[64:values_num
][MAX_LEN_ENUM
]; /* untranslated
*/
1841 PACKET_SERVER_SETTING_BITWISE
= 170; sc
, handle
-via
-packet
, is
-info
1845 BOOL initial_setting
;
1850 STRING support_names
[64:bits_num
][MAX_LEN_NAME
];
1851 STRING pretty_names
[64:bits_num
][MAX_LEN_ENUM
]; /* untranslated
*/
1854 PACKET_SET_TOPOLOGY
= 250; sc
1858 /************** Effects hash packets
**********************/
1860 PACKET_RULESET_EFFECT
= 175; sc
, lsend
1861 EFFECT_TYPE effect_type
;
1862 SINT32 effect_value
;
1863 BOOL has_multiplier
;
1864 MULTIPLIER multiplier
;
1867 REQUIREMENT reqs
[MAX_NUM_REQS
:reqs_count
];
1870 PACKET_RULESET_RESOURCE
= 177; sc
, lsend
1873 STRING name
[MAX_LEN_NAME
];
1874 STRING rule_name
[MAX_LEN_NAME
];
1875 UINT8 output
[O_LAST
];
1876 STRING graphic_str
[MAX_LEN_NAME
];
1877 STRING graphic_alt
[MAX_LEN_NAME
];
1880 /****************** Scenario Related Packets
******************/
1882 PACKET_SCENARIO_INFO
= 180; sc
, handle
-via
-packet
, handle
-per
-conn
1885 STRING authors
[MAX_LEN_PACKET
/ 3];
1887 BOOL startpos_nations
;
1889 BOOL prevent_new_cities
;
1892 BOOL allow_ai_type_fallback
;
1894 /* Unused at client side.
*/
1895 BOOL have_resources
;
1898 PACKET_SCENARIO_DESCRIPTION
= 252; sc
, handle
-per
-conn
1899 STRING description
[MAX_LEN_CONTENT
];
1902 PACKET_SAVE_SCENARIO
= 181; cs
, handle
-per
-conn
, dsend
1903 STRING name
[MAX_LEN_NAME
];
1906 /*************** Vote Packets
***************/
1908 PACKET_VOTE_NEW
= 185; sc
, handle
-via
-packet
1910 STRING user
[MAX_LEN_NAME
];
1912 UINT8 percent_required
;
1916 /* Sent to the client to give the new vote totals.
*/
1917 PACKET_VOTE_UPDATE
= 186; sc
, is
-info
1925 PACKET_VOTE_REMOVE
= 187; sc
1929 PACKET_VOTE_RESOLVE
= 188; sc
1934 /* Sent to the server by the client when the client
1936 * - yes (value
= +1)
1938 * - abstain (value
= 0) */
1939 PACKET_VOTE_SUBMIT
= 189; cs
, handle
-per
-conn
, no
-delta
1944 /************** Client Editor Packets
**********************/
1946 /* Always keep this as the first edit type packet sent by
1947 * the client
, so that the test in server
/srv_main.c in
1948 * the function
is_client_edit_packet() is easy to write.
*/
1949 PACKET_EDIT_MODE
= 190; cs
, handle
-per
-conn
, dsend
1953 PACKET_EDIT_RECALCULATE_BORDERS
= 197; cs
, handle
-per
-conn
1956 PACKET_EDIT_CHECK_TILES
= 198; cs
, handle
-per
-conn
1959 PACKET_EDIT_TOGGLE_FOGOFWAR
= 199; cs
, handle
-per
-conn
, dsend
1963 PACKET_EDIT_TILE_TERRAIN
= 200; cs
, handle
-per
-conn
, dsend
1969 PACKET_EDIT_TILE_RESOURCE
= 201; cs
, handle
-per
-conn
, dsend
1975 PACKET_EDIT_TILE_EXTRA
= 202; cs
, handle
-per
-conn
, dsend
1977 EXTRA extra_type_id
;
1982 PACKET_EDIT_STARTPOS
= 204; cs
, sc
, dsend
, handle
-per
-conn
, handle
-via
-packet
, no
-delta
1988 PACKET_EDIT_STARTPOS_FULL
= 205; cs
, sc
, handle
-per
-conn
, handle
-via
-packet
, no
-delta
1991 BV_STARTPOS_NATIONS nations
;
1994 PACKET_EDIT_TILE
= 206; cs
, handle
-per
-conn
, handle
-via
-packet
1999 NATION startpos_nation
;
2000 STRING label
[MAX_LEN_NAME
];
2003 PACKET_EDIT_UNIT_CREATE
= 207; cs
, handle
-per
-conn
, dsend
2011 PACKET_EDIT_UNIT_REMOVE
= 208; cs
, handle
-per
-conn
, dsend
2018 PACKET_EDIT_UNIT_REMOVE_BY_ID
= 209; cs
, handle
-per
-conn
, dsend
2022 PACKET_EDIT_UNIT
= 210; cs
, handle
-per
-conn
, handle
-via
-packet
2027 MOVEFRAGS moves_left
;
2032 UINT16 activity_count
;
2038 UNIT transported_by
;
2041 PACKET_EDIT_CITY_CREATE
= 211; cs
, handle
-per
-conn
, dsend
2048 PACKET_EDIT_CITY_REMOVE
= 212; cs
, handle
-per
-conn
, dsend
2052 PACKET_EDIT_CITY
= 213; cs
, handle
-per
-conn
, handle
-via
-packet
2054 STRING name
[MAX_LEN_NAME
];
2059 UINT8 ppl_happy
[5], ppl_content
[5], ppl_unhappy
[5], ppl_angry
[5];
2060 UINT8 specialists_size
;
2061 UINT8 specialists
[SP_MAX
:specialists_size
];
2062 UINT16 trade
[MAX_TRADE_ROUTES
];
2063 UINT16 food_stock
, shield_stock
;
2073 TURN turn_last_built
;
2074 SINT32 built
[B_LAST
]; diff
2075 UINT8 production_kind
;
2076 UINT8 production_value
;
2077 UINT16 last_turns_shield_surplus
;
2078 BV_CITY_OPTIONS city_options
;
2081 PACKET_EDIT_PLAYER_CREATE
= 214; cs
, handle
-per
-conn
, dsend
2085 PACKET_EDIT_PLAYER_REMOVE
= 215; cs
, handle
-per
-conn
, dsend
2089 PACKET_EDIT_PLAYER
= 216; cs
, handle
-per
-conn
, lsend
2091 STRING name
[MAX_LEN_NAME
];
2092 STRING username
[MAX_LEN_NAME
];
2093 STRING ranked_username
[MAX_LEN_NAME
];
2097 GOVERNMENT government
;
2098 GOVERNMENT target_government
;
2105 TURN revolution_finishes
;
2110 PERCENT tax
, science
, luxury
;
2114 UINT32 bulbs_researched
;
2115 BOOL inventions
[A_LAST
+1]; diff
2120 PACKET_EDIT_PLAYER_VISION
= 217; cs
, handle
-per
-conn
, dsend
2127 /* Always keep this as the last edit type packet sent by
2128 * the client
, so that the test in server
/srv_main.c in
2129 * the function
is_client_edit_packet() is easy to write.
*/
2130 PACKET_EDIT_GAME
= 218; cs
, handle
-per
-conn
, handle
-via
-packet
2133 STRING scenario_name
[256];
2134 STRING scenario_authors
[MAX_LEN_PACKET
/ 3];
2135 BOOL scenario_random
;
2136 BOOL scenario_players
;
2137 BOOL startpos_nations
;
2138 BOOL prevent_new_cities
;
2142 PACKET_EDIT_SCENARIO_DESC
= 253; cs
, handle
-per
-conn
2143 STRING scenario_desc
[MAX_LEN_CONTENT
];
2146 /************** Server Editor Packets
**********************/
2148 PACKET_EDIT_OBJECT_CREATED
= 219; sc
, dsend
2153 /************** Client Activity Requests
**********************/
2155 PACKET_PLAY_MUSIC
= 245; sc
, lsend
2156 STRING tag
[MAX_LEN_NAME
];