Freeciv-3.1
Loading...
Searching...
No Matches
Functions | Variables
meta.c File Reference
#include "fc_prehdrs.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fcintl.h"
#include "fcthread.h"
#include "log.h"
#include "mem.h"
#include "netintf.h"
#include "netfile.h"
#include "support.h"
#include "timing.h"
#include "capstr.h"
#include "connection.h"
#include "dataio.h"
#include "game.h"
#include "map.h"
#include "version.h"
#include "console.h"
#include "plrhand.h"
#include "settings.h"
#include "srv_main.h"
#include "meta.h"

Go to the source code of this file.

Functions

const char * default_meta_patches_string (void)
 
const char * default_meta_message_string (void)
 
const char * get_meta_patches_string (void)
 
const char * get_meta_message_string (void)
 
const char * get_user_meta_message_string (void)
 
void maybe_automatic_meta_message (const char *automatic)
 
void set_meta_patches_string (const char *string)
 
void set_meta_message_string (const char *string)
 
void set_user_meta_message_string (const char *string)
 
char * meta_addr_port (void)
 
void server_close_meta (void)
 
bool server_open_meta (bool persistent)
 
bool is_metaserver_open (void)
 
bool send_server_info_to_metaserver (enum meta_flag flag)
 

Variables

static bool server_is_open = FALSE
 
static bool persistent_meta_connection = FALSE
 
static int meta_retry_wait = 0
 
static char meta_patches [256] = ""
 
static char meta_message [256] = ""
 

Function Documentation

◆ default_meta_message_string()

const char * default_meta_message_string ( void  )

Return static string with default info line to send to metaserver.

Definition at line 90 of file meta.c.

Referenced by establish_new_connection(), server_open_meta(), set_user_meta_message_string(), srv_prepare(), and write_init_script().

◆ default_meta_patches_string()

const char * default_meta_patches_string ( void  )

The default metaserver patches for this server

Definition at line 82 of file meta.c.

Referenced by server_open_meta(), sg_load_game(), sg_load_game(), and write_init_script().

◆ get_meta_message_string()

const char * get_meta_message_string ( void  )

The metaserver message

Definition at line 114 of file meta.c.

Referenced by send_lanserver_response(), and write_init_script().

◆ get_meta_patches_string()

const char * get_meta_patches_string ( void  )

The metaserver patches

Definition at line 106 of file meta.c.

Referenced by sg_save_game(), and write_init_script().

◆ get_user_meta_message_string()

const char * get_user_meta_message_string ( void  )

The metaserver message set by user

Definition at line 136 of file meta.c.

Referenced by maybe_automatic_meta_message().

◆ is_metaserver_open()

bool is_metaserver_open ( void  )

Are we sending info to the metaserver?

Definition at line 482 of file meta.c.

Referenced by metaconnection_command(), metamessage_action(), metamessage_command(), and metapatches_command().

◆ maybe_automatic_meta_message()

void maybe_automatic_meta_message ( const char *  automatic)

Update meta message. Set it to user meta message, if it is available. Otherwise use provided message. It is ok to call this with NULL message. Then it only replaces current meta message with user meta message if available.

Definition at line 151 of file meta.c.

Referenced by establish_new_connection(), and srv_prepare().

◆ meta_addr_port()

char * meta_addr_port ( void  )

Return string describing both metaserver name and port.

Definition at line 202 of file meta.c.

Referenced by close_metaserver_connection(), metaserver_command(), open_metaserver_connection(), sg_save_game(), srv_prepare(), and write_init_script().

◆ send_server_info_to_metaserver()

bool send_server_info_to_metaserver ( enum meta_flag  flag)

◆ server_close_meta()

void server_close_meta ( void  )

Stop sending updates to metaserver

Definition at line 454 of file meta.c.

Referenced by close_connections_and_socket(), and close_metaserver_connection().

◆ server_open_meta()

bool server_open_meta ( bool  persistent)

Lookup the correct address for the metaserver.

Definition at line 463 of file meta.c.

Referenced by open_metaserver_connection(), and srv_prepare().

◆ set_meta_message_string()

void set_meta_message_string ( const char *  string)

Set the metaserver message string

Definition at line 179 of file meta.c.

Referenced by maybe_automatic_meta_message(), server_open_meta(), server_sniff_all_input(), and set_user_meta_message_string().

◆ set_meta_patches_string()

void set_meta_patches_string ( const char *  string)

Set the metaserver patches string

Definition at line 171 of file meta.c.

Referenced by metapatches_command(), server_open_meta(), sg_load_game(), and sg_load_game().

◆ set_user_meta_message_string()

void set_user_meta_message_string ( const char *  string)

Set user defined metaserver message string

Definition at line 187 of file meta.c.

Referenced by metamessage_action(), and metamessage_command().

Variable Documentation

◆ meta_message

char meta_message[256] = ""
static

Definition at line 73 of file meta.c.

Referenced by get_meta_message_string(), server_open_meta(), and set_meta_message_string().

◆ meta_patches

char meta_patches[256] = ""
static

Definition at line 72 of file meta.c.

Referenced by get_meta_patches_string(), server_open_meta(), and set_meta_patches_string().

◆ meta_retry_wait

int meta_retry_wait = 0
static

Definition at line 70 of file meta.c.

Referenced by send_server_info_to_metaserver(), and server_open_meta().

◆ persistent_meta_connection

bool persistent_meta_connection = FALSE
static

Definition at line 69 of file meta.c.

Referenced by server_close_meta(), and server_open_meta().

◆ server_is_open

bool server_is_open = FALSE
static