29#ifdef HAVE_SYS_IOCTL_H
32#ifdef HAVE_SYS_TERMIO_H
33#include <sys/termio.h>
35#ifdef FREECIV_HAVE_SYS_TYPES_H
156 const struct player *pplayer,
162 const struct player *pplayer,
165 const struct player *pplayer,
168 const struct player *pplayer,
214#ifdef FREECIV_TESTMATIC
266#ifdef FREECIV_JSON_CONNECTION
316 int emerg_version,
const char *distribution)
318 pc->client_gui =
gui;
320 if (emerg_version > 0) {
321 log_debug(
"It's emergency release .%d", emerg_version);
323 if (
strcmp(distribution,
"")) {
324 log_debug(
"It comes from %s distribution.", distribution);
389 pplayer->is_winner =
TRUE;
414 if ((pplayer)->is_alive
446 if (pplayer->is_alive
460 _(
"Team victory to %s."),
465 pplayer->is_winner =
TRUE;
515 pplayer->is_winner =
TRUE;
546 pplayer->is_winner =
TRUE;
567 && (!pplayer->is_alive
569 && pplayer->team !=
victor->team
610 _(
"Game ended in cultural domination victory for %s."),
612 log_normal(
_(
"Game ended in cultural domination victory for %s."),
623 _(
"Game ended as the turn limit was exceeded."));
624 log_normal(
_(
"Game ended as the turn limit was exceeded."));
629 _(
"Notice: game will end at the end of this turn due "
630 "to 'endturn' server setting."));
643 for (
i = 0;
i <
n;
i++) {
682 _(
"Team victory to %s."),
690 _(
"Game ended in victory for %s."),
player_name(pplayer));
716 _(
"Notice: the %s spaceship will likely arrive at "
717 "Alpha Centauri next turn."),
847 *current = (count *
percent) / 100;
860 log_debug(
"environmental_upset: type=%-4d current=%-2d "
890 PL_(
"Warning: you still have %d military unit in %s territory.",
891 "Warning: you still have %d military units in %s territory.",
899 PL_(
"%s Any such units will be disbanded in %d turn, "
900 "in accordance with peace treaty.",
901 "%s Any such units will be disbanded in %d turns, "
902 "in accordance with peace treaty.", turns_left),
922 _(
"Your %s was disbanded in accordance with "
923 "your peace treaty with the %s."),
937 _(
"Your %s was disbanded in accordance with "
938 "your peace treaty with the %s."),
987 _(
"Concerned citizens point out that the cease-fire "
996 _(
"The cease-fire with %s has run out. "
997 "You are now at war with the %s."),
1001 _(
"The cease-fire with %s has run out. "
1002 "You are now at war with the %s."),
1041 _(
"The cease-fire between %s and %s has run out. "
1042 "They are at war. You cancel your alliance "
1051 _(
"The cease-fire between %s and %s has run out. "
1052 "They are at war. You cancel your alliance "
1061 _(
"The cease-fire between %s and %s has run out. "
1062 "They are at war. You cancel your alliance "
1070 to1->has_reason_to_cancel = 1;
1079 from1->turns_left--;
1084 to2->has_reason_to_cancel = 1;
1093 from2->turns_left--;
1141 if (
is_ai(pplayer)) {
1179 log_error(
"Unrecognized phase mode %d in begin_turn().",
1225 if (pplayer->unassigned_ranked
1227 && pplayer->is_alive) {
1228 sz_strlcpy(pplayer->ranked_username, pplayer->username);
1229 pplayer->unassigned_ranked = pplayer->unassigned_user;
1269 pplayer->phase_done =
FALSE;
1271 pplayer->ai_phase_done =
FALSE;
1295 if (ptile->placing !=
NULL) {
1310 ptile->placing =
NULL;
1315 ptile->infra_turns--;
1316 if (ptile->infra_turns <= 0) {
1318 ptile->placing =
NULL;
1362 log_debug(
"beginning player turn for #%d (%s)",
1384 if (
is_ai(pplayer)) {
1409 if (
is_ai(pplayer)) {
1459 && pplayer->target_government !=
NULL
1461 && pplayer->target_government != pplayer->government) {
1469 if (pplayer->multipliers[idx].value != pmul->def) {
1471 _(
"%s restored to the default value %d"),
1474 pplayer->multipliers[idx].value = pmul->def;
1478 if (pplayer->multipliers[idx].value != pplayer->multipliers[idx].target) {
1480 _(
"%s now at value %d"),
1482 pplayer->multipliers[idx].target);
1484 pplayer->multipliers[idx].value = pplayer->multipliers[idx].target;
1520 if (
is_ai(pplayer)) {
1540 if (!pplayer->is_alive) {
1550 _(
"Automatically placed spaceship parts that were still not placed."));
1554 pplayer->server.bulbs_last_turn = 0;
1637 int food = 0, shields = 0, trade = 0,
settlers = 0;
1655 log_debug(
"%s T%d cities:%d pop:%d food:%d prod:%d "
1656 "trade:%d settlers:%d units:%d",
player_name(pplayer),
1712 if (pplayer !=
first) {
1749 &&
fc_rand(10000) < pextra->disappearance_chance
1761 _(
"%s disappears from %s."),
1776 &&
fc_rand(10000) < pextra->appearance_chance
1789 _(
"%s appears to %s."),
1813 pplayer->turns_alive++;
1889 _(
"%s lost control cmdlevel on "
1890 "game start. Use voting from now on."),
1993 log_error(
"Got a report request %d before game start",
type);
1998 log_error(
"Got a report request %d from detached connection",
type);
2021 _(
"request for unknown report (type %d)"),
type);
2054 return server.identity_number;
2070 "Exhausted city and unit numbers!");
2074 return server.identity_number;
2108 unsigned char buffer[4096];
2122 _(
"Your client is too old. To use this server, "
2123 "please upgrade your client to a "
2124 "Freeciv 2.2 or later."));
2159 if (!
pconn->established) {
2160 log_error(
"Received game packet %s(%d) from unaccepted connection %s.",
2181 _(
"You are not allowed to edit."));
2186 log_error(
"Received unknown packet %d from %s.",
2192 pplayer =
pconn->playing;
2194 if (
NULL == pplayer ||
pconn->observer) {
2200 log_error(
"Received packet %s(%d) from non-player connection %s.",
2214 log_debug(
"Got a packet of type %s(%d) in %s.",
2217 log_error(
"Got a packet of type %s(%d) outside %s.",
2226 log_error(
"Got a packet of type %s(%d) from a dead player.",
2235 log_error(
"Received unknown packet %d from %s.",
2275 if (pplayer->is_connected && (
is_human(pplayer) || pplayer->phase_done)) {
2286 if (!pplayer->phase_done && pplayer->is_alive) {
2287 if (pplayer->is_connected) {
2296 if (
is_ai(pplayer) && !pplayer->ai_phase_done) {
2317 if (pnation->player->nation == pnation) {
2320 pnation->server.no_startpos = FALSE;
2322 }
else if (
NULL != pnation->player->nation) {
2325 pnation->player->nation->player = NULL;
2326 pnation->player = NULL;
2330 pnation->player = NULL;
2331 },
"Player assigned to nation before %s()!",
__FUNCTION__);
2336 pnation->server.no_startpos =
FALSE;
2342 pnation->server.no_startpos =
TRUE;
2351 pnation->server.no_startpos =
FALSE;
2360 pnation->server.no_startpos =
FALSE;
2372 const char *
name,
int style)
2393 _(
"%s nation is not available for user selection."),
2399 _(
"%s nation is already in use."),
2415 _(
"%s is the %s ruler %s."),
2422 }
else if (
name[0] ==
'\0') {
2480 if (other_player->is_connected) {
2481 if (other_player->is_ready) {
2491 _(
"Waiting to start game: %d out of %d alive players "
2492 "are ready to start."),
2517 limitreason =
_(
"requested more than 'maxplayers' setting");
2524 limitreason =
_(
"not enough playable nations in this nation set "
2525 "(see 'nationset' setting)");
2581 log_normal(
_(
"%s has been added as %s level AI-controlled player (%s)."),
2586 _(
"%s has been added as %s level AI-controlled player (%s)."),
2600#define SPECHASH_TAG startpos
2601#define SPECHASH_IKEY_TYPE struct startpos *
2602#define SPECHASH_INT_DATA_TYPE
2604#define startpos_hash_iterate(hash, psp, c) \
2605 TYPED_HASH_ITERATE(struct startpos *, intptr_t, hash, psp, c)
2606#define startpos_hash_iterate_end HASH_ITERATE_END
2700 &&
NULL == pnation->player
2764 ||
NULL != pnation->player) {
2780 }
else if (val == min && 0 ==
fc_rand(++
i)) {
2846 const char *choice =
NULL;
2900 log_verbose(
"srv_running() mostly redundant send_server_settings()");
2909 ?
NULL :
"save interval");
2963 log_verbose(
"End/start-turn server/ai activities: %g seconds",
3074 "authentication support, but it's currently not "
3094#if IS_BETA_VERSION || IS_DEVEL_VERSION
3158 con_write(
C_FAIL,
_(
"Not starting without explicitly requested metaserver connection."));
3181 _(
"The game is over..."));
3211 pplayer->revolution_finishes = 0;
3217 pplayer->multipliers[
midx].value
3218 = pplayer->multipliers[
midx].target
3233 if (!pplayer->is_connected &&
is_human(pplayer)) {
3271 {
"teamplacement", }
3316 log_normal(
_(
"Failed to create suitable map, retrying with another mapseed."));
3332#ifdef FREECIV_NDEBUG
3340 NULL, error,
sizeof(error));
3342 "Failed to restore '%s': %s",
3374 _(
"Setting '%s' has been adjusted from %s to %s."),
3378 log_normal(
_(
"Setting '%s' has been adjusted from %s to %s."),
3446 if (
is_ai(pplayer)) {
3500 server.playable_nations = 0;
3585 log_normal(
_(
"Now accepting new client connections on port %d."),
3644 const struct player *pplayer)
3677 log_error(
"No server setting with the id %d exists.",
id);
3692 log_error(
"No server setting with the id %d exists.",
id);
3707 log_error(
"No server setting with the id %d exists.",
id);
3722 log_error(
"No server setting with the id %d exists.",
id);
3737 log_error(
"No server setting with the id %d exists.",
id);
3771 const struct player *pplayer,
3800 const struct player *pplayer,
3816 const struct player *pplayer,
3842 const struct player *pplayer,
3847 if (unit_count == 0) {
3884 for (
i = 0;
i < count;
i++) {
3905 if (pplayer !=
other) {
int achievement_index(const struct achievement *pach)
struct player * achievement_plr(struct achievement *ach, struct player_list *achievers)
const char * achievement_later_msg(struct achievement *pach)
const char * achievement_first_msg(struct achievement *pach)
#define achievements_iterate_end
#define achievements_iterate(_ach_)
void building_advisor(struct player *pplayer)
void adv_data_analyze_rulesets(struct player *pplayer)
bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
void adv_data_phase_done(struct player *pplayer)
void adv_data_default(struct player *pplayer)
bool adv_spaceship_autoplace(struct player *pplayer, struct player_spaceship *ship)
const char * ai_name(const struct ai_type *ai)
#define ai_timer_free(...)
#define CALL_FUNC_EACH_AI(_func,...)
#define ai_timer_init(...)
#define CALL_PLR_AI_FUNC(_func, _player,...)
const char * default_ai_type_name(void)
void ai_traits_init(struct player *pplayer)
void create_animals(void)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_init(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
bool auth_handle_reply(struct connection *pconn, char *password)
void adv_workers_free(void)
void auto_workers_player(struct player *pplayer)
void summon_barbarians(void)
#define BV_ISSET(bv, bit)
void bugreport_request(const char *reason_format,...)
void game_advance_year(void)
void game_next_year(struct packet_game_info *info)
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
void free_city_map_index(void)
#define cities_iterate_end
#define city_list_iterate(citylist, pcity)
#define cities_iterate(pcity)
#define city_owner(_pcity_)
#define city_list_iterate_end
bool check_city_migrations(void)
void city_counters_refresh(struct city *pcity)
void send_city_turn_notifications(struct connection *pconn)
void update_city_activities(struct player *pplayer)
void city_tc_effect_refresh(struct player *pplayer)
void check_disasters(void)
void city_refresh_queue_processing(void)
@ REPORT_WONDERS_OF_THE_WORLD
@ REPORT_WONDERS_OF_THE_WORLD_LONG
bool handle_login_request(struct connection *pconn, struct packet_server_join_req *req)
void conn_set_access(struct connection *pconn, enum cmdlevel new_level, bool granted)
void conn_list_do_unbuffer(struct conn_list *dest)
bool can_conn_edit(const struct connection *pconn)
void conn_list_compression_thaw(const struct conn_list *pconn_list)
void conn_list_do_buffer(struct conn_list *dest)
void conn_list_compression_freeze(const struct conn_list *pconn_list)
bool conn_controls_player(const struct connection *pconn)
const char * conn_description(const struct connection *pconn)
bool connection_send_data(struct connection *pconn, const unsigned char *data, int len)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
void con_log_init(const char *log_filename, enum log_level level, int fatal_assertions)
void con_write(enum rfc_status rfc_status, const char *message,...)
void con_puts(enum rfc_status rfc_status, const char *str)
#define city_counters_iterate_end
#define city_counters_iterate(pcount)
int dio_put_uint8_raw(struct raw_data_out *dout, int value)
void dio_output_init(struct raw_data_out *dout, void *destination, size_t dest_size)
int dio_put_string_raw(struct raw_data_out *dout, const char *value)
int dio_put_bool32_raw(struct raw_data_out *dout, bool value)
int dio_put_uint16_raw(struct raw_data_out *dout, int value)
size_t dio_output_used(struct raw_data_out *dout)
void dio_output_rewind(struct raw_data_out *dout)
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
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 int const struct action *paction struct unit struct city * pcity
void set_ai_level_directer(struct player *pplayer, enum ai_level level)
void send_diplomatic_meetings(struct connection *dest)
void set_diplstate_type(struct player_diplstate *state1, struct player_diplstate *state2, enum diplstate_type type)
int get_unit_bonus(const struct unit *punit, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
void cmdline_option_values_free(void)
void libfreeciv_init(bool check_fc_interface)
void libfreeciv_free(void)
struct functions * fc_interface_funcs(void)
#define MAX_NUM_PLAYER_SLOTS
#define IDENTITY_NUMBER_ZERO
bool fcdb_init(const char *conf_file)
const char * get_internal_encoding(void)
static char void init_character_encodings(const char *my_internal_encoding, bool my_use_transliteration)
#define FC_DEFAULT_DATA_ENCODING
const char * get_locale_dir(void)
#define bindtextdomain(Package, Directory)
#define PL_(String1, String2, n)
void fc_mutex_init(fc_mutex *mutex)
void fc_mutex_destroy(fc_mutex *mutex)
const char * tile_link(const struct tile *ptile)
const struct ft_color ftc_server
const struct ft_color ftc_editor
const char * unit_tile_link(const struct unit *punit)
bool is_player_phase(const struct player *pplayer, int phase)
int current_turn_timeout(void)
void game_init(bool keep_ruleset_value)
int generate_save_name(const char *format, char *buf, int buflen, const char *reason)
#define TURNS_NEEDED_TO_RANK
void send_year_to_clients(void)
void send_game_info(struct conn_list *dest)
struct unit_type * crole_to_unit_type(char crole, struct player *pplayer)
static char * leader_name
static struct gui_funcs funcs
bool server_handle_packet(enum packet_type type, const void *packet, struct player *pplayer, struct connection *pconn)
void handle_conn_pong(struct connection *pc)
void handle_diplomacy_cancel_pact(struct player *pplayer, int other_player_id, enum clause_type clause)
void adv_city_free(struct city *pcity)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert_exit_msg(condition, message,...)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_action_msg(condition, action, message,...)
#define log_fatal(message,...)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
#define log_testmatic(message,...)
bool startpos_nation_allowed(const struct startpos *psp, const struct nation_type *pnation)
bool startpos_allows_all(const struct startpos *psp)
void main_map_allocate(void)
int map_startpos_count(void)
#define map_startpos_iterate(NAME_psp)
#define map_startpos_iterate_end
#define whole_map_iterate(_map, _tile)
#define whole_map_iterate_end
bool map_fractal_generate(bool autosize, struct unit_type *initial_unit)
void generator_free(void)
void player_map_init(struct player *pplayer)
void map_set_border_vision(struct player *pplayer, const bool is_enabled)
void send_map_info(struct conn_list *dest)
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
void disable_fog_of_war(void)
void show_map_to_all(void)
void send_all_known_tiles(struct conn_list *dest)
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
void enable_fog_of_war(void)
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
void map_show_all(struct player *pplayer)
void map_show_tile(struct player *src_player, struct tile *ptile)
void nuclear_winter(int effect)
void tile_change_side_effects(struct tile *ptile, bool refresh_city)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void map_calculate_borders(void)
void update_tile_knowledge(struct tile *ptile)
void give_shared_vision(struct player *pfrom, struct player *pto)
void global_warming(int effect)
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
struct mapdef * mapimg_isvalid(int id)
void mapimg_init(mapimg_tile_known_func mapimg_tile_known, mapimg_tile_terrain_func mapimg_tile_terrain, mapimg_tile_player_func mapimg_tile_owner, mapimg_tile_player_func mapimg_tile_city, mapimg_tile_player_func mapimg_tile_unit, mapimg_plrcolor_count_func mapimg_plrcolor_count, mapimg_plrcolor_get_func mapimg_plrcolor_get)
bool mapimg_create(struct mapdef *pmapdef, bool force, const char *savename, const char *path)
const char * mapimg_error(void)
const char * multiplier_name_translation(const struct multiplier *pmul)
bool multiplier_can_be_changed(struct multiplier *pmul, struct player *pplayer)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
struct nation_leader * nation_leader_by_name(const struct nation_type *pnation, const char *name)
bool nation_leader_is_male(const struct nation_leader *pleader)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
const struct nation_leader_list * nation_leaders(const struct nation_type *pnation)
struct nation_type * nation_of_player(const struct player *pplayer)
bool is_nation_playable(const struct nation_type *nation)
int nation_set_count(void)
bool can_conn_edit_players_nation(const struct connection *pconn, const struct player *pplayer)
const char * nation_leader_name(const struct nation_leader *pleader)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
const char * nation_plural_for_player(const struct player *pplayer)
struct government * init_government_of_nation(const struct nation_type *pnation)
struct nation_style * style_of_nation(const struct nation_type *pnation)
#define nation_leader_list_iterate(leaderlist, pleader)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_leader_list_iterate_end
#define NO_NATION_SELECTED
void fc_init_network(void)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_remove_old(void)
void send_pending_events(struct connection *pconn, bool include_public)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_clear(void)
void event_cache_free(void)
void event_cache_phases_invalidate(void)
void event_cache_init(void)
void send_attribute_block(const struct player *pplayer, struct connection *pconn)
const char * packet_name(enum packet_type type)
void lsend_packet_begin_turn(struct conn_list *dest)
int send_packet_end_phase(struct connection *pc)
void dlsend_packet_start_phase(struct conn_list *dest, int phase)
void lsend_packet_freeze_client(struct conn_list *dest)
void lsend_packet_end_phase(struct conn_list *dest)
void lsend_packet_achievement_info(struct conn_list *dest, const struct packet_achievement_info *packet)
void lsend_packet_end_turn(struct conn_list *dest)
void lsend_packet_thaw_client(struct conn_list *dest)
@ PACKET_NATION_SELECT_REQ
@ PACKET_CLIENT_HEARTBEAT
@ PACKET_AUTHENTICATION_REPLY
@ PACKET_SINGLE_WANT_HACK_REQ
struct player * player_by_number(const int player_id)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
int player_slot_count(void)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct player * player_by_name(const char *name)
int player_index(const struct player *pplayer)
struct player * player_by_user(const char *name)
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_list_iterate(playerlist, pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_list_iterate_end
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
void server_player_set_name(struct player *pplayer, const char *name)
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_status_add(struct player *plr, enum player_status pstatus)
int normal_player_count(void)
void playercolor_free(void)
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 playercolor_init(void)
void kill_player(struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
void update_national_activities(struct player *pplayer, int old_gold)
bool player_status_check(struct player *plr, enum player_status pstatus)
struct rgbcolor * playercolor_get(int id)
int playercolor_count(void)
void shuffle_players(void)
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 make_contact(struct player *pplayer1, struct player *pplayer2, struct tile *ptile)
void update_capital(struct player *pplayer)
void assign_player_colors(void)
bool client_can_pick_nation(const struct nation_type *pnation)
bool nation_is_in_current_set(const struct nation_type *pnation)
void enter_war(struct player *pplayer, struct player *pplayer2)
void update_revolution(struct player *pplayer)
#define alive_phase_players_iterate(pplayer)
#define alive_phase_players_iterate_end
#define phase_players_iterate(pplayer)
#define allowed_nations_iterate(pnation)
#define allowed_nations_iterate_end
#define phase_players_iterate_end
bool fc_rand_is_init(void)
void fc_srand(RANDOM_TYPE seed)
void fc_rand_uninit(void)
randseed generate_game_seed(void)
void registry_module_init(void)
void registry_module_close(void)
void report_final_scores(struct conn_list *dest)
void report_wonders_of_the_world(struct conn_list *dest)
void report_demographics(struct connection *pconn)
void report_wonders_of_the_world_long(struct conn_list *dest)
void make_history_report(void)
void log_civ_score_free(void)
void report_top_cities(struct conn_list *dest)
void report_achievements(struct connection *pconn)
void log_civ_score_now(void)
struct research * research_get(const struct player *pplayer)
Tech_type_id research_goal_step(const struct research *presearch, Tech_type_id goal)
#define researches_iterate(_presearch)
#define researches_iterate_end
void rulesets_deinit(void)
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
void save_system_close(void)
void save_game(const char *orig_filename, const char *save_reason, bool scenario)
void calc_civ_score(struct player *pplayer)
void rank_users(bool interrupt)
int total_player_citizens(const struct player *pplayer)
bool script_fcdb_call(const char *func_name,...)
void script_server_signal_emit(const char *signal_name,...)
int server_open_socket(void)
void init_connections(void)
enum server_events server_sniff_all_input(void)
void readline_atexit(void)
void close_connections_and_socket(void)
#define SERVER_SETTING_NONE
void settings_init(bool act)
int setting_int_get(struct setting *pset)
struct setting * setting_by_name(const char *name)
const char * setting_value_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
int setting_number(const struct setting *pset)
struct setting * setting_by_number(int id)
enum sset_type setting_type(const struct setting *pset)
struct setting_list * level[OLEVELS_NUM]
void settings_game_start(void)
bool setting_enum_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
const char * setting_name(const struct setting *pset)
int setting_bitwise_get(struct setting *pset)
bool setting_bool_get(struct setting *pset)
void send_server_settings(struct conn_list *dest)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
const struct strvec * get_data_dirs(void)
int rank_spaceship_arrival(struct player **result)
double spaceship_arrival(const struct player *pplayer)
void send_spaceship_info(struct player *src, struct conn_list *dest)
void spaceship_arrived(struct player *pplayer)
void timing_log_init(void)
void timing_log_free(void)
static void srv_prepare(void)
static struct player * mapimg_server_tile_owner(const struct tile *ptile, const struct player *pplayer, bool knowledge)
static void server_gui_color_free(struct color *pcolor)
void server_game_init(bool keep_ruleset_value)
static struct terrain * mapimg_server_tile_terrain(const struct tile *ptile, const struct player *pplayer, bool knowledge)
static void save_all_map_images(void)
static struct player * mapimg_server_tile_city(const struct tile *ptile, const struct player *pplayer, bool knowledge)
static void update_diplomatics(void)
static struct player * mapimg_server_tile_unit(const struct tile *ptile, const struct player *pplayer, bool knowledge)
void handle_nation_select_req(struct connection *pc, int player_no, Nation_type_id nation_no, bool is_male, const char *name, int style)
static void do_have_contacts_effect(void)
static void ai_start_phase(void)
static struct timer * eot_timer
const char * pick_random_player_name(const struct nation_type *pnation)
void identity_number_release(int id)
void player_nation_defaults(struct player *pplayer, struct nation_type *pnation, bool set_name)
static void handle_observer_ready(struct connection *pconn)
bv_id identity_numbers_used
static void world_peace_update(void)
void handle_report_req(struct connection *pconn, enum report_type type)
static void generate_players(void)
static void do_reveal_effects(void)
static int mapimg_server_plrcolor_count(void)
void handle_client_info(struct connection *pc, enum gui_type gui, int emerg_version, const char *distribution)
void handle_player_ready(struct player *requestor, int player_no, bool is_ready)
const char * aifill(int amount)
static bool identity_number_is_used(int id)
static void end_phase(void)
static enum server_states civserver_state
static void begin_turn(bool is_new_turn)
static void end_turn(void)
void save_game_auto(const char *save_reason, enum autosave_type type)
static struct rgbcolor * mapimg_server_plrcolor_get(int i)
void set_server_state(enum server_states newstate)
static int increment_identity_number(void)
const char * server_ss_name_get(server_setting_id id)
static bool world_peace_turn(void)
static void begin_phase(bool is_new_phase)
static void update_environmental_upset(enum environment_upset_type type, int *current, int *accum, int *level, int percent, void(*upset_action_fn)(int))
static void kill_dying_players(void)
bool game_was_started(void)
static void srv_scores(void)
#define startpos_hash_iterate(hash, psp, c)
void identity_number_reserve(int id)
struct server_arguments srvarg
static void srv_ready(void)
static void srv_running(void)
static void final_ruleset_adjustments(void)
#define startpos_hash_iterate_end
static int server_plr_tile_city_id_get(const struct tile *ptile, const struct player *pplayer)
static bool is_client_edit_packet(int type)
void fc__noreturn srv_main(void)
static void notify_illegal_armistice_units(struct player *phost, struct player *pguest, int turns_left)
bool server_ss_val_bool_get(server_setting_id id)
static void remove_illegal_armistice_units(struct player *plr1, struct player *plr2)
int identity_number(void)
server_setting_id server_ss_by_name(const char *name)
void check_for_full_turn_done(void)
static void player_set_nation_full(struct player *pplayer, struct nation_type *pnation)
static void announce_player(struct player *pplayer)
bool server_packet_input(struct connection *pconn, void *packet, int type)
static void fc_interface_init_server(void)
int server_ss_val_int_get(server_setting_id id)
static struct timer * between_turns
unsigned int server_ss_val_bitwise_get(server_setting_id id)
static bool has_been_srv_init
void send_all_info(struct conn_list *dest)
void init_game_seed(void)
void fc__noreturn server_quit(void)
void update_nations_with_startpos(void)
enum sset_type server_ss_type_get(server_setting_id id)
bool check_for_game_over(void)
static enum known_type mapimg_server_tile_known(const struct tile *ptile, const struct player *pplayer, bool knowledge)
static void do_border_vision_effect(void)
enum server_states server_state(void)
void server_game_free(void)
#define IDENTITY_NUMBER_SIZE
#define IDENTITY_NUMBER_SKIP
void signal_timer_free(void)
void set_running_game_access_level(void)
void stdinhand_turn(void)
void stdinhand_init(void)
void set_ai_level_direct(struct player *pplayer, enum ai_level level)
bool read_init_script(struct connection *caller, const char *script_filename, bool from_cmdline, bool check)
void stdinhand_free(void)
bool load_command(struct connection *caller, const char *filename, bool check, bool cmdline_load)
bool start_command(struct connection *caller, bool check, bool notify)
void toggle_ai_player_direct(struct connection *caller, struct player *pplayer)
void(* unit_deallocate)(int unit_id)
struct civ_game::@32::@36::@41 mutexes
char start_units[MAX_LEN_STARTUNIT]
struct packet_ruleset_control control
struct conn_list * est_connections
struct civ_game::@34 callbacks
struct packet_game_info info
struct timer * save_timer
char rulesetdir[MAX_LEN_NAME]
int additional_phase_seconds
struct packet_scenario_info scenario
struct conn_list * web_client_connections
struct timer * phase_timer
int nuclear_winter_percent
char orig_game_version[MAX_LEN_NAME]
char save_name[MAX_LEN_NAME]
struct civ_game::@32::@36 server
struct packet_timeout_info tinfo
int global_warming_percent
struct government * government_during_revolution
struct civ_map::@44::@46 server
enum map_generator generator
struct government * init_government
enum borders_mode borders
enum ai_level skill_level
enum phase_mode_type phase_mode
float seconds_to_phasedone
float last_turn_change_time
enum ai_level skill_level
char has_reason_to_cancel
struct player_ai ai_common
char username[MAX_LEN_NAME]
struct connection * current_conn
const struct ai_type * ai
struct player_score score
struct nation_type * nation
struct nation_style * style
bool metaconnection_persistent
char metaserver_addr[256]
char * scenarios_pathname
enum unit_activity activity
struct unit::@84::@87 server
struct nation_style * style_by_number(int id)
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
const char * team_name_translation(const struct team *pteam)
const struct player_list * team_members(const struct team *pteam)
#define teams_iterate_end
#define teams_iterate(_pteam)
#define terrain_has_flag(terr, flag)
bool tile_extra_apply(struct tile *ptile, struct extra_type *tgt)
bool tile_extra_rm_apply(struct tile *ptile, struct extra_type *tgt)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
#define tile_worked(_tile)
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
void timer_clear(struct timer *t)
void timer_destroy(struct timer *t)
void timer_start(struct timer *t)
struct timer * timer_new(enum timer_timetype type, enum timer_use use, const char *name)
double timer_read_seconds(struct timer *t)
struct timer * timer_renew(struct timer *t, enum timer_timetype type, enum timer_use use, const char *name)
static int best_value(const void *a, const void *b)
bool unit_is_cityfounder(const struct unit *punit)
bool is_enter_borders_unit(const struct unit *punit)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
struct unit_type * get_role_unit(int role, int role_index)
const char * unstable_message(void)
const char * freeciv_datafile_version(void)
bool victory_enabled(enum victory_condition_type victory)
void vision_free(struct vision *vision)
#define vision_layer_iterate(v)
#define vision_layer_iterate_end
void send_updated_vote_totals(struct conn_list *dest)
void clear_all_votes(void)
#define MAP_NATIVE_HEIGHT