Freeciv-3.3
|
Go to the source code of this file.
Data Structures | |
struct | civclient |
Macros | |
#define | TIMER_INTERVAL (int)(real_timer_callback() * 1000) |
#define | client_player() client.conn.playing |
Enumerations | |
enum | client_states { C_S_INITIAL , C_S_DISCONNECTED , C_S_PREPARING , C_S_RUNNING , C_S_OVER } |
Variables | |
char * | logfile |
char * | scriptfile |
char * | savefile |
char | sound_plugin_name [512] |
char | sound_set_name [512] |
char | music_set_name [512] |
char | server_host [512] |
char | user_name [512] |
char | fc_password [MAX_LEN_PASSWORD] |
char | metaserver [512] |
int | server_port |
bool | auto_connect |
bool | auto_spawn |
bool | waiting_for_end_turn |
struct civclient | client |
const char *const | gui_character_encoding |
const bool | gui_use_transliteration |
#define client_player | ( | ) | client.conn.playing |
Definition at line 106 of file client_main.h.
#define TIMER_INTERVAL (int)(real_timer_callback() * 1000) |
Definition at line 30 of file client_main.h.
Enumerator | |
---|---|
C_S_INITIAL | |
C_S_DISCONNECTED | |
C_S_PREPARING | |
C_S_RUNNING | |
C_S_OVER |
Definition at line 43 of file client_main.h.
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().
Returns TRUE iff the client can control player.
Definition at line 1270 of file client_main.c.
Referenced by can_client_issue_orders(), draw_calculated_trade_routes(), nation_button_callback(), ready_button_callback(), fc_client::slot_pregame_start(), fc_client::update_buttons(), update_start_page_buttons(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec(), usdlg_cmd_focus_real(), and voteinfo_do_vote().
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().
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().
Returns TRUE iff the client can do diplomatic meetings with another given player.
Definition at line 1291 of file client_main.c.
Referenced by button_press_callback(), call_meeting_dlg_callback(), player_nation_callback(), popup_diplomacy_dialog(), popup_players_nations_dialog(), right_button_press_callback(), update_players_menu(), and plr_report::update_report().
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().
Either controlling or observing.
Definition at line 1381 of file client_main.c.
Referenced by center_on_something(), city_model_fill(), city_model_fill_depr(), city_model_get(), city_store_fill(), client_remove_unit(), collect_production_targets(), editor_apply_tool(), editor_grab_applied_player(), editor_grab_tool(), fill_row(), find_nearest_unit(), get_bulbs_per_turn(), handle_endgame_player(), handle_page_msg(), handle_player_attribute_chunk(), handle_player_diplstate(), handle_start_phase(), handle_unit_packet_common(), handle_unit_remove(), key_editor_toggle_fogofwar(), meswin_add(), meswin_dialog_update(), city_model::populate(), popup_goto_dialog(), real_city_dialog_refresh(), real_menus_init(), mr_menu::save_image(), science_report_redraw(), set_client_state(), show_new_turn_info(), units_report_update(), update_goto_dialog(), units_reports::update_units(), and voteinfo_bar_can_be_shown().
Returns whether client is global observer
Definition at line 1362 of file client_main.c.
Referenced by city_packet_common(), col_government(), create_city_dialog(), units_select::create_pixmap(), draw_trade_routes(), editbar_player_pov_combobox_changed(), editor_apply_tool(), get_culture_info(), get_gold_info(), get_luxury_info(), get_researching_info(), get_science_info(), get_tax_info(), handle_worker_task(), mapimg_client_define(), mapimg_client_tile_known(), plr_widget::nation_selected(), observe_button_callback(), popup_info_text(), popup_spaceship_dialog(), qtg_science_report_dialog_popup(), refresh_player_pov_indicator(), science_report_init(), show_full_citybar(), show_small_citybar(), side_left_click_science(), side_right_click_diplomacy(), fc_client::slot_pregame_observe(), switch_city_callback(), fc_client::update_buttons(), fc_sidewidget::update_final_pixmap(), update_intel_dialog(), fc_client::update_sidebar_tooltips(), update_start_page_buttons(), usdlg_data_new(), and usdlg_get_unit_descr().
Returns whether client is observer.
Definition at line 1095 of file client_main.c.
Referenced by attribute_flush(), can_client_change_view(), can_client_control(), can_intel_with_player(), client_tile_get_known(), create_city_dialog(), city_dialog::disband_state_changed(), enqueue_call(), handle_event(), handle_start_phase(), key_press_map_canvas(), key_press_map_canvas(), mr_menu::menus_sensitive(), production_widget::prod_selected(), qtg_init_meeting(), real_city_dialog_refresh(), redraw_unit_info_label(), set_client_state(), show_new_turn_info(), side_rates_wdg(), side_right_click_diplomacy(), side_right_click_science(), fc_client::slot_pregame_observe(), switch_city_callback(), gov_menu::update(), mr_menu::update_airlift_menu(), mr_menu::update_bases_menu(), fc_client::update_buttons(), city_dialog::update_buy_button(), update_info_label(), science_report::update_report(), mr_menu::update_roads_menu(), update_start_page_buttons(), and voteinfo_bar_can_be_shown().
Entry point for common client code.
Definition at line 355 of file client_main.c.
Referenced by main().
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().
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().
Returns number of player attached to client.
Definition at line 1370 of file client_main.c.
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().
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().
enum client_states client_state | ( | void | ) |
Return current client state.
Mostly a client stub.
Definition at line 1038 of file client_main.c.
Referenced by apply_taxrates_callback(), boot_help_texts(), button_down_on_map(), button_up_on_map(), can_client_change_view(), can_client_issue_orders(), client_exit(), diplo_wdg::closeEvent(), control_mouse_cursor(), create_races_dialog(), disable_main_widgets(), enable_main_widgets(), finger_down_on_map(), finger_up_on_map(), flush_dirty(), flush_rect(), global_worklists_load(), gui_flush(), handle_event(), handle_research_info(), inputline_return(), map_view::keyPressEvent(), main_key_down_handler(), main_key_down_handler(), map_event_handler(), map_event_handler(), mr_menu::menus_sensitive(), musicspec_reread_callback(), option_dialog_new(), play_single_track(), popdown_all_game_dialogs(), popup_goto_dialog(), qtg_real_output_window_append(), races_dialog::races_dialog(), real_conn_list_dialog_update(), real_menus_init(), real_menus_update(), real_resize_window_callback(), real_timer_callback(), resize_minimap(), fc_game_tab_widget::resizeEvent(), minimap_view::resizeEvent(), chat_listener::send_chat_message(), start_style_music(), thaw(), themespec_reread(), tilespec_reread(), tilespec_reread_callback(), update_unit_info_label(), and update_unit_pix_label().
Do the initial default tileset selection.
Definition at line 327 of file client_main.c.
Referenced by client_main(), and qtg_ui_main().
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().
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 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().
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().
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().
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.
Definition at line 1078 of file client_main.c.
void send_report_request | ( | enum report_type | type | ) |
Send request for some report to server
Definition at line 847 of file client_main.c.
Referenced by main_key_down_handler(), main_key_down_handler(), report_achievements_callback(), report_achievements_callback(), report_demographic_callback(), report_demographic_callback(), report_top_cities_callback(), report_top_cities_callback(), report_wow_callback(), report_wow_callback(), mr_menu::slot_achievements(), mr_menu::slot_demographics(), mr_menu::slot_top_cities(), and mr_menu::slot_traveler().
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().
void set_client_state | ( | enum client_states | newstate | ) |
Change client state.
Definition at line 855 of file client_main.c.
Referenced by activate_gui(), close_socket_nomessage(), fc_client::fc_main(), handle_conn_info(), handle_endgame_report(), handle_server_join_reply(), handle_start_phase(), ui_main(), and ui_main().
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().
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().
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 waiting of the server turn change activities.
Definition at line 1147 of file client_main.c.
Referenced by handle_end_turn().
Server is responsive again
Definition at line 1160 of file client_main.c.
Referenced by disconnect_from_server(), and handle_begin_turn().
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().
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 until server has responsed to given request id.
Definition at line 1086 of file client_main.c.
Referenced by wait_for_requests().
|
extern |
Definition at line 150 of file client_main.c.
Referenced by client_main(), handle_server_join_reply(), and set_client_state().
|
extern |
Definition at line 151 of file client_main.c.
Referenced by client_main(), and set_client_state().
|
extern |
Definition at line 147 of file client_main.c.
Referenced by cancel_passwd_callback(), connect_callback(), convert_first_passwd_callback(), convert_passwd_callback(), convert_second_passwd_callback(), fc_client::handle_authentication_req(), handle_authentication_req(), send_passwd_callback(), and fc_client::slot_connect().
Definition at line 162 of file gui_main.c.
Referenced by client_main().
Definition at line 163 of file gui_main.c.
Referenced by client_main().
|
extern |
Definition at line 138 of file client_main.c.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 148 of file client_main.c.
Referenced by client_main().
|
extern |
Definition at line 144 of file client_main.c.
Referenced by audio_restart(), client_main(), handle_ruleset_control(), popup_musicset_suggestion_dialog(), popup_soundset_suggestion_dialog(), soundset_suggestion_callback(), and soundset_suggestion_response().
|
extern |
Definition at line 140 of file client_main.c.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 139 of file client_main.c.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 145 of file client_main.c.
Referenced by client_main(), connect_callback(), connect_callback(), convert_servername_callback(), popup_join_game_dialog(), select_meta_servers_callback(), fc_client::slot_connect(), start_autoconnecting_to_server(), fc_client::switch_page(), try_to_autoconnect(), and update_network_page().
|
extern |
Definition at line 149 of file client_main.c.
Referenced by client_main(), connect_callback(), connect_callback(), convert_portnr_callback(), popup_join_game_dialog(), select_meta_servers_callback(), fc_client::slot_connect(), start_autoconnecting_to_server(), fc_client::switch_page(), try_to_autoconnect(), and update_network_page().
|
extern |
Definition at line 142 of file client_main.c.
Referenced by audio_restart(), and client_main().
|
extern |
Definition at line 143 of file client_main.c.
Referenced by audio_restart(), client_main(), handle_ruleset_control(), musicset_suggestion_callback(), musicset_suggestion_response(), musicspec_reread_callback(), popup_musicset_suggestion_dialog(), and popup_soundset_suggestion_dialog().
|
extern |
Definition at line 146 of file client_main.c.
Referenced by client_main(), client_start_server(), conn_by_user(), conn_by_user_prefix(), connect_callback(), connect_callback(), convert_playername_callback(), popup_join_game_dialog(), fc_client::slot_connect(), start_autoconnecting_to_server(), fc_client::switch_page(), try_to_autoconnect(), and update_network_page().
|
extern |
Definition at line 159 of file client_main.c.
Referenced by send_turn_done(), and update_turn_done_button_state().