diff --git a/client/packhand.c b/client/packhand.c index be31568fdd..c7bc531e59 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -988,7 +988,9 @@ void handle_city_info(const struct packet_city_info *packet) use for it. TODO: Do not generate code calling this in the C-client. ****************************************************************************/ -void handle_web_city_info_addition(int id, int granary_size, +void handle_web_city_info_addition(int id, bool cma_enabled, + const struct cm_parameter *cm_parameter, + int granary_size, int granary_turns) { } diff --git a/common/networking/packets.def b/common/networking/packets.def index f09ea4598c..150972f6d2 100644 --- a/common/networking/packets.def +++ b/common/networking/packets.def @@ -205,6 +205,7 @@ type WORKLIST = worklist(struct worklist) # string that is URI encoded in the JSON protocol type ESTRING = estring(char) type UNIT_ORDER = unit_order(struct unit_order) +type CM_PARAMETER = cm_parameter(struct cm_parameter) # typedefs for enums type ACHIEVEMENT_TYPE = uint8(enum achievement_type) @@ -2356,6 +2357,9 @@ end PACKET_WEB_CITY_INFO_ADDITION = 256; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_INFO) CITY id; key + BOOL cma_enabled; + CM_PARAMETER cm_parameter; + UINT16 granary_size; TURN granary_turns; end diff --git a/fc_version b/fc_version index c638ef6e5e..7765723d71 100755 --- a/fc_version +++ b/fc_version @@ -60,7 +60,7 @@ DEFAULT_FOLLOW_TAG=S3_2 # - No new mandatory capabilities can be added to the release branch; doing # so would break network capability of supposedly "compatible" releases. # -NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2022.Jul.26" +NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2022.Jul.29" FREECIV_DISTRIBUTOR="" diff --git a/server/citytools.c b/server/citytools.c index 323c23c2fe..ff080d7934 100644 --- a/server/citytools.c +++ b/server/citytools.c @@ -2608,6 +2608,14 @@ void package_city(struct city *pcity, struct packet_city_info *packet, #ifdef FREECIV_WEB web_packet->id = pcity->id; + if (pcity->cm_parameter != NULL) { + web_packet->cma_enabled = TRUE; + cm_copy_parameter(&web_packet->cm_parameter, pcity->cm_parameter); + } else { + web_packet->cma_enabled = TRUE; + memset(&web_packet->cm_parameter, 0, sizeof(web_packet->cm_parameter)); + } + web_packet->granary_size = city_granary_size(city_size_get(pcity)); web_packet->granary_turns = city_turns_to_grow(pcity); #endif /* FREECIV_WEB */