Freeciv21
Develop your civilization from humble roots to a global empire
connection Struct Reference

#include <connection.h>

+ Collaboration diagram for connection:

Public Attributes

int id
 
QIODevice * sock = nullptr
 
bool used
 
bool established
 
struct packet_header packet_header
 
QString closing_reason
 
bool observer
 
struct playerplaying
 
struct socket_packet_bufferbuffer
 
struct socket_packet_buffersend_buffer
 
class civtimerlast_write
 
double ping_time
 
struct conn_list * self
 
char username [MAX_LEN_NAME]
 
QString addr
 
char capability [MAX_LEN_CAPSTR]
 
enum cmdlevel access_level
 
void(* notify_of_writable_data )(struct connection *pc, bool data_available_and_socket_full)
 
union {
   struct {
      int   last_request_id_used
 
      int   last_processed_request_id_seen
 
      int   request_id_of_currently_handled_packet
 
   }   client
 
   struct {
      int   currently_processed_request_id
 
      int   last_request_id_seen
 
      QList< civtimer * > *   ping_timers
 
      int   auth_tries
 
      time_t   auth_settime
 
      enum auth_status   status
 
      char   password [MAX_LEN_PASSWORD]
 
      char   ipaddr [MAX_LEN_ADDR]
 
      enum cmdlevel   granted_access_level
 
      struct conn_pattern_list *   ignore_list
 
      bool   is_closing
 
      struct {
         bool   status
 
         struct player *   playing
 
         bool   observer
 
      }   delegation
 
   }   server
 
}; 
 
void(* incoming_packet_notify )(struct connection *pc, int packet_type, int size)
 
void(* outgoing_packet_notify )(struct connection *pc, int packet_type, int size, int request_id)
 
struct {
   struct genhash **   sent
 
   struct genhash **   received
 
   const struct packet_handlers *   handlers
 
phs
 
struct {
   int   frozen_level
 
