![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "packets.h"
Include dependency graph for client_main.h:Go to the source code of this file.
Classes | |
| struct | civclient |
Macros | |
| #define | TIMER_INTERVAL (int) (real_timer_callback() * 1000) |
Enumerations | |
| enum | client_states { C_S_INITIAL , C_S_DISCONNECTED , C_S_PREPARING , C_S_RUNNING , C_S_OVER } |
Functions | |
| int | client_main (int argc, char *argv[]) |
| Entry point for common client code. More... | |
| void | client_packet_input (void *packet, int type) |
| Handle packet received from server. More... | |
| void | send_report_request (enum report_type type) |
| Send request for some report to server. More... | |
| void | send_attribute_block_request () |
| Send attribute block. More... | |
| void | send_turn_done () |
| Send information about player having finished his/her turn to server. More... | |
| void | user_ended_turn () |
| Handle user ending his/her turn. More... | |
| void | set_client_state (enum client_states newstate) |
| Change client state. More... | |
| enum client_states | client_state () |
| Return current client state. More... | |
| void | set_server_busy (bool busy) |
| Sets if server is considered busy. More... | |
| bool | is_server_busy () |
| Returns if server is considered busy at the moment. More... | |
| void | client_remove_cli_conn (struct connection *pconn) |
| Remove pconn from all connection lists in client, then free it. More... | |
| void | client_remove_all_cli_conn () |
| Remove (and free) all connections from all connection lists in client. More... | |
| QUrl & | client_url () |
| Returns the URL that this client connects to. More... | |
| bool | client_is_observer () |
| Returns whether client is observer. More... | |
| bool | client_is_global_observer () |
| Returns whether client is global observer. More... | |
| int | client_player_number () |
| Returns number of player attached to client. More... | |
| bool | client_has_player () |
| Either controlling or observing. More... | |
| struct player * | client_player () |
| Either controlling or observing. More... | |
| 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. More... | |
| void | set_miliseconds_to_turndone (int miliseconds) |
| Reset the number of seconds to turndone from an "authentic" source. More... | |
| int | get_seconds_to_turndone () |
| Return the number of seconds until turn-done. More... | |
| bool | is_waiting_turn_change () |
| Are we in turn-change wait state? More... | |
| void | start_turn_change_wait () |
| Start waiting of the server turn change activities. More... | |
| void | stop_turn_change_wait () |
| Server is responsive again. More... | |
| int | get_seconds_to_new_turn () |
| Return the number of seconds until turn-done. More... | |
| double | real_timer_callback () |
| This function should be called at least once per second. More... | |
| bool | can_client_control () |
| Returns TRUE iff the client can control player. More... | |
| bool | can_client_issue_orders () |
| Returns TRUE iff the client can issue orders (such as giving unit commands). More... | |
| bool | can_client_change_view () |
| Return TRUE if the client can change the view; i.e. More... | |
| bool | can_meet_with_player (const struct player *pplayer) |
| Returns TRUE iff the client can do diplomatic meetings with another given player. More... | |
| void | client_exit () |
| Main client execution stop function. More... | |
| bool | is_client_quitting () |
| Is the client marked as one going down? More... | |
| void | start_quitting () |
| Mark client as one going to quit as soon as possible,. More... | |
Variables | |
| QString | logfile |
| QString | scriptfile |
| QString | savefile |
| QString | sound_plugin_name |
| QString | sound_set_name |
| QString | music_set_name |
| QString | cmd_metaserver |
| 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 TIMER_INTERVAL (int) (real_timer_callback() * 1000) |
Definition at line 26 of file client_main.h.
| enum client_states |
| Enumerator | |
|---|---|
| C_S_INITIAL | |
| C_S_DISCONNECTED | |
| C_S_PREPARING | |
| C_S_RUNNING | |
| C_S_OVER | |
Definition at line 39 of file client_main.h.
| bool can_client_change_view | ( | ) |
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 1177 of file client_main.cpp.
Referenced by action_button_pressed(), calculate_overview_dimensions(), center_on_something(), city_packet_common(), client_cooling_sprite(), client_government_sprite(), client_research_sprite(), client_state(), client_warming_sprite(), 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(), map_canvas_resized(), meswin_dialog_update(), overview_update_tile(), recenter_button_pressed(), refresh_overview_canvas(), request_toggle_city_buycost(), 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_map_borders(), request_toggle_map_grid(), request_toggle_map_native(), request_unit_select(), unit_focus_add(), unit_focus_advance(), unit_focus_set(), unit_focus_update(), and update_map_canvas_visible().
| bool can_client_control | ( | ) |
Returns TRUE iff the client can control player.
Definition at line 1146 of file client_main.cpp.
Referenced by can_client_issue_orders(), draw_calculated_trade_routes(), page_pregame::slot_pregame_start(), page_pregame::update_buttons(), and voteinfo_do_vote().
| bool can_client_issue_orders | ( | ) |
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 1156 of file client_main.cpp.
Referenced by action_decision_request(), freeciv::improvement_seller::add_to_menu(), adjust_workers_button_pressed(), city_dialog::buy(), can_end_turn(), can_meet_with_player(), city_can_buy(), city_packet_common(), city_dialog::city_rename(), city_dialog::clear_worklist(), clipboard_copy_production(), clipboard_paste_production(), city_dialog::cma_double_clicked(), science_report::current_tech_changed(), disband_all_units(), city_widget::display_list_menu(), city_dialog::display_worklist_menu(), do_disband_alternative(), do_map_click(), science_report::goal_tech_changed(), handle_city_name_suggestion_info(), handle_city_sabotage_list(), diplo_dlg::init(), freeciv::upkeep_widget::item_double_clicked(), maybe_activate_keyboardless_goto(), mr_menu::menus_sensitive(), city_label::mousePressEvent(), plr_widget::mousePressEvent(), research_diagram::mousePressEvent(), freeciv::improvement_seller::operator()(), popup_multiplier_dialog(), science_report::push_research(), request_new_unit_activity_targeted(), request_orders_cleared(), request_unit_load(), request_unit_unload(), unit_list_widget::selected_playable_units(), sell_all_improvements(), set_government_choice(), spaceship_autoplace(), city_dialog::update_disabled(), city_dialog::update_prod_buttons(), plr_report::update_report(), upgrade_canvas_clipboard(), wakeup_button_pressed(), and wakeup_sentried_units().
| bool can_meet_with_player | ( | const struct player * | pplayer | ) |
Returns TRUE iff the client can do diplomatic meetings with another given player.
Definition at line 1165 of file client_main.cpp.
Referenced by plr_report::update_report().
| void client_exit | ( | ) |
Main client execution stop function.
This calls ui_exit() and not the other way around.
Definition at line 658 of file client_main.cpp.
Referenced by client_main().
| bool client_has_player | ( | ) |
Either controlling or observing.
Definition at line 1225 of file client_main.cpp.
Referenced by center_on_something(), client_remove_unit(), client_state(), collect_production_targets(), editor_apply_tool(), editor_grab_applied_player(), editor_grab_tool(), find_nearest_unit(), get_bulbs_per_turn(), get_units_view_data(), handle_endgame_player(), handle_page_msg(), handle_player_attribute_chunk(), handle_player_diplstate(), handle_start_phase(), handle_unit_packet_common(), handle_unit_remove(), meswin_add(), city_model::populate(), popup_goto_dialog(), mr_menu::save_image(), and show_new_turn_info().
| bool client_is_global_observer | ( | ) |
Returns whether client is global observer.
Definition at line 1206 of file client_main.cpp.
Referenced by city_packet_common(), units_select::create_pixmap(), draw_trade_routes(), editor_apply_tool(), handle_research_info(), handle_worker_task(), is_any_city_dialog_open(), mapimg_client_define(), plr_widget::nation_selected(), simple_citybar_painter::paint(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), national_budget_widget::paintEvent(), indicators_widget::paintEvent(), gold_widget::paintEvent(), popup_info_text(), popup_spaceship_dialog(), real_science_report_dialog_update(), science_report_dialog_popup(), national_budget_widget::sizeHint(), indicators_widget::sizeHint(), page_pregame::slot_pregame_observe(), top_bar_left_click_science(), top_bar_right_click_diplomacy(), page_pregame::update_buttons(), and pageGame::updateSidebarTooltips().
| bool client_is_observer | ( | ) |
Returns whether client is observer.
Definition at line 999 of file client_main.cpp.
Referenced by attribute_flush(), can_client_change_view(), can_client_control(), client_state(), client_tile_get_known(), city_dialog::disband_state_changed(), handle_diplomacy_init_meeting(), handle_event(), handle_start_phase(), is_any_city_dialog_open(), mr_menu::menus_sensitive(), mr_menu::nonunit_sensitivity(), pageGame::popup_budget_dialog(), production_widget::prod_selected(), page_pregame::slot_pregame_observe(), top_bar_right_click_diplomacy(), top_bar_right_click_science(), gov_menu::update(), mr_menu::update_airlift_menu(), mr_menu::update_bases_menu(), page_pregame::update_buttons(), city_dialog::update_buy_button(), science_report::update_report(), and mr_menu::update_roads_menu().
| int client_main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Entry point for common client code.
Definition at line 302 of file client_main.cpp.
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 1236 of file client_main.cpp.
Referenced by fc_interface_init_client().
| void client_packet_input | ( | void * | packet, |
| int | type | ||
| ) |
Handle packet received from server.
Definition at line 699 of file client_main.cpp.
Referenced by input_from_server().
| struct player* client_player | ( | ) |
Either controlling or observing.
Definition at line 1230 of file client_main.cpp.
Referenced by trade_generator::add_tile(), diplo_wdg::all_advances(), attribute_flush(), attribute_restore(), city_dialog::buy(), center_next_enemy_city(), center_next_player_capital(), center_next_player_city(), center_on_something(), city_packet_common(), client_city_can_work_tile(), client_plr_tile_city_id_get(), client_remove_unit(), client_research_sprite(), client_state(), collect_eventually_buildable_targets(), collect_production_targets(), control_mouse_cursor(), cycle_enemy_units(), city_widget::display_list_menu(), do_disband_alternative(), draw_reqtree(), draw_trade_routes(), editor_apply_tool(), editor_grab_applied_player(), editor_grab_tool(), enter_goto_state(), freeciv::layer_grid::fill_sprite_array(), mr_menu::find_last_unit_pos(), find_nearest_unit(), get_act_sel_action_custom_text(), get_airlift_text(), get_bulbs_per_turn(), get_edge_type(), get_info_label_text_popup(), get_science_goal_text(), get_science_target_text(), get_units_upgrade_info(), get_units_view_data(), diplo_wdg::give_advance(), diplo_wdg::give_city(), handle_achievement_info(), handle_city_name_suggestion_info(), handle_city_sabotage_list(), handle_endgame_player(), handle_event(), handle_page_msg(), handle_player_attribute_chunk(), handle_player_diplstate(), handle_player_info(), handle_player_remove(), handle_research_info(), handle_spaceship_info(), handle_unit_action_answer(), handle_unit_packet_common(), handle_unit_remove(), unit_hud_selector::island_filter(), key_center_capital(), science_report::locate_goal(), science_report::locate_researching(), make_path_orders(), manual_turn_done_callback(), meswin_add(), research_diagram::mousePressEvent(), multipler_rates_dialog::multipler_rates_dialog(), plr_widget::nation_selected(), node_rectangle_minimum_size(), simple_citybar_painter::paint(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), pregame_options::pick_nation(), city_model::populate(), popup_bribe_dialog(), popup_incite_dialog(), popup_info_text(), science_report::push_research(), real_science_report_dialog_update(), request_units_return(), research_diagram::reset(), mr_menu::save_image(), science_dialog_text(), unit_hud_selector::select_units(), unit_list_widget::selected_playable_units(), send_rally_tile(), map_view::shortcut_pressed(), diplo_wdg::show_menu(), show_new_turn_info(), mr_menu::slot_execute_orders(), page_pregame::slot_pregame_start(), top_bar_right_click_science(), unit_hud_selector::uhs_select(), unit_description(), page_pregame::update_buttons(), pregame_options::update_buttons(), goto_dialog::update_dlg(), science_report::update_report(), plr_report::update_report(), pageGame::updateSidebarTooltips(), and units_view::upgrade_units().
| int client_player_number | ( | ) |
Returns number of player attached to client.
Definition at line 1214 of file client_main.cpp.
Referenced by diplo_wdg::diplo_wdg(), and editor_apply_tool().
| void client_remove_all_cli_conn | ( | ) |
Remove (and free) all connections from all connection lists in client.
Assumes game.all_connections is properly maintained with all connections.
Definition at line 973 of file client_main.cpp.
Referenced by client_exit(), and client_state().
| void client_remove_cli_conn | ( | struct connection * | pconn | ) |
Remove pconn from all connection lists in client, then free it.
Definition at line 955 of file client_main.cpp.
Referenced by client_remove_all_cli_conn(), and handle_conn_info().
| enum client_states client_state | ( | ) |
Return current client state.
Definition at line 762 of file client_main.cpp.
Referenced by can_client_change_view(), can_client_issue_orders(), client_current_nation_set(), client_exit(), diplo_wdg::closeEvent(), control_mouse_cursor(), fc_game_tab_widget::event(), game_music_enable_callback(), global_worklists_load(), handle_event(), handle_research_info(), map_view::keyPressEvent(), menu_music_enable_callback(), musicspec_reread_callback(), mr_menu::nonunit_sensitivity(), play_single_track(), popup_goto_dialog(), races_dialog::races_dialog(), real_menus_update(), real_timer_callback(), minimap_view::resizeEvent(), chat_listener::send_chat_message(), start_style_music(), tilespec_reread(), tilespec_reread_callback(), and pageGame::updateSidebarTooltips().
| QUrl& client_url | ( | ) |
Returns the URL that this client connects to.
Definition at line 986 of file client_main.cpp.
Referenced by client_start_server_and_set_page(), page_network::handle_authentication_req(), page_network::page_network(), page_network::slot_connect(), fc_client::start_from_file(), fc_client::start_new_game(), and fc_client::start_tutorial().
| int get_seconds_to_new_turn | ( | ) |
Return the number of seconds until turn-done.
Don't call this unless current_turn_timeout() != 0.
Definition at line 1077 of file client_main.cpp.
Referenced by turn_done_button::update_timeout_label().
| int get_seconds_to_turndone | ( | ) |
Return the number of seconds until turn-done.
Don't call this unless current_turn_timeout() != 0.
Definition at line 1063 of file client_main.cpp.
Referenced by turn_done_button::update_timeout_label().
| bool is_client_quitting | ( | ) |
Is the client marked as one going down?
Definition at line 1503 of file client_main.cpp.
Referenced by client_state().
| bool is_server_busy | ( | ) |
Returns if server is considered busy at the moment.
Definition at line 1201 of file client_main.cpp.
Referenced by can_end_turn(), and control_mouse_cursor().
| bool is_waiting_turn_change | ( | ) |
Are we in turn-change wait state?
Definition at line 1037 of file client_main.cpp.
Referenced by real_menus_update(), and turn_done_button::update_timeout_label().
| double real_timer_callback | ( | ) |
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 1084 of file client_main.cpp.
Referenced by fc_client::timerEvent().
| void send_attribute_block_request | ( | ) |
Send attribute block.
Definition at line 991 of file client_main.cpp.
| void send_report_request | ( | enum report_type | type | ) |
Send request for some report to server.
Definition at line 754 of file client_main.cpp.
Referenced by mr_menu::slot_achievements(), mr_menu::slot_demographics(), mr_menu::slot_top_five(), and mr_menu::slot_traveler().
| void send_turn_done | ( | ) |
Send information about player having finished his/her turn to server.
Definition at line 725 of file client_main.cpp.
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 762 of file client_main.cpp.
Referenced by close_socket_nomessage(), fc_client::fc_main(), handle_conn_info(), handle_endgame_report(), handle_server_join_reply(), and handle_start_phase().
| void set_miliseconds_to_turndone | ( | int | miliseconds | ) |
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 1022 of file client_main.cpp.
Referenced by handle_new_year(), and handle_timeout_info().
| void set_server_busy | ( | bool | busy | ) |
Sets if server is considered busy.
Currently it is considered busy between turns.
Definition at line 1187 of file client_main.cpp.
Referenced by client_state(), handle_end_turn(), handle_server_join_reply(), and handle_start_phase().
| void start_quitting | ( | ) |
Mark client as one going to quit as soon as possible,.
Definition at line 1508 of file client_main.cpp.
Referenced by popup_quit_dialog().
| void start_turn_change_wait | ( | ) |
Start waiting of the server turn change activities.
Definition at line 1042 of file client_main.cpp.
Referenced by handle_end_turn().
| void stop_turn_change_wait | ( | ) |
Server is responsive again.
Definition at line 1053 of file client_main.cpp.
Referenced by disconnect_from_server(), and handle_begin_turn().
| void user_ended_turn | ( | ) |
Handle user ending his/her turn.
Definition at line 720 of file client_main.cpp.
Referenced by handle_player_info(), handle_start_phase(), and manual_turn_done_callback().
|
extern |
Definition at line 132 of file client_main.cpp.
Referenced by client_main(), client_state(), and handle_server_join_reply().
|
extern |
Definition at line 134 of file client_main.cpp.
Referenced by client_main(), and client_state().
| struct civclient client |
|
extern |
Definition at line 131 of file client_main.cpp.
Referenced by begin_metaserver_scan(), client_main(), and meta_read_response().
|
extern |
Definition at line 47 of file gui_main.cpp.
Referenced by client_main().
|
extern |
Definition at line 46 of file gui_main.cpp.
Referenced by client_main().
|
extern |
Definition at line 124 of file client_main.cpp.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 130 of file client_main.cpp.
Referenced by audio_restart(), client_main(), handle_ruleset_control(), popup_musicset_suggestion_dialog(), and popup_soundset_suggestion_dialog().
|
extern |
Definition at line 126 of file client_main.cpp.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 125 of file client_main.cpp.
Referenced by client_main(), and client_start_server().
|
extern |
Definition at line 128 of file client_main.cpp.
Referenced by audio_restart(), and client_main().
|
extern |
Definition at line 129 of file client_main.cpp.
Referenced by audio_restart(), client_main(), handle_ruleset_control(), musicspec_reread_callback(), popup_musicset_suggestion_dialog(), and popup_soundset_suggestion_dialog().
|
extern |
Definition at line 142 of file client_main.cpp.
Referenced by send_turn_done(), and update_turn_done_button_state().