Crossfire Client, Trunk
|
Go to the source code of this file.
Data Structures | |
struct | mbuf |
Functions | |
static size_t | mbuf_write (void *contents, size_t size, size_t nmemb, void *userp) |
static bool | ms_check_version (Meta_Info *server) |
void | ms_fetch (ms_callback callback) |
static bool | ms_fetch_server (const char *metaserver2, ms_callback callback) |
void | ms_init () |
static void | parse_meta (char inbuf[static 1], ms_callback callback) |
Variables | |
static const char * | metaservers [] |
Deals with contacting the metaserver, getting a list of hosts, displaying and returning them to calling function, and then connecting to the server when requested.
Definition in file metaserver.c.
|
static |
Curl write callback function for downloading data into memory instead of a file. Copied from Curl's 'getinmemory.c' example under the MIT License.
Definition at line 55 of file metaserver.c.
References mbuf::memory, and mbuf::size.
Referenced by ms_fetch_server().
|
static |
This checks the servers sc_version and cs_version to see if they are compatible.
entry | entry number in the metaservers array to check. |
Definition at line 85 of file metaserver.c.
References Meta_Info::cs_version, Meta_Info::sc_version, VERSION_CS, and VERSION_SC.
Referenced by parse_meta().
void ms_fetch | ( | ms_callback | callback | ) |
Fetch a list of servers from the built-in official metaservers.
Because this function can query multiple metaservers, the same servers may be listed multiple times in the results.
Definition at line 269 of file metaserver.c.
References metaservers, and ms_fetch_server().
Referenced by main(), and server_fetch().
|
static |
Fetch a list of servers from the given URL.
metaserver2 |
Definition at line 223 of file metaserver.c.
References mbuf_write(), mbuf::memory, parse_meta(), and mbuf::size.
Referenced by ms_fetch().
void ms_init | ( | ) |
Initialize metaserver client. This function should be called before any other metaserver functions.
Definition at line 257 of file metaserver.c.
Referenced by client_init(), and main().
|
static |
Definition at line 118 of file metaserver.c.
References Meta_Info::archbase, Meta_Info::codebase, Meta_Info::cs_version, EPORT, Meta_Info::flags, Meta_Info::hostname, Meta_Info::html_comment, Meta_Info::idle_time, Meta_Info::in_bytes, Meta_Info::mapbase, ms_check_version(), MS_LARGE_BUF, Meta_Info::num_players, Meta_Info::out_bytes, Meta_Info::port, Meta_Info::sc_version, Meta_Info::text_comment, Meta_Info::uptime, and Meta_Info::version.
Referenced by ms_fetch_server().
|
static |
Definition at line 37 of file metaserver.c.
Referenced by ms_fetch().