   struct byte_vector   queue
 
compression
 
struct {
   int   bytes_send
 
statistics
 

Detailed Description

Definition at line 127 of file connection.h.

Member Data Documentation

◆ 

union { ... }

◆ access_level

◆ addr

◆ auth_settime

time_t connection::auth_settime

Definition at line 199 of file connection.h.

◆ auth_tries

int connection::auth_tries

Definition at line 194 of file connection.h.

◆ buffer

◆ bytes_send

int connection::bytes_send

Definition at line 256 of file connection.h.

Referenced by connection_common_init(), connection_send_data(), and send_packet_data().

◆ capability

◆ 

◆ closing_reason

QString connection::closing_reason

Definition at line 133 of file connection.h.

Referenced by conn_description(), connection_close(), and server_make_connection().

◆ 

◆ currently_processed_request_id

int connection::currently_processed_request_id

Definition at line 184 of file connection.h.

◆ 

struct { ... } connection::delegation

◆ established

◆ frozen_level

int connection::frozen_level

◆ granted_access_level

enum cmdlevel connection::granted_access_level

Definition at line 207 of file connection.h.

◆ handlers

const struct packet_handlers* connection::handlers

◆ id

◆ ignore_list

struct conn_pattern_list* connection::ignore_list

Definition at line 213 of file connection.h.

◆ incoming_packet_notify

void(* connection::incoming_packet_notify) (struct connection *pc, int packet_type, int size)

◆ ipaddr

char connection::ipaddr[MAX_LEN_ADDR]

Definition at line 207 of file connection.h.

Referenced by kick_command().

◆ is_closing

bool connection::is_closing

Definition at line 217 of file connection.h.

◆ last_processed_request_id_seen

int connection::last_processed_request_id_seen

Definition at line 175 of file connection.h.

◆ last_request_id_seen

int connection::last_request_id_seen

Definition at line 187 of file connection.h.

◆ last_request_id_used

int connection::last_request_id_used

Definition at line 172 of file connection.h.

◆ last_write

class civtimer* connection::last_write

◆ notify_of_writable_data

void(* connection::notify_of_writable_data) (struct connection *pc, bool data_available_and_socket_full)

◆ observer

◆ outgoing_packet_notify

void(* connection::outgoing_packet_notify) (struct connection *pc, int packet_type, int size, int request_id)

Definition at line 242 of file connection.h.

Referenced by make_connection(), send_packet_data(), and server_make_connection().

◆ packet_header

◆ password

char connection::password[MAX_LEN_PASSWORD]

Definition at line 204 of file connection.h.

◆ 

◆ ping_time

double connection::ping_time

Definition at line 148 of file connection.h.

Referenced by handle_conn_info(), handle_conn_pong(), and server_make_connection().

◆ ping_timers

QList<civtimer *>* connection::ping_timers

Definition at line 191 of file connection.h.

◆ playing

struct player* connection::playing

Definition at line 142 of file connection.h.

Referenced by trade_generator::add_all_cities(), freeciv::improvement_seller::add_to_menu(), away_command(), blink_turn_done_button(), can_client_change_view(), can_client_control(), can_conn_edit(), can_conn_edit_players_nation(), can_end_turn(), can_meet_with_player(), center_on_something(), chat_msg_to_allies(), chat_msg_to_player(), cma_yoloswag::check_city(), city_can_buy(), city_packet_common(), client_game_free(), client_game_init(), client_government_sprite(), client_has_player(), client_is_global_observer(), client_player(), client_player_maps_reset(), client_player_number(), client_remove_cli_conn(), client_research_sprite(), client_tile_get_known(), clipboard_copy_production(), clipboard_paste_production(), close_connection(), close_socket_nomessage(), cmp_love(), col_diplstate(), col_embassy(), col_love(), col_vision(), conn_controls_player(), conn_description(), conn_get_access(), conn_is_global_observer(), connection_attach_real(), connection_delegate_restore(), connection_delegate_take(), connection_detach(), control_mouse_cursor(), units_select::create_pixmap(), cut_client_connection(), detach_command(), diplstate_value(), disband_all_units(), do_map_click(), do_move_unit(), do_unit_patrol_to(), establish_new_connection(), freeciv::layer_grid::fill_sprite_array(), find_best_focus_candidate(), find_city_or_settler_near_tile(), find_visible_unit(), form_chat_name(), city_widget::gen_production_labels(), get_act_sel_action_custom_text(), city_dialog::get_city(), get_city_mapview_name_and_growth(), get_economy_report_data(), get_economy_report_units_data(), get_info_label_text(), get_info_label_text_popup(), get_score_text(), get_tile_output_text(), get_tooltip(), get_tooltip_improvement(), get_tooltip_unit(), get_turn_done_button_state(), get_units_upgrade_info(), get_units_waiting_data(), handle_chat_msg_req(), handle_city_info(), handle_conn_info(), handle_diplomacy_init_meeting(), handle_event(), handle_new_year(), handle_player_info(), handle_player_remove(), handle_report_req(), handle_start_phase(), handle_tile_info(), handle_unit_action_answer(), handle_unit_action_query(), handle_unit_bombard_info(), handle_unit_combat_info(), handle_unit_get_actions(), handle_unit_packet_common(), handle_unit_short_info(), handle_worker_task(), has_player_unit_type(), diplo_dlg::init(), is_any_city_dialog_open(), freeciv::upkeep_widget::item_double_clicked(), mapimg_client_define(), meswin_popup_city(), research_diagram::mouseMoveEvent(), multiairlift(), races_dialog::nation_selected(), notify_goto::notify_goto(), observe_command(), freeciv::improvement_seller::operator()(), overview_tile_color(), package_conn_info(), pageGame::pageGame(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), national_budget_widget::paintEvent(), popup_info_text(), popup_revolution_dialog(), cma_yoloswag::put_city_under_agent(), quickselect(), races_dialog::races_dialog(), real_science_report_dialog_update(), national_budget_dialog::refresh(), freeciv::upkeep_widget::refresh(), pageGame::reloadSidebarIcons(), report_achievements(), report_demographics(), request_unit_unload(), restore_access_level(), governor::run(), science_dialog_text(), sell_all_improvements(), send_delegation_info(), send_diplomatic_meetings(), server_make_connection(), server_packet_input(), set_government_choice(), 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(), show_new_turn_info(), mr_menu::slot_spaceship(), spy_steal_shared(), start_command(), start_style_music(), take_command(), top_bar_right_click_diplomacy(), unit_focus_add(), unit_focus_advance(), unit_focus_set(), unit_focus_update(), gov_menu::update(), unit_actions::update_actions(), mr_menu::update_airlift_menu(), city_dialog::update_buy_button(), city_dialog::update_disabled(), city_dialog::update_prod_buttons(), ss_report::update_report(), plr_report::update_report(), city_dialog::update_units(), pageGame::updateInfoLabelTimeout(), pageGame::updateSidebarTooltips(), upgrade_canvas_clipboard(), and wakeup_sentried_units().

◆ queue

struct byte_vector connection::queue

◆ received

struct genhash** connection::received

Definition at line 246 of file connection.h.

Referenced by conn_reset_delta_state(), free_packet_hashes(), and init_packet_hashs().

◆ request_id_of_currently_handled_packet

int connection::request_id_of_currently_handled_packet

Definition at line 179 of file connection.h.

◆ self

◆ send_buffer

◆ sent

struct genhash** connection::sent

Definition at line 245 of file connection.h.

Referenced by conn_reset_delta_state(), free_packet_hashes(), and init_packet_hashs().

◆ 

◆ sock

◆ 

struct { ... } connection::statistics

◆ status [1/2]

enum auth_status connection::status

Definition at line 199 of file connection.h.

Referenced by script_server_do_file_shared(), and script_server_do_string_shared().

◆ status [2/2]

bool connection::status

Definition at line 222 of file connection.h.

◆ used

◆ username