157#ifdef SANITY_CHECKING
202 _(
" *** Server set to edit mode by %s! *** "),
208 _(
" *** Edit mode canceled by %s. *** "),
312 _(
"Cannot edit the tile because %d is not a valid "
313 "tile index on this map!"),
tile);
321 _(
"Cannot modify terrain for the tile %s because "
322 "%d is not a valid terrain id."),
341 int id,
bool removal,
int eowner,
int size)
349 _(
"Cannot edit the tile because %d is not a valid "
350 "tile index on this map!"),
tile);
357 _(
"Cannot modify extras for the tile %s because "
358 "%d is not a valid extra id."),
385 bool changed =
FALSE;
390 _(
"Cannot edit the tile because %d is not a valid "
391 "tile index on this map!"), packet->
tile);
444 struct city *homecity;
451 _(
"Cannot create units because %d is not a valid "
452 "tile index on this map!"),
tile);
460 _(
"Cannot create a unit at %s because the "
461 "given unit type id %d is invalid."),
470 _(
"Cannot create a unit of type %s at %s "
471 "because the given owner's player id %d is "
480 _(
"Cannot create another instance of unique unit type %s. "
481 "Player already has one such unit."),
487 _(
"Cannot create multiple instances of unique unit type %s."),
499 _(
"Cannot create unit of type %s on enemy tile "
509 _(
"Cannot create a unit of type %s on the terrain "
515 if (count > 0 && !pplayer->
is_alive) {
526 for (
i = 0;
i < count;
i++) {
552 _(
"Cannot remove units because %d is not a valid "
553 "tile index on this map!"),
tile);
561 _(
"Cannot remove a unit at %s because the "
562 "given unit type id %d is invalid."),
572 _(
"Cannot remove a unit of type %s at %s "
573 "because the given owner's player id %d is "
603 _(
"No such unit (ID %d)."),
id);
619 bool changed =
FALSE;
626 _(
"No such unit (ID %d)."),
id);
664 _(
"Invalid veteran level %d for unit %d (%s)."),
700 _(
"Cannot create a city because %d is not a valid "
701 "tile index on this map!"),
tile);
709 _(
"Cannot create a city at %s because the "
710 "given owner's player id %d is invalid"),
721 _(
"A city may not be built at %s."),
tile_link(ptile));
754 bool changed =
FALSE;
761 _(
"Cannot edit city with invalid city ID %d."),
774 _(
"Cannot edit city name: %s"),
buf);
785 _(
"Invalid city size %d for city %s."),
805 if (packet->
built[
id] >= 0) {
807 _(
"It is impossible for a city to have %s!"),
822 && packet->
built[
id] >= 0) {
849 _(
"Invalid city food stock amount %d for city %s "
850 "(allowed range is %d to %d)."),
864 _(
"Invalid city shield stock amount %d for city %s "
865 "(allowed range is %d to %d)."),
915 _(
"No more players can be added because the maximum "
916 "number of players (%d) has been reached."),
923 _(
"No more players can be added because there's "
924 "already maximum number of players allowed by maxplayers setting (value %d)"),
931 _(
"No more players can be added because there are "
932 "no available nations (%d used)."),
940 _(
"Player cannot be created because random nation "
941 "selection failed."));
949 _(
"Player creation failed."));
990 if (pplayer ==
NULL) {
992 _(
"No such player (ID %d)."),
id);
1022 _(
"Cannot edit player with invalid player ID %d."),
1039 _(
"Cannot change name of player (%d) '%s' to '%s': %s"),
1048 if (pnation ==
NULL) {
1050 _(
"Cannot change nation for player %d (%s) "
1051 "because the given nation ID %d is invalid."),
1056 _(
"Cannot change nation for player %d (%s) "
1057 "to nation %d (%s) because that nation is "
1058 "already assigned to player %d (%s)."),
1065 _(
"Cannot change nation for player %d (%s) "
1066 "to nation %d (%s) because that nation is "
1067 "not in the current nation set."),
1074 _(
"Cannot change nation for player %d (%s) "
1075 "to nation %d (%s) because that nation is "
1076 "unsuitable for this player."),
1112 if (!(0 <= packet->
gold && packet->
gold <= 1000000)) {
1114 _(
"Cannot set gold for player %d (%s) because "
1115 "the value %d is outside the allowed range."),
1128 _(
"Cannot set infrapoints for player %d (%s) because "
1129 "the value %d is outside the allowed range."),
1234 _(
"Cannot edit vision because %d is not a valid "
1235 "tile index on this map!"),
tile);
1243 _(
"Cannot edit vision for the tile at %s because "
1244 "given player id %d is invalid."),
1310 if (pcity ==
NULL) {
1312 _(
"No such city (ID %d)."),
id);
1338 _(
"Cannot toggle fog-of-war when it is already "
1346 _(
"Cannot toggle fog-of-war for invalid player ID %d."),
1372 if (
NULL == ptile) {
1374 _(
"Invalid tile index %d for start position."), packet->
id);
1411 if (
NULL == ptile) {
1413 _(
"Invalid tile index %d for start position."),
1421 _(
"Cannot edit start position nations at (%d, %d) "
1422 "because there is no start position there."),
1444 bool changed =
FALSE;
1520 _(
"No permissions to remotely save scenario."));
1527 _(
"Scenario information not set. Cannot save scenario."));
const char * default_ai_type_name(void)
#define BV_ARE_EQUAL(vec1, vec2)
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
void city_name_set(struct city *pcity, const char *new_name)
int city_granary_size(int city_size)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
void city_remove_improvement(struct city *pcity, const struct impr_type *pimprove)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
void city_refresh_queue_add(struct city *pcity)
bool city_change_size(struct city *pcity, citizens size, struct player *nationality, const char *reason)
void city_refresh_queue_processing(void)
void connection_detach(struct connection *pconn, bool remove_unused_player)
void conn_list_do_unbuffer(struct conn_list *dest)
bool can_conn_edit(const struct connection *pconn)
void conn_list_do_buffer(struct conn_list *dest)
bool can_conn_enable_editing(const struct connection *pconn)
const char * conn_description(const struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
void handle_edit_unit_remove_by_id(struct connection *pc, Unit_type_id id)
void handle_edit_tile(struct connection *pc, const struct packet_edit_tile *packet)
void handle_edit_scenario_desc(struct connection *pc, const char *scenario_desc)
void handle_edit_check_tiles(struct connection *pc)
void handle_edit_mode(struct connection *pc, bool is_edit_mode)
void handle_edit_tile_terrain(struct connection *pc, int tile, Terrain_type_id terrain, int size)
void handle_edit_player(struct connection *pc, const struct packet_edit_player *packet)
static bool need_continents_reassigned
void edithand_send_initial_packets(struct conn_list *dest)
static bool * unfogged_players
static struct tile_hash * modified_tile_table
void handle_edit_player_remove(struct connection *pc, int id)
static bool edit_tile_terrain_handling(struct tile *ptile, struct terrain *pterrain, bool send_info)
void handle_edit_city_remove(struct connection *pc, int id)
void handle_edit_player_vision(struct connection *pc, int plr_no, int tile, bool known, int size)
void handle_edit_city(struct connection *pc, const struct packet_edit_city *packet)
void handle_edit_city_create(struct connection *pc, int owner, int tile, int size, int tag)
static bool edit_tile_extra_handling(struct tile *ptile, struct extra_type *pextra, bool remove_mode, bool send_info)
void handle_edit_game(struct connection *pc, const struct packet_edit_game *packet)
void handle_edit_unit_remove(struct connection *pc, int owner, int tile, Unit_type_id utid, int count)
void handle_edit_toggle_fogofwar(struct connection *pc, int plr_no)
void handle_edit_startpos_full(struct connection *pconn, const struct packet_edit_startpos_full *packet)
static void check_leaving_edit_mode(void)
void handle_edit_player_create(struct connection *pc, int tag)
void handle_edit_recalculate_borders(struct connection *pc)
void handle_save_scenario(struct connection *pc, const char *name)
void handle_edit_tile_extra(struct connection *pc, int tile, int id, bool removal, int eowner, int size)
void handle_edit_unit_create(struct connection *pc, int owner, int tile, Unit_type_id utid, int count, int tag)
void handle_edit_unit(struct connection *pc, const struct packet_edit_unit *packet)
static void check_edited_tile_terrains(void)
void handle_edit_startpos(struct connection *pconn, const struct packet_edit_startpos *packet)
const char * tile_link(const struct tile *ptile)
const struct ft_color ftc_editor
const char * city_link(const struct city *pcity)
const char * unit_link(const struct unit *punit)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
void send_scenario_description(struct conn_list *dest)
void send_scenario_info(struct conn_list *dest)
void send_game_info(struct conn_list *dest)
struct government * government_by_number(const Government_type_id gov)
bool is_special_improvement(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define FC_STATIC_ASSERT(cond, tag)
struct startpos * map_startpos_get(const struct tile *ptile)
struct startpos * map_startpos_new(struct tile *ptile)
struct tile * startpos_tile(const struct startpos *psp)
bool startpos_pack(const struct startpos *psp, struct packet_edit_startpos_full *packet)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
bool map_startpos_remove(struct tile *ptile)
bool startpos_unpack(struct startpos *psp, const struct packet_edit_startpos_full *packet)
#define map_startpos_iterate(NAME_psp)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
#define map_startpos_iterate_end
#define MAP_TILE_OWNER_NULL
void assign_continent_numbers(void)
bool really_gives_vision(struct player *me, struct player *them)
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
void send_all_known_tiles(struct conn_list *dest)
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
void disable_fog_of_war_player(struct player *pplayer)
void map_show_tile(struct player *src_player, struct tile *ptile)
void tile_change_side_effects(struct tile *ptile, bool refresh_city)
void terrain_changed(struct tile *ptile)
void map_calculate_borders(void)
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
void enable_fog_of_war_player(struct player *pplayer)
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
void update_tile_knowledge(struct tile *ptile)
void map_hide_tile(struct player *src_player, struct tile *ptile)
#define fc_calloc(n, esz)
bool can_exist_at_tile(const struct civ_map *nmap, const struct unit_type *utype, const struct tile *ptile)
Nation_type_id nation_count(void)
struct nation_type * nation_by_number(const Nation_type_id nation)
struct nation_type * nation_of_player(const struct player *pplayer)
bool is_nation_playable(const struct nation_type *nation)
const char * nation_plural_translation(const struct nation_type *pnation)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
struct government * init_government_of_nation(const struct nation_type *pnation)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
int dsend_packet_unit_remove(struct connection *pc, int unit_id)
int send_packet_edit_startpos_full(struct connection *pc, const struct packet_edit_startpos_full *packet)
int dsend_packet_edit_object_created(struct connection *pc, int tag, int id)
int send_packet_edit_startpos(struct connection *pc, const struct packet_edit_startpos *packet)
int dsend_packet_edit_fogofwar_state(struct connection *pc, bool enabled)
struct player * player_by_number(const int player_id)
int player_slot_count(void)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
int player_index(const struct player *pplayer)
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
#define players_iterate_end
#define players_iterate(_pplayer)
static bool is_barbarian(const struct player *pplayer)
void send_player_all_c(struct player *src, struct conn_list *dest)
struct player * server_create_player(int player_id, const char *ai_tname, struct rgbcolor *prgbcolor, bool allow_ai_type_fallbacking)
void player_limit_to_max_rates(struct player *pplayer)
bool server_player_set_name_full(const struct connection *caller, struct player *pplayer, const struct nation_type *pnation, const char *name, char *error_buf, size_t error_buf_len)
struct nation_type * pick_a_nation(const struct nation_list *choices, bool ignore_conflicts, bool needs_startpos, enum barbarian_type barb_type)
void kill_player(struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
void server_remove_player(struct player *pplayer)
void government_change(struct player *pplayer, struct government *gov, bool revolution_finished)
void server_player_init(struct player *pplayer, bool initmap, bool needs_team)
void assign_player_colors(void)
bool nation_is_in_current_set(const struct nation_type *pnation)
int revolution_length(struct government *gov, struct player *plr)
enum tech_state research_invention_set(struct research *presearch, Tech_type_id tech, enum tech_state value)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
void research_update(struct research *presearch)
#define sanity_check_tile(x)
void save_game(const char *orig_filename, const char *save_reason, bool scenario)
#define CLIP(lower, current, upper)
void player_nation_defaults(struct player *pplayer, struct nation_type *pnation, bool set_name)
bool game_was_started(void)
int before_change_shields
struct packet_scenario_description scenario_desc
struct packet_ruleset_control control
struct conn_list * est_connections
struct packet_game_info info
struct packet_scenario_info scenario
struct civ_game::@31::@35 server
struct government * government_during_revolution
char name[MAX_LEN_CITYNAME]
char scenario_authors[MAX_LEN_PACKET/3]
Government_type_id government
bool inventions[A_LAST+1]
char description[MAX_LEN_CONTENT]
char authors[MAX_LEN_PACKET/3]
enum barbarian_type barbarian_type
struct player_ai ai_common
char username[MAX_LEN_NAME]
struct government * government
struct conn_list * connections
struct player_economic economic
struct player * extras_owner
#define sz_strlcpy(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
struct terrain * terrain_by_number(const Terrain_type_id type)
bool terrain_has_resource(const struct terrain *pterrain, const struct extra_type *presource)
#define terrain_has_flag(terr, flag)
bool tile_extra_apply(struct tile *ptile, struct extra_type *tgt)
void tile_change_terrain(struct tile *ptile, struct terrain *pterrain)
bool tile_extra_rm_apply(struct tile *ptile, struct extra_type *tgt)
bool tile_set_label(struct tile *ptile, const char *label)
void tile_set_resource(struct tile *ptile, struct extra_type *presource)
struct city * tile_city(const struct tile *ptile)
#define tile_hash_iterate(hash, ptile)
#define tile_terrain(_tile)
#define tile_hash_iterate_end
#define tile_has_extra(ptile, pextra)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
struct unit_type * utype_by_number(const Unit_type_id id)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
const char * utype_name_translation(const struct unit_type *punittype)
#define utype_fuel(ptype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)