![]() |
Crossfire Client, Trunk
|
#include "client.h"#include <gtk/gtk.h>#include <stdbool.h>#include "image.h"#include "main.h"#include "metaserver.h"#include "gtk2proto.h"
Include dependency graph for metaserver.c:Go to the source code of this file.
Enumerations | |
| enum | { LIST_HOSTNAME, LIST_IPADDR, LIST_PLAYERS, LIST_VERSION, LIST_COMMENT } |
Functions | |
| static void | metaserver_connect_to (const char *name) |
| Connect to a server with the given hostname and optional port number. More... | |
| static void | metaserver_refresh (void) |
| void | metaserver_show_prompt () |
| Constructs the metaserver dialog and handles metaserver selection. More... | |
| void | metaserver_ui_init () |
| Initialize the metaserver user interface. More... | |
| void | on_button_metaserver_quit_pressed (GtkButton *button, gpointer user_data) |
| Quits the client application if the quit button is pressed. More... | |
| static void | on_button_refresh (GtkButton *button, gpointer user_data) |
| void | on_metaserver_select_clicked (GtkButton *button, gpointer user_data) |
| Establish a connection with the server when pressing the connect button. More... | |
| static gboolean | on_selection_changed () |
| Copy the selected server to the server entry box. More... | |
| static gboolean | on_server_entry_changed () |
| Activate the connect button and unselect servers if keys are pressed to enter a server name. More... | |
| static void | server_add (char *server, int update, int players, char *version, char *comment, bool compatible) |
| static bool | server_exists (const char *server) |
| Check if the given server is already in the server list. More... | |
| static gpointer | server_fetch () |
| Wrapper on top of ms_fetch() for a GThread. More... | |
Variables | |
| char * | last_server |
| static GtkWidget * | metaserver_button |
| static GtkWidget * | metaserver_entry |
| static GtkTreeSelection * | metaserver_selection |
| static GtkWidget * | metaserver_status |
| static GtkListStore * | store_metaserver |
| static GtkWidget * | treeview_metaserver |
Supports the client's metaserver dialog used to connect to available servers.
Definition in file metaserver.c.
| anonymous enum |
| Enumerator | |
|---|---|
| LIST_HOSTNAME | |
| LIST_IPADDR | |
| LIST_PLAYERS | |
| LIST_VERSION | |
| LIST_COMMENT | |
Definition at line 35 of file metaserver.c.
|
static |
Connect to a server with the given hostname and optional port number.
| name | The DNS name of a server to connect to. If the server operates on a non-standard port, a colon and the port number is appended to the DNS name. For example: localhost:8000 |
Definition at line 235 of file metaserver.c.
References client_connect(), cpl, csocket, ClientSocket::fd, Player_Struct::input_state, last_server, LOG(), LOG_DEBUG, metaserver_status, Playing, and save_defaults().
Referenced by on_metaserver_select_clicked().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 193 of file metaserver.c.
References metaserver_status, server_fetch(), store_metaserver, and treeview_metaserver.
Referenced by metaserver_show_prompt(), and on_button_refresh().
Here is the call graph for this function:
Here is the caller graph for this function:| void metaserver_show_prompt | ( | ) |
Constructs the metaserver dialog and handles metaserver selection.
If the player has a servers.cache file in their .crossfire folder, the cached server list is added to the contents of the metaserver dialog.
Definition at line 215 of file metaserver.c.
References cpl, Player_Struct::input_state, last_server, main_notebook, metaserver_button, metaserver_entry, metaserver_refresh(), Metaserver_Select, and on_server_entry_changed().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void metaserver_ui_init | ( | ) |
Initialize the metaserver user interface.
Definition at line 75 of file metaserver.c.
References dialog_xml, LIST_COMMENT, LIST_HOSTNAME, LIST_PLAYERS, LIST_VERSION, metaserver_button, metaserver_entry, metaserver_selection, metaserver_status, on_button_metaserver_quit_pressed(), on_button_refresh(), on_configure_activate(), on_metaserver_select_clicked(), on_selection_changed(), on_server_entry_changed(), store_metaserver, and treeview_metaserver.
Referenced by init_ui().
Here is the call graph for this function:
Here is the caller graph for this function:| void on_button_metaserver_quit_pressed | ( | GtkButton * | button, |
| gpointer | user_data | ||
| ) |
Quits the client application if the quit button is pressed.
This is also used to quit the client if the button's accelerator is pressed.
| button | |
| user_data |
Definition at line 281 of file metaserver.c.
References on_window_destroy_event().
Referenced by metaserver_ui_init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 206 of file metaserver.c.
References metaserver_refresh().
Referenced by metaserver_ui_init().
Here is the call graph for this function:
Here is the caller graph for this function:| void on_metaserver_select_clicked | ( | GtkButton * | button, |
| gpointer | user_data | ||
| ) |
Establish a connection with the server when pressing the connect button.
| button | |
| user_data |
Definition at line 267 of file metaserver.c.
References metaserver_connect_to(), and metaserver_entry.
Referenced by metaserver_ui_init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Copy the selected server to the server entry box.
Definition at line 44 of file metaserver.c.
References LIST_HOSTNAME, metaserver_button, metaserver_entry, and metaserver_selection.
Referenced by metaserver_ui_init().
Here is the caller graph for this function:
|
static |
Activate the connect button and unselect servers if keys are pressed to enter a server name.
Definition at line 62 of file metaserver.c.
References metaserver_button, metaserver_entry, and metaserver_selection.
Referenced by metaserver_show_prompt(), and metaserver_ui_init().
Here is the caller graph for this function:
|
static |
Definition at line 173 of file metaserver.c.
References LIST_COMMENT, LIST_HOSTNAME, LIST_IPADDR, LIST_PLAYERS, LIST_VERSION, cfmaplog::players, server_exists(), and store_metaserver.
Referenced by server_fetch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Check if the given server is already in the server list.
Definition at line 155 of file metaserver.c.
References LIST_HOSTNAME, and store_metaserver.
Referenced by server_add().
Here is the caller graph for this function:
|
static |
Wrapper on top of ms_fetch() for a GThread.
Definition at line 188 of file metaserver.c.
References ms_fetch(), and server_add().
Referenced by metaserver_refresh().
Here is the call graph for this function:
Here is the caller graph for this function:| char* last_server |
Definition at line 47 of file config.c.
Referenced by config_load(), metaserver_connect_to(), metaserver_show_prompt(), and save_defaults().
|
static |
Definition at line 30 of file metaserver.c.
Referenced by metaserver_show_prompt(), metaserver_ui_init(), on_selection_changed(), and on_server_entry_changed().
|
static |
Definition at line 31 of file metaserver.c.
Referenced by metaserver_show_prompt(), metaserver_ui_init(), on_metaserver_select_clicked(), on_selection_changed(), and on_server_entry_changed().
|
static |
Definition at line 33 of file metaserver.c.
Referenced by metaserver_ui_init(), on_selection_changed(), and on_server_entry_changed().
|
static |
Definition at line 31 of file metaserver.c.
Referenced by metaserver_connect_to(), metaserver_refresh(), and metaserver_ui_init().
|
static |
Definition at line 32 of file metaserver.c.
Referenced by metaserver_refresh(), metaserver_ui_init(), server_add(), and server_exists().
|
static |
Definition at line 30 of file metaserver.c.
Referenced by metaserver_refresh(), and metaserver_ui_init().