Freeciv-3.3
Loading...
Searching...
No Matches
Functions | Variables
client_main.c File Reference
#include "fc_prehdrs.h"
#include <math.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "bitvector.h"
#include "capstr.h"
#include "dataio.h"
#include "deprecations.h"
#include "fcbacktrace.h"
#include "fc_cmdline.h"
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "registry.h"
#include "support.h"
#include "timing.h"
#include "ai.h"
#include "diptreaty.h"
#include "fc_cmdhelp.h"
#include "fc_interface.h"
#include "game.h"
#include "idex.h"
#include "map.h"
#include "mapimg.h"
#include "modpack.h"
#include "netintf.h"
#include "packets.h"
#include "player.h"
#include "research.h"
#include "server_settings.h"
#include "version.h"
#include "chatline_g.h"
#include "citydlg_g.h"
#include "connectdlg_g.h"
#include "dialogs_g.h"
#include "diplodlg_g.h"
#include "editgui_g.h"
#include "graphics_g.h"
#include "gui_main_g.h"
#include "mapctrl_g.h"
#include "mapview_g.h"
#include "menu_g.h"
#include "messagewin_g.h"
#include "pages_g.h"
#include "plrdlg_g.h"
#include "repodlgs_g.h"
#include "voteinfo_bar_g.h"
#include "attribute.h"
#include "audio.h"
#include "cityrepdata.h"
#include "climisc.h"
#include "clinet.h"
#include "connectdlg_common.h"
#include "control.h"
#include "editor.h"
#include "global_worklist.h"
#include "gui_properties.h"
#include "helpdata.h"
#include "mapview_common.h"
#include "music.h"
#include "options.h"
#include "overview_common.h"
#include "packhand.h"
#include "svgflag.h"
#include "tilespec.h"
#include "themes_common.h"
#include "update_queue.h"
#include "voteinfo.h"
#include "zoom.h"
#include "agents.h"
#include "cma_core.h"
#include "script_client.h"
#include "client_main.h"

Go to the source code of this file.

Functions

