Freeciv-3.3
|
Go to the source code of this file.
Functions | |
int | connect_to_server (const char *username, const char *hostname, int port, char *errbuf, int errbufsize) |
void | make_connection (int socket, const char *username) |
void | input_from_server (int fd) |
void | input_from_server_till_request_got_processed (int fd, int expected_request_id) |
void | disconnect_from_server (bool leaving_sound) |
double | try_to_autoconnect (void) |
void | start_autoconnecting_to_server (void) |
int connect_to_server | ( | const char * | username, |
const char * | hostname, | ||
int | port, | ||
char * | errbuf, | ||
int | errbufsize | ||
) |
Connect to a freeciv-server instance – or at least try to. On success, return 0; on failure, put an error message in ERRBUF and return -1.
Definition at line 249 of file clinet.c.
Referenced by client_start_server(), connect_callback(), connect_callback(), and fc_client::slot_connect().
Get rid of server connection. This also kills internal server if it's used.
Definition at line 306 of file clinet.c.
Referenced by mr_menu::back_to_menu(), cancel_passwd_callback(), client_packet_input(), disconnect_callback(), disconnect_conn_callback(), exit_callback(), leave_callback(), leave_callback(), leave_local_game_response(), leave_local_game_response(), main_callback(), popup_quit_dialog(), quit_dialog_response(), quit_dialog_response(), fc_client::slot_disconnect(), and fc_client::switch_page().
This function is called when the client received a new input from the server.
Definition at line 411 of file clinet.c.
Referenced by get_net_input(), gui_event_loop(), gui_event_loop(), and fc_client::server_input().
This function will sniff at the given fd, get the packet and call client_packet_input. It will return if there is a network error or if the PACKET_PROCESSING_FINISHED packet for the given request is received.
Definition at line 447 of file clinet.c.
Referenced by wait_till_request_got_processed().
Called after a connection is completed (e.g., in try_to_connect).
Definition at line 275 of file clinet.c.
Referenced by try_to_connect().
Start trying to autoconnect to freeciv-server. Calls get_server_address(), then arranges for try_to_autoconnect(), which calls try_to_connect(), to be called roughly every AUTOCONNECT_INTERVAL milliseconds, until success, fatal error or user intervention.
Definition at line 553 of file clinet.c.
Referenced by set_client_state().
Make an attempt to autoconnect to the server. It returns number of seconds it should be called again.
Definition at line 498 of file clinet.c.
Referenced by gui_event_loop(), gui_event_loop(), and real_timer_callback().