Freeciv-3.1
|
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 (void) |
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 248 of file clinet.c.
Referenced by client_start_server(), connect_callback(), connect_callback(), and fc_client::slot_connect().
void disconnect_from_server | ( | void | ) |
Get rid of server connection. This also kills internal server if it's used.
Definition at line 305 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(), main_callback(), popup_quit_dialog(), quit_dialog_response(), fc_client::slot_disconnect(), and fc_client::switch_page().
void input_from_server | ( | int | fd | ) |
This function is called when the client received a new input from the server.
Definition at line 406 of file clinet.c.
Referenced by get_net_input(), gui_event_loop(), and fc_client::server_input().
void input_from_server_till_request_got_processed | ( | int | fd, |
int | expected_request_id | ||
) |
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 442 of file clinet.c.
Referenced by wait_till_request_got_processed().
void make_connection | ( | int | sock, |
const char * | username | ||
) |
Called after a connection is completed (e.g., in try_to_connect).
Definition at line 274 of file clinet.c.
Referenced by try_to_connect().
void start_autoconnecting_to_server | ( | void | ) |
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 547 of file clinet.c.
Referenced by set_client_state().
double try_to_autoconnect | ( | void | ) |
Make an attempt to autoconnect to the server. It returns number of seconds it should be called again.
Definition at line 492 of file clinet.c.
Referenced by gui_event_loop(), and real_timer_callback().