Freeciv21
Develop your civilization from humble roots to a global empire
clinet.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int connect_to_server (const QUrl &url, char *errbuf, int errbufsize)
 Connect to a freeciv21-server instance – or at least try to. More...
 
void make_connection (QIODevice *sock, const QString &username)
 Called after a connection is completed (e.g., in try_to_connect). More...
 
void input_from_server (QIODevice *sock)
 This function is called when the client received a new input from the server. More...
 
void disconnect_from_server ()
 Get rid of server connection. More...
 
double try_to_autoconnect (const QUrl &url)
 Make an attempt to autoconnect to the server. More...
 
void start_autoconnecting_to_server (const QUrl &url)
 Start trying to autoconnect to freeciv21-server. More...
 

Function Documentation

◆ connect_to_server()

int connect_to_server ( const QUrl &  url,
char *  errbuf,
int  errbufsize 
)

Connect to a freeciv21-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 167 of file clinet.cpp.

Referenced by client_start_server(), and page_network::slot_connect().

◆ disconnect_from_server()

void disconnect_from_server ( )

Get rid of server connection.

This also kills internal server if it's used.

Definition at line 219 of file clinet.cpp.

Referenced by mr_menu::back_to_menu(), client_packet_input(), fc_client::current_page(), popup_quit_dialog(), and fc_client::slot_disconnect().

◆ input_from_server()

void input_from_server ( QIODevice *  sock)

This function is called when the client received a new input from the server.

Definition at line 297 of file clinet.cpp.

Referenced by fc_client::add_server_source(), and fc_client::server_input().

◆ make_connection()

void make_connection ( QIODevice *  sock,
const QString &  username 
)

Called after a connection is completed (e.g., in try_to_connect).

Definition at line 188 of file clinet.cpp.

Referenced by try_to_connect().

◆ start_autoconnecting_to_server()

void start_autoconnecting_to_server ( const QUrl &  url)

Start trying to autoconnect to freeciv21-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 377 of file clinet.cpp.

Referenced by client_state().

◆ try_to_autoconnect()

double try_to_autoconnect ( const QUrl &  url)

Make an attempt to autoconnect to the server.

It returns number of seconds it should be called again.

Definition at line 339 of file clinet.cpp.

Referenced by real_timer_callback().