static enum known_type mapimg_client_tile_known (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static struct terrainmapimg_client_tile_terrain (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static struct playermapimg_client_tile_owner (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static struct playermapimg_client_tile_city (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static struct playermapimg_client_tile_unit (const struct tile *ptile, const struct player *pplayer, bool knowledge)
 
static int mapimg_client_plrcolor_count (void)
 
static struct rgbcolormapimg_client_plrcolor_get (int i)
 
static void fc_interface_init_client (void)
 
static void cache_tilesets (void)
 
static charput_conv (const char *src, size_t *length)
 
static bool get_conv (char *dst, size_t ndst, const char *src, size_t nsrc)
 
static void charsets_init (void)
 
static void emergency_exit (void)
 
static void at_exit (void)
 
static void client_game_init (void)
 
static void client_game_free (void)
 
static void client_game_reset (void)
 
int default_tileset_select (void)
 
int client_main (int argc, char *argv[], bool postpone_tileset)
 
static void log_option_save_msg (enum log_level lvl, const char *msg,...)
 
void fc__noreturn client_exit (int return_value)
 
void client_packet_input (void *packet, int type)
 
void user_ended_turn (void)
 
void send_turn_done (void)
 
void send_report_request (enum report_type type)
 
void set_client_state (enum client_states newstate)
 
enum client_states client_state (void)
 
void client_remove_cli_conn (struct connection *pconn)
 
void client_remove_all_cli_conn (void)
 
void send_attribute_block_request (void)
 
void wait_till_request_got_processed (int request_id)
 
bool client_is_observer (void)
 
void set_seconds_to_turndone (double seconds)
 
bool is_waiting_turn_change (void)
 
void start_turn_change_wait (void)
 
void stop_turn_change_wait (void)
 
int get_seconds_to_turndone (void)
 
int get_seconds_to_new_turn (void)
 
double real_timer_callback (void)
 
bool can_client_control (void)
 
bool can_client_issue_orders (void)
 
bool can_meet_with_player (const struct player *pplayer)
 
bool can_intel_with_player (const struct player *pplayer)
 
const chartitle_for_player (const struct player *pplayer, char *buf, size_t buf_len)
 
bool can_client_change_view (void)
 
void set_server_busy (bool busy)
 
bool is_server_busy (void)
 
bool client_is_global_observer (void)
 
int client_player_number (void)
 
bool client_has_player (void)
 
bool client_map_is_known_and_seen (const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
 
static int client_plr_tile_city_id_get (const struct tile *ptile, const struct player *pplayer)
 
static server_setting_id client_ss_by_name (const char *name)
 
static const charclient_ss_name_get (server_setting_id id)
 
static enum sset_type client_ss_type_get (server_setting_id id)
 
static bool client_ss_val_bool_get (server_setting_id id)
 
static int client_ss_val_int_get (server_setting_id id)
 
static unsigned int client_ss_val_bitwise_get (server_setting_id id)
 
bool is_client_quitting (void)
 
void start_quitting (void)
 

Variables

charlogfile = NULL
 
charscriptfile = NULL
 
charsavefile = NULL
 
char forced_tileset_name [512] = "\0"
 
char sound_plugin_name [512] = "\0"
 
char sound_set_name [512] = "\0"
 
char music_set_name [512] = "\0"
 
char server_host [512] = "\0"
 
char user_name [512] = "\0"
 
char fc_password [MAX_LEN_PASSWORD] = "\0"
 
char metaserver [512] = "\0"
 
int server_port = -1
 
bool auto_connect = FALSE
 
bool auto_spawn = FALSE
 
enum announce_type announce
 
struct civclient client
 
static enum client_states civclient_state = C_S_INITIAL
 
bool waiting_for_end_turn = FALSE
 
static bool server_busy = FALSE
 
static bool client_quitting = FALSE
 
static double seconds_to_turndone = 0.0
 
static struct timerturndone_timer
 
static struct timerbetween_turns = NULL
 
static bool waiting_turn_change = FALSE
 
static int seconds_shown_to_turndone
 
static int seconds_shown_to_new_turn
 

Function Documentation

◆ at_exit()

static void at_exit ( void  )
static

This is called at program exit.

Definition at line 240 of file client_main.c.

Referenced by client_main().

◆ cache_tilesets()

static void cache_tilesets ( void  )
static

Create cache of available tilesets.

Definition at line 1669 of file client_main.c.

Referenced by client_main().

◆ can_client_change_view()

bool can_client_change_view ( void  )

Return TRUE if the client can change the view; i.e. if the mapview is active. This function should be called each time before allowing the user to do mapview actions.

Definition at line 1329 of file client_main.c.

Referenced by action_button_pressed(), butt_down_mapcanvas(), butt_down_overviewcanvas(), calculate_overview_dimensions(), center_on_something(), city_packet_common(), client_cooling_sprite(), client_government_sprite(), client_research_sprite(), client_warming_sprite(), get_overview_window(), handle_city_info(), handle_edit_startpos(), handle_edit_startpos_full(), handle_game_info(), handle_player_info(), handle_player_remove(), handle_tile_info(), key_city_overlay(), key_unit_select_battlegroup(), left_butt_down_mapcanvas(), map_canvas_draw(), map_canvas_draw(), map_canvas_resized(), meswin_dialog_update(), middle_butt_down_mapcanvas(), mouse_scroll_mapcanvas(), mouse_scroll_mapcanvas(), overview_canvas_draw(), overview_canvas_draw(), queue_mapview_tile_update(), queue_mapview_update(), real_menus_init(), real_menus_update(), recenter_button_pressed(), refresh_overview_canvas(), request_toggle_bases(), request_toggle_cities(), request_toggle_city_buycost(), request_toggle_city_full_bar(), request_toggle_city_growth(), request_toggle_city_names(), request_toggle_city_outlines(), request_toggle_city_output(), request_toggle_city_productions(), request_toggle_city_trade_routes(), request_toggle_coastline(), request_toggle_focus_unit(), request_toggle_fog_of_war(), request_toggle_huts(), request_toggle_irrigation(), request_toggle_map_borders(), request_toggle_map_grid(), request_toggle_map_native(), request_toggle_mines(), request_toggle_paths(), request_toggle_pollution(), request_toggle_resources(), request_toggle_terrain(), request_toggle_unit_shields(), request_toggle_unit_solid_bg(), request_toggle_unit_stack_size(), request_toggle_units(), request_unit_select(), right_butt_down_mapcanvas(), right_butt_down_overviewcanvas(), scroll_mapview(), scrollbar_jump_callback(), set_client_state(), toplevel_key_press_handler(), toplevel_key_press_handler(), unit_focus_add(), unit_focus_advance(), unit_focus_remove(), unit_focus_set(), unit_focus_update(), unqueue_mapview_updates(), update_map_canvas_scrollbars(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec(), and usdlg_cmd_focus_real().

◆ can_client_control()

bool can_client_control ( void  )

◆ can_client_issue_orders()

bool can_client_issue_orders ( void  )

Returns TRUE iff the client can issue orders (such as giving unit commands). This function should be called each time before allowing the user to give an order.

Definition at line 1281 of file client_main.c.

Referenced by action_decision_request(), adjust_workers_button_pressed(), append_cma_to_menu_item(), butt_down_overviewcanvas(), button_down_citymap(), city_dialog::buy(), buy_callback(), can_end_turn(), can_meet_with_player(), change_production_callback(), change_production_callback(), citizens_callback(), citizens_callback(), city_can_buy(), city_packet_common(), city_dialog::city_rename(), city_selection_changed_callback(), cityopt_callback(), city_dialog::clear_worklist(), client_change_all(), client_init_meeting(), clipboard_copy_production(), clipboard_paste_production(), city_dialog::cma_double_clicked(), common_taxrates_callback(), city_map::context_menu(), unit_item::contextMenuEvent(), unit_item::create_actions(), create_and_append_settings_page(), create_governor_menu(), create_multiplier_dialog(), create_rates_dialog(), create_unit_menu(), create_wl_menu(), science_report::current_tech_changed(), disband_all_units(), city_widget::display_list_menu(), city_dialog::display_worklist_menu(), do_disband_alternative(), economy_report_command_callback(), economy_report_selection_callback(), enable_minimap_widgets(), enable_order_buttons(), enable_unitinfo_widgets(), science_report::goal_tech_changed(), gui_init_meeting(), handle_city_name_suggestion_info(), handle_city_sabotage_list(), diplo_dlg::init(), key_unit_assign_battlegroup(), left_butt_down_overviewcanvas(), left_button_down_citymap(), maybe_activate_keyboardless_goto(), mr_menu::menus_sensitive(), middle_present_unit_release(), middle_supported_unit_release(), impr_item::mouseDoubleClickEvent(), city_map::mousePressEvent(), city_label::mousePressEvent(), plr_widget::mousePressEvent(), research_diagram::mousePressEvent(), multipliers_command_callback(), popup_airlift_dialog(), popup_diplomacy_dialog(), popup_goto_dialog(), popup_multiplier_dialog(), popup_rates_dialog(), present_unit_callback(), present_unit_middle_callback(), city_dialog::production_changed(), production_menu_shown(), real_city_dialog_refresh(), real_menus_init(), real_menus_update(), real_multipliers_dialog_update(), refresh_cma_dialog(), refresh_worklist(), request_new_unit_activity_targeted(), request_orders_cleared(), request_unit_load(), request_unit_unload(), right_button_down_citymap(), right_unit_release(), science_diagram_button_release_callback(), science_diagram_left_button_up(), science_report_current_callback(), science_report_goal_callback(), science_report_init(), sell_all_improvements(), sell_callback(), sell_callback(), set_government_choice(), spaceship_autoplace(), src_selection_callback(), src_selection_callback_depr(), supported_unit_callback(), supported_unit_middle_callback(), units_orders_city_dlg_callback(), units_report_command_callback(), units_report_selection_callback(), update_city_cma_dialog(), city_dialog::update_disabled(), update_players_menu(), plr_report::update_report(), upgrade_canvas_clipboard(), wakeup_button_pressed(), and wakeup_sentried_units().

◆ can_intel_with_player()

bool can_intel_with_player ( const struct player pplayer)

Returns TRUE iff the client can get intelligence from another given player.

Definition at line 1302 of file client_main.c.

Referenced by button_press_callback(), left_button_press_callback(), player_nation_callback(), players_intel_callback(), players_intel_callback(), popup_players_nations_dialog(), title_for_player(), and update_players_menu().

◆ can_meet_with_player()

bool can_meet_with_player ( const struct player pplayer)

◆ charsets_init()

static void charsets_init ( void  )
static

Set up charsets for the client.

Definition at line 222 of file client_main.c.

Referenced by client_main().

◆ client_exit()

void fc__noreturn client_exit ( int  return_value)

Main client execution stop function. This calls ui_exit() and not the other way around.

Definition at line 735 of file client_main.c.

Referenced by client_main(), and default_tileset_select().

◆ client_game_free()

static void client_game_free ( void  )
static

Called by set_client_state() and client_exit() below.

Definition at line 275 of file client_main.c.

Referenced by client_exit(), and set_client_state().

◆ client_game_init()

static void client_game_init ( void  )
static

Called only by set_client_state() below.

Definition at line 252 of file client_main.c.

Referenced by set_client_state().

◆ client_game_reset()

static void client_game_reset ( void  )
static

Called only by set_client_state() below. Just free what is needed to change view (player target).

Definition at line 305 of file client_main.c.

Referenced by set_client_state().

◆ client_has_player()

bool client_has_player ( void  )

◆ client_is_global_observer()

bool client_is_global_observer ( void  )

◆ client_is_observer()

bool client_is_observer ( void  )

◆ client_main()

int client_main ( int  argc,
char argv[],
bool  postpone_tileset 
)

Entry point for common client code.

Definition at line 355 of file client_main.c.

Referenced by main().

◆ client_map_is_known_and_seen()

bool client_map_is_known_and_seen ( const struct tile ptile,
const struct player pplayer,
enum vision_layer  vlayer 
)

Return the vision of the player on a tile. Client version of ./server/maphand/map_is_known_and_seen().

Definition at line 1390 of file client_main.c.

Referenced by fc_interface_init_client(), and infra_placement_set_tile().

◆ client_packet_input()

void client_packet_input ( void packet,
int  type 
)

Handle packet received from server.

Definition at line 785 of file client_main.c.

Referenced by input_from_server(), and input_from_server_till_request_got_processed().

◆ client_player_number()

int client_player_number ( void  )

Returns number of player attached to client.

Definition at line 1370 of file client_main.c.

Referenced by editbar_player_pov_combobox_changed(), editor_apply_tool(), and key_editor_toggle_fogofwar().

◆ client_plr_tile_city_id_get()

static int client_plr_tile_city_id_get ( const struct tile ptile,
const struct player pplayer 
)
static

Returns the id of the city the player believes exists at 'ptile'.

Definition at line 1400 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_remove_all_cli_conn()

void client_remove_all_cli_conn ( void  )

Remove (and free) all connections from all connection lists in client. Assumes game.all_connections is properly maintained with all connections.

Definition at line 1064 of file client_main.c.

Referenced by client_exit(), and set_client_state().

◆ client_remove_cli_conn()

void client_remove_cli_conn ( struct connection pconn)

Remove pconn from all connection lists in client, then free it.

Definition at line 1046 of file client_main.c.

Referenced by client_remove_all_cli_conn(), and handle_conn_info().

◆ client_ss_by_name()

static server_setting_id client_ss_by_name ( const char name)
static

Returns the id of the server setting with the specified name.

Definition at line 1414 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_ss_name_get()

static const char * client_ss_name_get ( server_setting_id  id)
static

Returns the name of the server setting with the specified id.

Definition at line 1429 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_ss_type_get()

static enum sset_type client_ss_type_get ( server_setting_id  id)
static

Returns the type of the server setting with the specified id.

Definition at line 1444 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_ss_val_bitwise_get()

static unsigned int client_ss_val_bitwise_get ( server_setting_id  id)
static

Returns the value of the bitwise server setting with the specified id.

Definition at line 1517 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_ss_val_bool_get()

static bool client_ss_val_bool_get ( server_setting_id  id)
static

Returns the value of the boolean server setting with the specified id.

Definition at line 1487 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_ss_val_int_get()

static int client_ss_val_int_get ( server_setting_id  id)
static

Returns the value of the integer server setting with the specified id.

Definition at line 1502 of file client_main.c.

Referenced by fc_interface_init_client().

◆ client_state()

enum client_states client_state ( void  )

◆ default_tileset_select()

int default_tileset_select ( void  )

Do the initial default tileset selection.

Definition at line 327 of file client_main.c.

Referenced by client_main(), and qtg_ui_main().

◆ emergency_exit()

static void emergency_exit ( void  )
static

This is called at program exit in any emergency. This is registered as at_quick_exit() callback, so no destructor kind of actions here

Definition at line 232 of file client_main.c.

Referenced by at_exit(), and client_main().

◆ fc_interface_init_client()

static void fc_interface_init_client ( void  )
static

Initialize client specific functions.

Definition at line 1532 of file client_main.c.

Referenced by client_main().

◆ get_conv()

static bool get_conv ( char dst,
size_t  ndst,
const char src,
size_t  nsrc 
)
static

Convert a text string from the data to the internal encoding when it is first read from the network. Returns FALSE if the destination isn't large enough or the source was bad.

Definition at line 194 of file client_main.c.

Referenced by charsets_init().

◆ get_seconds_to_new_turn()

int get_seconds_to_new_turn ( void  )

Return the number of seconds until turn-done. Don't call this unless current_turn_timeout() != 0.

Definition at line 1184 of file client_main.c.

Referenced by get_timeout_label_text().

◆ get_seconds_to_turndone()

int get_seconds_to_turndone ( void  )

Return the number of seconds until turn-done. Don't call this unless current_turn_timeout() != 0.

Definition at line 1170 of file client_main.c.

Referenced by get_timeout_label_text().

◆ is_client_quitting()

bool is_client_quitting ( void  )

Is the client marked as one going down?

Definition at line 1653 of file client_main.c.

Referenced by fc_client::closeEvent(), and set_client_state().

◆ is_server_busy()

bool is_server_busy ( void  )

Returns if server is considered busy at the moment

Definition at line 1354 of file client_main.c.

Referenced by can_end_turn(), and control_mouse_cursor().

◆ is_waiting_turn_change()

bool is_waiting_turn_change ( void  )

Are we in turn-change wait state?

Definition at line 1139 of file client_main.c.

Referenced by get_timeout_label_text(), and real_menus_update().

◆ log_option_save_msg()

static void log_option_save_msg ( enum log_level  lvl,
const char msg,
  ... 
)
static

Write messages from option saving to the log.

Definition at line 722 of file client_main.c.

Referenced by client_exit().

◆ mapimg_client_plrcolor_count()

static int mapimg_client_plrcolor_count ( void  )
static

Helper function for the mapimg module - number of player colors.

Definition at line 1623 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_plrcolor_get()

static struct rgbcolor * mapimg_client_plrcolor_get ( int  i)
static

Helper function for the mapimg module - one player color. For the client only the colors of the defined players are shown.

Definition at line 1632 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_tile_city()

static struct player * mapimg_client_tile_city ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

Helper function for the mapimg module - city owner.

Definition at line 1591 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_tile_known()

static enum known_type mapimg_client_tile_known ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

Helper function for the mapimg module - tile knowledge.

Definition at line 1557 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_tile_owner()

static struct player * mapimg_client_tile_owner ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

Helper function for the mapimg module - tile owner.

Definition at line 1581 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_tile_terrain()

static struct terrain * mapimg_client_tile_terrain ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

Helper function for the mapimg module - tile terrain.

Definition at line 1572 of file client_main.c.

Referenced by client_game_init().

◆ mapimg_client_tile_unit()

static struct player * mapimg_client_tile_unit ( const struct tile ptile,
const struct player pplayer,
bool  knowledge 
)
static

Helper function for the mapimg module - unit owner.

Definition at line 1607 of file client_main.c.

Referenced by client_game_init().

◆ put_conv()

static char * put_conv ( const char src,
size_t length 
)
static

Convert a text string from the internal to the data encoding, when it is written to the network.

Definition at line 176 of file client_main.c.

Referenced by charsets_init().

◆ real_timer_callback()

double real_timer_callback ( void  )

This function should be called at least once per second. It does various updates (idle animations and timeout updates). It returns the number of seconds until it should be called again.

Definition at line 1194 of file client_main.c.

Referenced by gui_event_loop(), gui_event_loop(), timer_callback(), and fc_client::timerEvent().

◆ send_attribute_block_request()

void send_attribute_block_request ( void  )

Send attribute block.

Definition at line 1078 of file client_main.c.

◆ send_report_request()

void send_report_request ( enum report_type  type)

◆ send_turn_done()

void send_turn_done ( void  )

Send information about player having finished their turn to server.

Definition at line 817 of file client_main.c.

Referenced by key_end_turn(), update_turn_done_button_state(), and user_ended_turn().

◆ set_client_state()

void set_client_state ( enum client_states  newstate)

◆ set_seconds_to_turndone()

void set_seconds_to_turndone ( double  seconds)

Reset the number of seconds to turndone from an "authentic" source.

The seconds are taken as a double even though most callers will just know an integer value.

Definition at line 1122 of file client_main.c.

Referenced by handle_new_year(), and handle_timeout_info().

◆ set_server_busy()

void set_server_busy ( bool  busy)

Sets if server is considered busy. Currently it is considered busy between turns.

Definition at line 1340 of file client_main.c.

Referenced by handle_end_turn(), handle_server_join_reply(), handle_start_phase(), and set_client_state().

◆ start_quitting()

void start_quitting ( void  )

Mark client as one going to quit as soon as possible,

Definition at line 1661 of file client_main.c.

Referenced by gui_ui_main(), popup_quit_dialog(), quit_dialog_response(), quit_dialog_response(), and ui_main().

◆ start_turn_change_wait()

void start_turn_change_wait ( void  )

Start waiting of the server turn change activities.

Definition at line 1147 of file client_main.c.

Referenced by handle_end_turn().

◆ stop_turn_change_wait()

void stop_turn_change_wait ( void  )

Server is responsive again

Definition at line 1160 of file client_main.c.

Referenced by disconnect_from_server(), and handle_begin_turn().

◆ title_for_player()

const char * title_for_player ( const struct player pplayer,
char buf,
size_t  buf_len 
)

Fill best possible title for the player to the given buffer, and return that buffer.

Definition at line 1313 of file client_main.c.

Referenced by create_diplomacy_dialog(), diplo_wdg::diplo_wdg(), and plr_widget::nation_selected().

◆ user_ended_turn()

void user_ended_turn ( void  )

Handle user ending their turn.

Definition at line 809 of file client_main.c.

Referenced by end_turn_callback(), handle_player_info(), and handle_start_phase().

◆ wait_till_request_got_processed()

void wait_till_request_got_processed ( int  request_id)

Wait until server has responsed to given request id.

Definition at line 1086 of file client_main.c.

Referenced by wait_for_requests().

Variable Documentation

◆ announce

enum announce_type announce

◆ auto_connect

bool auto_connect = FALSE

Definition at line 150 of file client_main.c.

Referenced by client_main(), handle_server_join_reply(), and set_client_state().

◆ auto_spawn

bool auto_spawn = FALSE

Definition at line 151 of file client_main.c.

Referenced by client_main(), and set_client_state().

◆ between_turns

struct timer* between_turns = NULL
static

Definition at line 1108 of file client_main.c.

Referenced by real_timer_callback(), and start_turn_change_wait().

◆ civclient_state

enum client_states civclient_state = C_S_INITIAL
static

Definition at line 156 of file client_main.c.

Referenced by client_state(), and set_client_state().

◆ client

struct civclient client

Definition at line 154 of file client_main.c.

Referenced by accept_treaty_callback(), action_confirmation(), action_decision_clear_want(), action_decision_handle(), activate_all_units(), add_net_input(), adjust_workers_button_pressed(), adv_unit_sentry_idle_callback(), diplo_wdg::all_advances(), append_cma_to_menu_item(), apply_result_on_server(), apply_taxrates_callback(), ask_server_for_actions(), attribute_flush(), back_callback(), mr_menu::back_to_menu(), blink_turn_done_button(), button_press_callback(), button_up_on_map(), buy_production_in_selected_cities(), call_meeting_dlg_callback(), can_client_change_view(), can_client_control(), can_end_turn(), can_intel_with_player(), can_meet_with_player(), cancel_meeting_callback(), cancel_pact_dlg_callback(), center_on_something(), change_research_callback(), change_research_goal_callback(), check_city(), cities_callback(), city_buy_production(), city_can_buy(), city_change_production(), city_change_specialist(), city_clear_worklist_callback(), city_clear_worklist_callback(), city_dialog_update_present_units(), city_dialog_update_prev_next(), city_dialog_update_supported_units(), city_dlg_callback(), city_packet_common(), city_rename(), city_sell_improvement(), city_set_worklist(), city_toggle_worker(), cityopt_callback(), client_change_all(), client_game_free(), client_game_init(), client_government_sprite(), client_has_player(), client_is_global_observer(), client_is_observer(), client_kill_server(), client_packet_input(), client_player_maps_reset(), client_player_number(), client_remove_cli_conn(), client_research_sprite(), client_start_server(), client_start_server_and_set_page(), client_tile_get_known(), clipboard_copy_production(), clipboard_paste_production(), clipboard_send_production_packet(), cma_put_city_under_agent(), cmp_love(), col_diplstate(), col_embassy(), col_love(), col_vision(), collect_buildable_targets(), collect_currently_building_targets(), common_taxrates_callback(), confirm_cancel_pact(), conn_menu_ready_chosen(), conn_menu_ready_chosen(), connect_callback(), city_map::context_menu(), control_mouse_cursor(), create_conn_menu(), create_governor_menu(), units_select::create_pixmap(), create_present_supported_units_widget_list(), create_races_dialog(), create_rates_dialog(), create_tech_info(), science_report::current_tech_changed(), diplo_wdg::dbl_click(), define_tiles_within_rectangle(), diplo_dialog_returnkey(), diplomacy_dialog_add_pact_clause(), diplomacy_dialog_add_pact_clause(), diplomacy_dialog_city_callback(), diplomacy_dialog_city_callback(), diplomacy_dialog_embassy_callback(), diplomacy_dialog_embassy_callback(), diplomacy_dialog_map_callback(), diplomacy_dialog_map_callback(), diplomacy_dialog_seamap_callback(), diplomacy_dialog_seamap_callback(), diplomacy_dialog_shared_tiles_callback(), diplomacy_dialog_shared_tiles_callback(), diplomacy_dialog_tech_callback(), diplomacy_dialog_tech_callback(), diplomacy_dialog_vision_callback(), diplomacy_dialog_vision_callback(), diplomacy_main_response(), diplomacy_response(), diplstate_value(), disband_all_units(), city_dialog::disband_state_changed(), disconnect_from_server(), do_disband_alternative(), do_map_click(), do_move_unit(), do_unit_act_sel_vs(), do_unit_paradrop_to(), do_unit_teleport_to(), economy_report_dialog_popup(), edit_buffer_paste(), editor_apply_tool(), editor_apply_tool_to_selection(), editor_is_active(), editor_notify_edit_finished(), embassy_callback(), enable_city_dlg_widgets(), fc_double_edge::fc_double_edge(), fill_grid_sprite_array(), find_best_focus_candidate(), find_city_or_settler_near_tile(), find_diplomacy_dialog(), find_visible_unit(), found_city(), found_city_callback(), found_city_callback(), city_widget::gen_production_labels(), get_act_sel_action_custom_text(), get_bulb_tooltip(), get_city_mapview_name_and_growth(), get_economy_report_data(), get_economy_report_units_data(), get_government_tooltip(), get_info_label_text(), get_info_label_text_popup(), get_tile_output_text(), get_turn_done_button_state(), get_units_report_data(), get_units_upgrade_info(), diplo_wdg::give_advance(), diplo_wdg::give_city(), diplo_wdg::give_embassy(), diplo_wdg::give_shared_vision(), global_worklist_alloc(), global_worklist_destroy(), global_worklists_free(), global_worklists_init(), science_report::goal_tech_changed(), gold_callback(), diplo_wdg::gold_changed1(), diplo_wdg::gold_changed2(), fc_client::handle_authentication_req(), handle_authentication_req(), handle_city_info(), handle_conn_info(), handle_conn_ping(), handle_event(), handle_new_year(), handle_player_diplstate(), handle_player_info(), handle_player_remove(), handle_processing_finished(), handle_processing_started(), handle_server_join_reply(), handle_start_phase(), handle_tile_info(), handle_unit_action_answer(), handle_unit_combat_info(), handle_unit_packet_common(), handle_unit_short_info(), handle_worker_task(), has_player_unit_type(), have_diplomat_info_about(), help_update_extra(), help_update_goods(), help_update_government(), help_update_improvement(), help_update_specialist(), help_update_tech(), help_update_terrain(), help_update_unit_type(), help_update_wonder(), horiz_taxrate_callback(), infra_placement_set_tile(), infra_selected_callback(), input_from_server(), input_from_server_till_request_got_processed(), is_outstanding_request(), key_editor_recalculate_borders(), key_editor_toggle(), key_editor_toggle_fogofwar(), key_unit_action_select(), key_unit_assign_battlegroup(), key_unit_select_battlegroup(), ss_report::launch(), launch_spaceship_callback(), leave_local_game_response(), leave_local_game_response(), main_callback(), main_key_down_handler(), main_key_down_handler(), make_connection(), mapimg_client_define(), maps_callback(), menu_item_callback(), menu_item_callback(), meswin_dialog_update(), meswin_popup_city(), misc_panel_city_dlg_callback(), research_diagram::mousePressEvent(), multipliers_command_callback(), races_dialog::nation_selected(), nationset_changed(), next_prev_city_dlg_callback(), notify_about_incoming_packet(), notify_about_outgoing_packet(), notify_goto::notify_goto(), num_present_units_in_city(), num_supported_units_in_city(), objbind_request_destroy_object(), races_dialog::ok_pressed(), ok_sell_impr_callback(), ok_upgrade_unit_window_callback(), option_dialog_new(), overview_tile_color(), diplo_wdg::pact_allianze(), pact_callback(), diplo_wdg::pact_ceasfire(), diplo_wdg::pact_peace(), paste_tile(), player_clear(), players_meet_callback(), players_meet_callback(), popup_advanced_terrain_dialog(), popup_airlift_dialog(), popup_conn_list_dialog(), popup_diplomacy_dialog(), popup_goto_airlift_dialog(), popup_goto_dialog(), popup_government_dialog(), popup_impr_info(), popup_notify_goto_dialog(), popup_players_nations_dialog(), popup_quit_dialog(), popup_rates_dialog(), popup_revolution_dialog(), popup_revolution_dialog(), popup_sabotage_dialog(), popup_sell_impr_callback(), popup_unit_info(), popup_upgrade_unit_callback(), popup_worklist_editor(), present_unit_callback(), property_page_create_objects(), property_page_destroy_objects(), property_page_send_packet(), property_page_send_values(), qtg_real_output_window_append(), quickselect(), quit_dialog_response(), quit_dialog_response(), races_dialog_ok_callback(), races_response(), races_update_pickable(), races_dialog::random_pressed(), rates_command_callback(), rates_set_values(), ready_button_callback(), real_activeunits_report_dialog_update(), real_city_dialog_popup(), real_city_dialog_refresh(), real_city_report_dialog_update(), real_conn_list_dialog_update(), real_economy_report_dialog_update(), real_info_city_report_dialog_update(), real_menus_init(), real_menus_update(), real_timer_callback(), real_units_report_dialog_update(), rebuild_imprm_list(), redraw_army_city_dialog(), redraw_supported_units_city_dialog(), redraw_unit_info_label(), refresh_spaceship_dialog(), refresh_worklist(), remove_clause_callback(), report_spaceship_callback(), report_spaceship_callback(), plr_report::req_caancel_threaty(), plr_report::req_meeeting(), plr_report::req_wiithdrw_vision(), request_action_details(), request_do_action(), request_move_unit_direction(), request_new_unit_activity_targeted(), request_orders_cleared(), request_unit_build_city(), request_unit_load(), request_unit_non_action_move(), request_unit_ssa_set(), request_unit_unload(), request_unit_unload_all(), resend_desired_settable_options(), diplo_wdg::response_accept(), diplo_wdg::response_cancel(), right_button_press_callback(), row_callback(), save_dialog_save_scenario(), science_diagram_button_release_callback(), science_diagram_data(), science_diagram_left_button_up(), science_dialog_text(), science_report_current_callback(), science_report_goal_callback(), score_tooltip(), diplo_wdg::sea_map_clause(), select_impr_or_unit_callback(), select_impr_or_unit_callback(), select_nation_callback(), select_unit_image_callback(), sell_all_improvements(), sell_callback(), sell_callback(), send_attribute_block_request(), send_chat(), send_chat_printf(), send_client_wants_hack(), send_connect_route(), send_passwd_callback(), send_path_orders(), send_rally_path_orders(), send_report_request(), send_turn_done(), set_city_workertask(), set_client_state(), set_government_choice(), set_indicator_icons(), set_ruleset(), help_widget::set_topic_building(), help_widget::set_topic_extra(), help_widget::set_topic_goods(), help_widget::set_topic_government(), help_widget::set_topic_specialist(), help_widget::set_topic_tech(), help_widget::set_topic_terrain(), help_widget::set_topic_unit(), set_wait_for_writable_socket(), shared_tiles_callback(), show_full_citybar(), show_new_turn_info(), side_right_click_diplomacy(), tax_rates_dialog::slot_apply_button_pressed(), fc_client::slot_connect(), fc_client::slot_disconnect(), tax_rates_dialog::slot_ok_button_pressed(), multipler_rates_dialog::slot_ok_button_pressed(), fc_client::slot_pregame_start(), fc_sidewidget::some_slot(), spaceship_autoplace(), spaceship_response(), spy_steal_popup_shared(), src_selection_callback(), src_selection_callback_depr(), fc_client::start_page_menu(), start_revolution(), start_style_music(), switch_city_callback(), fc_client::switch_page(), choice_dialog::switch_target(), target_drag_data_received(), target_drag_data_received(), tax_rates_dialog::tax_rates_dialog(), techs_callback(), tgt_extra_change_callback(), tgt_unit_change_callback(), tilespec_reread_callback(), toggle_tile_hilite(), try_to_connect(), unit_focus_add(), unit_focus_advance(), unit_focus_remove(), unit_focus_set(), unit_focus_update(), unit_select_dialog_popup(), units_orders_city_dlg_callback(), units_report_command_callback(), fc_client::update_buttons(), fc_sidewidget::update_final_pixmap(), fc_client::update_info_label(), update_info_label(), update_infra_dialog(), update_players_menu(), ss_report::update_report(), upgrade_canvas_clipboard(), unittype_item::upgrade_units(), vision_callback(), voteinfo_do_vote(), wait_till_request_got_processed(), wakeup_sentried_units(), withdraw_vision_dlg_callback(), and diplo_wdg::world_map_clause().

◆ client_quitting

bool client_quitting = FALSE
static

Definition at line 170 of file client_main.c.

Referenced by is_client_quitting(), and start_quitting().

◆ fc_password

char fc_password[MAX_LEN_PASSWORD] = "\0"

◆ forced_tileset_name

char forced_tileset_name[512] = "\0"

◆ logfile

char* logfile = NULL

Definition at line 138 of file client_main.c.

Referenced by client_main(), and client_start_server().

◆ metaserver

char metaserver[512] = "\0"

Definition at line 148 of file client_main.c.

Referenced by client_main().

◆ music_set_name

char music_set_name[512] = "\0"

◆ savefile

char* savefile = NULL

Definition at line 140 of file client_main.c.

Referenced by client_main(), and client_start_server().

◆ scriptfile

char* scriptfile = NULL

Definition at line 139 of file client_main.c.

Referenced by client_main(), and client_start_server().

◆ seconds_shown_to_new_turn

int seconds_shown_to_new_turn
static

◆ seconds_shown_to_turndone

int seconds_shown_to_turndone
static

◆ seconds_to_turndone

double seconds_to_turndone = 0.0
static

Definition at line 1103 of file client_main.c.

Referenced by real_timer_callback(), and set_seconds_to_turndone().

◆ server_busy

bool server_busy = FALSE
static

Definition at line 164 of file client_main.c.

Referenced by is_server_busy(), and set_server_busy().

◆ server_host

char server_host[512] = "\0"

◆ server_port

int server_port = -1

◆ sound_plugin_name

char sound_plugin_name[512] = "\0"

Definition at line 142 of file client_main.c.

Referenced by audio_restart(), and client_main().

◆ sound_set_name

char sound_set_name[512] = "\0"

◆ turndone_timer

struct timer* turndone_timer
static

Definition at line 1104 of file client_main.c.

Referenced by real_timer_callback(), and set_seconds_to_turndone().

◆ user_name

char user_name[512] = "\0"

◆ waiting_for_end_turn

bool waiting_for_end_turn = FALSE

Definition at line 159 of file client_main.c.

Referenced by send_turn_done(), and update_turn_done_button_state().

◆ waiting_turn_change

bool waiting_turn_change = FALSE
static