Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
settings.c File Reference
#include "astring.h"
#include "fcintl.h"
#include "game.h"
#include "ioz.h"
#include "log.h"
#include "registry.h"
#include "shared.h"
#include "string_vector.h"
#include "map.h"
#include "aiiface.h"
#include "gamehand.h"
#include "maphand.h"
#include "meta.h"
#include "nation.h"
#include "notify.h"
#include "plrhand.h"
#include "report.h"
#include "rscompat.h"
#include "rssanity.h"
#include "setcompat.h"
#include "srv_main.h"
#include "stdinhand.h"
#include "settings.h"

Go to the source code of this file.

Data Structures

struct  setting
 

Macros

#define settings_snprintf(_buf, _buf_len, format, ...)
 
#define NAME_CASE(_val, _support, _pretty)
 
#define GEN_BOOL(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, _default)
 
#define GEN_INT(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_help, func_validate, func_action, _min, _max, _default)
 
#define GEN_STRING(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, _default)
 
#define GEN_STRING_NRS(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, _default)
 
#define GEN_ENUM(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_help, func_validate, func_action, func_name, _default)
 
#define GEN_BITWISE(name, value, sclass, scateg, slevel, al_read, al_write, short_help, extra_help, func_validate, func_action, func_name, _default)
 
#define PACKET_COMMON_INIT(packet, pset, pconn)
 

Typedefs

typedef bool(* bool_validate_func_t) (bool value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
 
typedef bool(* int_validate_func_t) (int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
 
typedef bool(* string_validate_func_t) (const char *value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
 
typedef bool(* enum_validate_func_t) (int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
 
typedef bool(* bitwise_validate_func_t) (unsigned value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)
 
typedef void(* action_callback_func_t) (const struct setting *pset)
 
typedef const char *(* help_callback_func_t) (const struct setting *pset)
 
typedef const struct sset_val_name *(* val_name_func_t) (int value)
 

Enumerations

enum  sset_class {
  SSET_MAP_SIZE , SSET_MAP_GEN , SSET_MAP_ADD , SSET_PLAYERS ,
  SSET_PLAYERS_CHANGEABLE , SSET_GAME_INIT , SSET_RULES , SSET_RULES_SCENARIO ,
  SSET_RULES_FLEXIBLE , SSET_META
}
 

Functions

static void setting_ruleset_setdef (struct setting *pset)
 
static bool setting_ruleset_one (struct section_file *file, const char *name, const char *path, bool compat)
 
static void setting_game_set (struct setting *pset, bool init)
 
static void setting_game_free (struct setting *pset)
 
static void setting_game_restore (struct setting *pset)
 
static void settings_list_init (void)
 
static void settings_list_free (void)
 
int settings_list_cmp (const struct setting *const *pset1, const struct setting *const *pset2)
 
static bool set_enum_value (struct setting *pset, int val)
 
static const struct sset_val_namecaravanbonusstyle_name (int caravanbonus)
 
static const struct sset_val_namemapsize_name (int mapsize)
 
static const struct sset_val_nametopology_name (int topology_bit)
 
static const struct sset_val_namewrap_name (int wrap_bit)
 
static const struct sset_val_nametraderevenuestyle_name (int revenue_style)
 
static const struct sset_val_namegenerator_name (int generator)
 
static const struct sset_val_namestartpos_name (int startpos)
 
static const struct sset_val_nameteamplacement_name (int team_placement)
 
static const struct sset_val_namepersistentready_name (int persistent_ready)
 
static const struct sset_val_namevictory_conditions_name (int condition_bit)
 
static const struct sset_val_nameautosaves_name (int autosaves_bit)
 
static const struct sset_val_nameborders_name (int borders)
 
static const struct sset_val_nametrait_dist_name (int trait_dist)
 
static const struct sset_val_nameplrcol_name (int plrcol)
 
static const struct sset_val_namehappyborders_name (int happyborders)
 
static const struct sset_val_namediplomacy_name (int diplomacy)
 
static const struct sset_val_namecitynames_name (int citynames)
 
static const struct sset_val_namebarbarians_name (int barbarians)
 
static const struct sset_val_namerevolentype_name (int revolentype)
 
static const struct sset_val_namerevealmap_name (int bit)
 
static const struct sset_val_nameairliftingstyle_name (int bit)
 
static const struct sset_val_namephasemode_name (int phasemode)
 
static const struct sset_val_namescoreloglevel_name (enum scorelog_level sl_level)
 
static const struct sset_val_namecompresstype_name (enum fz_method compresstype)
 
static const struct sset_val_nameailevel_name (enum ai_level lvl)
 
static const struct sset_val_namebool_name (int enable)
 
static const charphasemode_help (const struct setting *pset)
 
static const charhuts_help (const struct setting *pset)
 
static void scorelog_action (const struct setting *pset)
 
static void aifill_action (const struct setting *pset)
 
static void nationset_action (const struct setting *pset)
 
static void plrcol_action (const struct setting *pset)
 
static void autotoggle_action (const struct setting *pset)
 
static void timeout_action (const struct setting *pset)
 
static void first_timeout_action (const struct setting *pset)
 
static void huts_action (const struct setting *pset)
 
static void topology_action (const struct setting *pset)
 
static void wrap_action (const struct setting *pset)
 
static void metamessage_action (const struct setting *pset)
 
static void aitype_action (const struct setting *pset)
 
static bool savename_validate (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool generator_validate (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool scorefile_validate (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool demography_callback (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool autosaves_callback (unsigned value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool allowtake_callback (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool startunits_callback (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool endturn_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool maxplayers_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool nationset_callback (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool timeout_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool first_timeout_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool unitwaittime_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool mapsize_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool xsize_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool ysize_callback (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool topology_callback (unsigned value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool aitype_callback (const char *value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool wrap_callback (unsigned value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static bool plrcol_validate (int value, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
struct settingsetting_by_number (int id)
 
struct settingsetting_by_name (const char *name)
 
int setting_number (const struct setting *pset)
 
const charsetting_name (const struct setting *pset)
 
const charsetting_short_help (const struct setting *pset)
 
const charsetting_extra_help (const struct setting *pset, bool constant)
 
enum sset_type setting_type (const struct setting *pset)
 
enum sset_level setting_level (const struct setting *pset)
 
enum sset_category setting_category (const struct setting *pset)
 
static bool setting_is_free_to_change (const struct setting *pset, char *reject_msg, size_t reject_msg_len)
 
bool setting_is_changeable (const struct setting *pset, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_is_visible_at_level (const struct setting *pset, enum cmdlevel plevel)
 
bool setting_is_visible (const struct setting *pset, struct connection *caller)
 
static enum m_pre_result setting_match_prefix_base (const val_name_func_t name_fn, const char *prefix, int *ind_result, const char **matches, size_t max_matches, size_t *pnum_matches)
 
static bool setting_match_prefix (const val_name_func_t name_fn, const char *prefix, int *pvalue, char *reject_msg, size_t reject_msg_len)
 
static const charsetting_bool_to_str (const struct setting *pset, bool value, bool pretty, char *buf, size_t buf_len)
 
static bool setting_bool_validate_base (const struct setting *pset, const char *val, int *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bool_set (struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bool_get (struct setting *pset)
 
bool setting_bool_validate (const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
static const charsetting_bool_secfile_str (secfile_data_t data, int val)
 
static const charsetting_int_to_str (const struct setting *pset, int value, bool pretty, char *buf, size_t buf_len)
 
int setting_int_min (const struct setting *pset)
 
int setting_int_max (const struct setting *pset)
 
bool setting_int_set (struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_int_validate (const struct setting *pset, int val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
int setting_int_get (struct setting *pset)
 
static const charsetting_str_to_str (const struct setting *pset, const char *value, bool pretty, char *buf, size_t buf_len)
 
bool setting_str_set (struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_str_validate (const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
charsetting_str_get (struct setting *pset)
 
const charsetting_enum_secfile_str (secfile_data_t data, int val)
 
const charsetting_enum_val (const struct setting *pset, int val, bool pretty)
 
static const charsetting_enum_to_str (const struct setting *pset, int value, bool pretty, char *buf, size_t buf_len)
 
static bool setting_enum_validate_base (const struct setting *pset, const char *val, int *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
int read_enum_value (const struct setting *pset)
 
bool setting_enum_set (struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_enum_validate (const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
const charsetting_bitwise_secfile_str (secfile_data_t data, int bit)
 
const charsetting_bitwise_bit (const struct setting *pset, int bit, bool pretty)
 
static const charsetting_bitwise_to_str (const struct setting *pset, unsigned value, bool pretty, char *buf, size_t buf_len)
 
static bool setting_bitwise_validate_base (const struct setting *pset, const char *val, unsigned *pint_val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bitwise_set (struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bitwise_validate (const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
int setting_bitwise_get (struct setting *pset)
 
const charsetting_value_name (const struct setting *pset, bool pretty, char *buf, size_t buf_len)
 
const charsetting_default_name (const struct setting *pset, bool pretty, char *buf, size_t buf_len)
 
void setting_set_to_default (struct setting *pset)
 
void setting_action (const struct setting *pset)
 
bool settings_ruleset (struct section_file *file, const char *section, bool act, bool compat)
 
bool setting_non_default (const struct setting *pset)
 
bool setting_locked (const struct setting *pset)
 
bool setting_ruleset_locked (const struct setting *pset)
 
void setting_ruleset_lock_set (struct setting *pset)
 
void setting_admin_lock_set (struct setting *pset)
 
void setting_ruleset_lock_clear (struct setting *pset)
 
void setting_admin_lock_clear (struct setting *pset)
 
void settings_game_start (void)
 
void settings_game_save (struct section_file *file, const char *section)
 
void settings_game_load (struct section_file *file, const char *section)
 
bool settings_game_reset (void)
 
void settings_init (bool act)
 
void settings_reset (void)
 
void settings_turn (void)
 
void settings_free (void)
 
int settings_number (void)
 
void send_server_setting (struct conn_list *dest, const struct setting *pset)
 
void send_server_settings (struct conn_list *dest)
 
void send_server_access_level_settings (struct conn_list *dest, enum cmdlevel old_level, enum cmdlevel new_level)
 
void send_server_setting_control (struct connection *pconn)
 
void settings_list_update (void)
 
struct setting_listsettings_list_get (enum sset_level level)
 
void setting_changed (struct setting *pset)
 
enum setting_default_level setting_get_setdef (const struct setting *pset)
 

Variables

struct { 
 
   bool   init 
 
   struct setting_list *   level [OLEVELS_NUM
 
setting_sorted = { .init = FALSE
 
static struct setting settings []
 
static const int SETTINGS_NUM = ARRAY_SIZE(settings)
 

Macro Definition Documentation

◆ GEN_BITWISE

#define GEN_BITWISE (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_validate,
  func_action,
  func_name,
  _default 
)
Value:
{ name, sclass, al_read, al_write, short_help, extra_help, NULL, \
SST_BITWISE, scateg, slevel, \
.bitwise = { (unsigned *) (void *) &value, _default, func_validate, \
func_action, FALSE, .ruleset_settable = TRUE},
char * incite_cost
Definition comments.c:75
const char * name
Definition inputfile.c:127
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47

Definition at line 1462 of file settings.c.

◆ GEN_BOOL

#define GEN_BOOL (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_validate,
  func_action,
  _default 
)
Value:
{name, sclass, al_read, al_write, short_help, extra_help, NULL, SST_BOOL, \
scateg, slevel, \
.boolean = {&value, _default, func_validate, bool_name, \
FALSE} INIT_BRACE_END , func_action, FALSE, .ruleset_settable = TRUE},
static const struct sset_val_name * bool_name(int enable)
Definition settings.c:629

Definition at line 1411 of file settings.c.

◆ GEN_ENUM

#define GEN_ENUM (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_help,
  func_validate,
  func_action,
  func_name,
  _default 
)
Value:
{ name, sclass, al_read, al_write, short_help, extra_help, func_help, \
SST_ENUM, scateg, slevel, \
.enumerator = { &value, sizeof(value), _default, \
func_action, FALSE, .ruleset_settable = TRUE},
const struct sset_val_name *(* val_name_func_t)(int value)
Definition settings.c:90

Definition at line 1451 of file settings.c.

◆ GEN_INT

#define GEN_INT (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_help,
  func_validate,
  func_action,
  _min,
  _max,
  _default 
)
Value:
{name, sclass, al_read, al_write, short_help, extra_help, func_help, \
SST_INT, scateg, slevel, \
.integer = {(int *) &value, _default, _min, _max, func_validate, \
func_action, FALSE, .ruleset_settable = TRUE},

Definition at line 1420 of file settings.c.

◆ GEN_STRING

#define GEN_STRING (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_validate,
  func_action,
  _default 
)
Value:
{name, sclass, al_read, al_write, short_help, extra_help, NULL, \
SST_STRING, scateg, slevel, \
.string = {value, _default, sizeof(value), func_validate, ""} \
func_action, FALSE, .ruleset_settable = TRUE},

Definition at line 1431 of file settings.c.

◆ GEN_STRING_NRS

#define GEN_STRING_NRS (   name,
  value,
  sclass,
  scateg,
  slevel,
  al_read,
  al_write,
  short_help,
  extra_help,
  func_validate,
  func_action,
  _default 
)
Value:
{name, sclass, al_read, al_write, short_help, extra_help, NULL, \
SST_STRING, scateg, slevel, \
.string = {value, _default, sizeof(value), func_validate, ""} \
func_action, FALSE, .ruleset_settable = FALSE},

Definition at line 1441 of file settings.c.

◆ NAME_CASE

#define NAME_CASE (   _val,
  _support,
  _pretty 
)
Value:
case _val: \
{ \
static const struct sset_val_name name = { _support, _pretty }; \
return &name; \
}

Definition at line 224 of file settings.c.

◆ PACKET_COMMON_INIT

#define PACKET_COMMON_INIT (   packet,
  pset,
  pconn 
)
Value:
memset(&packet, 0, sizeof(packet)); \
packet.id = setting_number(pset); \
packet.is_visible = setting_is_visible(pset, pconn); \
packet.is_changeable = setting_is_changeable(pset, pconn, NULL, 0); \
packet.initial_setting = game.info.is_new_game; \
packet.setdef = setting_get_setdef(pset);
struct civ_game game
Definition game.c:62
int setting_number(const struct setting *pset)
Definition settings.c:3321
bool setting_is_visible(const struct setting *pset, struct connection *caller)
Definition settings.c:3503
enum setting_default_level setting_get_setdef(const struct setting *pset)
Definition settings.c:5645
bool setting_is_changeable(const struct setting *pset, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Definition settings.c:3457
struct packet_game_info info
Definition game.h:89

◆ settings_snprintf

#define settings_snprintf (   _buf,
  _buf_len,
  format,
  ... 
)
Value:
if (_buf != NULL) { \
}

Definition at line 206 of file settings.c.

Typedef Documentation

◆ action_callback_func_t

typedef void(* action_callback_func_t) (const struct setting *pset)

Definition at line 88 of file settings.c.

◆ bitwise_validate_func_t

typedef bool(* bitwise_validate_func_t) (unsigned value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)

Definition at line 83 of file settings.c.

◆ bool_validate_func_t

typedef bool(* bool_validate_func_t) (bool value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)

Definition at line 70 of file settings.c.

◆ enum_validate_func_t

typedef bool(* enum_validate_func_t) (int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)

Definition at line 80 of file settings.c.

◆ help_callback_func_t

typedef const char *(* help_callback_func_t) (const struct setting *pset)

Definition at line 89 of file settings.c.

◆ int_validate_func_t

typedef bool(* int_validate_func_t) (int value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)

Definition at line 73 of file settings.c.

◆ string_validate_func_t

typedef bool(* string_validate_func_t) (const char *value, struct connection *pconn, char *reject_msg, size_t reject_msg_len)

Definition at line 76 of file settings.c.

◆ val_name_func_t

typedef const struct sset_val_name *(* val_name_func_t) (int value)

Definition at line 89 of file settings.c.

Enumeration Type Documentation

◆ sset_class

Enumerator
SSET_MAP_SIZE 
SSET_MAP_GEN 
SSET_MAP_ADD 
SSET_PLAYERS 
SSET_PLAYERS_CHANGEABLE 
SSET_GAME_INIT 
SSET_RULES 
SSET_RULES_SCENARIO 
SSET_RULES_FLEXIBLE 
SSET_META 

Definition at line 57 of file settings.c.

Function Documentation

◆ aifill_action()

static void aifill_action ( const struct setting pset)
static

Create the selected number of AI's.

Definition at line 704 of file settings.c.

◆ ailevel_name()

static const struct sset_val_name * ailevel_name ( enum ai_level  lvl)
static

AI level names accessor.

Definition at line 604 of file settings.c.

◆ airliftingstyle_name()

static const struct sset_val_name * airliftingstyle_name ( int  bit)
static

Airlifting style setting names accessor.

Definition at line 532 of file settings.c.

◆ aitype_action()

static void aitype_action ( const struct setting pset)
static

Change the default AI type.

Definition at line 874 of file settings.c.

◆ aitype_callback()

static bool aitype_callback ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

AI type setting validation callback.

Definition at line 1356 of file settings.c.

◆ allowtake_callback()

static bool allowtake_callback ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify that a given allowtake string is valid. See game.allow_take.

Definition at line 998 of file settings.c.

◆ autosaves_callback()

static bool autosaves_callback ( unsigned  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Autosaves setting callback

Definition at line 972 of file settings.c.

◆ autosaves_name()

static const struct sset_val_name * autosaves_name ( int  autosaves_bit)
static

Autosaves setting names accessor.

Definition at line 387 of file settings.c.

◆ autotoggle_action()

static void autotoggle_action ( const struct setting pset)
static

Toggle player AI status.

Definition at line 766 of file settings.c.

◆ barbarians_name()

static const struct sset_val_name * barbarians_name ( int  barbarians)
static

Barbarian setting names accessor.

Definition at line 491 of file settings.c.

◆ bool_name()

static const struct sset_val_name * bool_name ( int  enable)
static

Names accessor for boolean settings (disable/enable).

Definition at line 629 of file settings.c.

◆ borders_name()

static const struct sset_val_name * borders_name ( int  borders)
static

Borders setting names accessor.

Definition at line 403 of file settings.c.

◆ caravanbonusstyle_name()

static const struct sset_val_name * caravanbonusstyle_name ( int  caravanbonus)
static

Caravan bonus style setting names accessor.

Definition at line 234 of file settings.c.

◆ citynames_name()

static const struct sset_val_name * citynames_name ( int  citynames)
static

City names setting names accessor.

Definition at line 477 of file settings.c.

◆ compresstype_name()

static const struct sset_val_name * compresstype_name ( enum fz_method  compresstype)
static

Savegame compress type names accessor.

Definition at line 578 of file settings.c.

◆ demography_callback()

static bool demography_callback ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify that a given demography string is valid. See game.demography.

Definition at line 952 of file settings.c.

◆ diplomacy_name()

static const struct sset_val_name * diplomacy_name ( int  diplomacy)
static

Diplomacy setting names accessor.

Definition at line 459 of file settings.c.

◆ endturn_callback()

static bool endturn_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify that a given endturn is valid.

Definition at line 1098 of file settings.c.

◆ first_timeout_action()

static void first_timeout_action ( const struct setting pset)
static

Enact a change in the 'first_timeout' server setting immediately, if the game is afoot.

Definition at line 799 of file settings.c.

◆ first_timeout_callback()

static bool first_timeout_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Validate the 'first_timeout' server setting.

Definition at line 1199 of file settings.c.

◆ generator_name()

static const struct sset_val_name * generator_name ( int  generator)
static

Generator setting names accessor.

Definition at line 302 of file settings.c.

◆ generator_validate()

static bool generator_validate ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify the value of the generator option (notably the MAPGEN_SCENARIO case).

Definition at line 909 of file settings.c.

◆ happyborders_name()

static const struct sset_val_name * happyborders_name ( int  happyborders)
static

Happyborders setting names accessor.

Definition at line 446 of file settings.c.

◆ huts_action()

static void huts_action ( const struct setting pset)
static

Clean out absolute number of huts when relative setting set.

Definition at line 819 of file settings.c.

◆ huts_help()

static const char * huts_help ( const struct setting pset)
static

Help about huts setting

Definition at line 665 of file settings.c.

◆ mapsize_callback()

static bool mapsize_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Mapsize setting validation callback.

Definition at line 1243 of file settings.c.

◆ mapsize_name()

static const struct sset_val_name * mapsize_name ( int  mapsize)
static

Map size definition setting names accessor. This setting has an hard-coded dependence in "server/meta.c".

Definition at line 249 of file settings.c.

◆ maxplayers_callback()

static bool maxplayers_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify that a given maxplayers is valid.

Definition at line 1113 of file settings.c.

◆ metamessage_action()

static void metamessage_action ( const struct setting pset)
static

Update metaserver message string from changed user meta server message string.

Definition at line 858 of file settings.c.

◆ nationset_action()

static void nationset_action ( const struct setting pset)
static

Restrict to the selected nation set.

Definition at line 717 of file settings.c.

◆ nationset_callback()

static bool nationset_callback ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Validate the 'nationset' server setting.

Definition at line 1140 of file settings.c.

◆ persistentready_name()

static const struct sset_val_name * persistentready_name ( int  persistent_ready)
static

Persistentready setting names accessor.

Definition at line 358 of file settings.c.

◆ phasemode_help()

static const char * phasemode_help ( const struct setting pset)
static

Help about phasemode setting

Definition at line 647 of file settings.c.

◆ phasemode_name()

static const struct sset_val_name * phasemode_name ( int  phasemode)
static

Phase mode names accessor.

Definition at line 550 of file settings.c.

Referenced by phasemode_help().

◆ plrcol_action()

static void plrcol_action ( const struct setting pset)
static

Clear any user-set player colors in modes other than PLRCOL_PLR_SET.

Definition at line 750 of file settings.c.

◆ plrcol_name()

static const struct sset_val_name * plrcol_name ( int  plrcol)
static

Player colors configuration setting names accessor.

Definition at line 431 of file settings.c.

◆ plrcol_validate()

static bool plrcol_validate ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Validate that the player color mode can be used.

Definition at line 1392 of file settings.c.

◆ read_enum_value()

int read_enum_value ( const struct setting pset)

◆ revealmap_name()

static const struct sset_val_name * revealmap_name ( int  bit)
static

Revealmap setting names accessor.

Definition at line 520 of file settings.c.

◆ revolentype_name()

static const struct sset_val_name * revolentype_name ( int  revolentype)
static

Revolution length type setting names accessor.

Definition at line 506 of file settings.c.

◆ savename_validate()

static bool savename_validate ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify the selected savename definition.

Definition at line 888 of file settings.c.

◆ scorefile_validate()

static bool scorefile_validate ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify the name for the score log file.

Definition at line 935 of file settings.c.

◆ scorelog_action()

static void scorelog_action ( const struct setting pset)
static

(De)initialze the score log.

Definition at line 692 of file settings.c.

◆ scoreloglevel_name()

static const struct sset_val_name * scoreloglevel_name ( enum scorelog_level  sl_level)
static

Scorelog level names accessor.

Definition at line 565 of file settings.c.

◆ send_server_access_level_settings()

void send_server_access_level_settings ( struct conn_list dest,
enum cmdlevel  old_level,
enum cmdlevel  new_level 
)

Send the server settings that got a different visibility or changability after a connection access level change. Usually called when the access level of the user changes.

Definition at line 5439 of file settings.c.

Referenced by conn_set_access().

◆ send_server_setting()

void send_server_setting ( struct conn_list dest,
const struct setting pset 
)

Tell the client about just one server setting. Call this after a setting is saved.

Definition at line 5308 of file settings.c.

Referenced by metamessage_command(), send_server_access_level_settings(), send_server_settings(), and set_command().

◆ send_server_setting_control()

void send_server_setting_control ( struct connection pconn)

Tell the client about all server settings.

Definition at line 5471 of file settings.c.

Referenced by establish_new_connection().

◆ send_server_settings()

void send_server_settings ( struct conn_list dest)

Tell the client about all server settings.

Definition at line 5427 of file settings.c.

Referenced by establish_new_connection(), load_command(), reset_command(), settings_ruleset(), and srv_running().

◆ set_enum_value()

static bool set_enum_value ( struct setting pset,
int  val 
)
static

Helper function to write value to enumerator setting

Definition at line 3958 of file settings.c.

Referenced by setting_enum_set(), setting_ruleset_one(), setting_set_to_default(), and settings_game_load().

◆ setting_action()

void setting_action ( const struct setting pset)

Execute the action callback if needed.

Definition at line 4366 of file settings.c.

Referenced by set_command(), settings_game_load(), settings_init(), settings_reset(), and settings_ruleset().

◆ setting_admin_lock_clear()

void setting_admin_lock_clear ( struct setting pset)

Clear admin level lock from the setting

Definition at line 4721 of file settings.c.

Referenced by settings_init(), and unlock_command().

◆ setting_admin_lock_set()

void setting_admin_lock_set ( struct setting pset)

Set admin level lock for the setting

Definition at line 4701 of file settings.c.

Referenced by lock_command().

◆ setting_bitwise_bit()

const char * setting_bitwise_bit ( const struct setting pset,
int  bit,
bool  pretty 
)

Convert the bit number to its string representation. Return NULL if 'bit' is not a valid bit.

Definition at line 4085 of file settings.c.

Referenced by manual_settings(), and show_help_option().

◆ setting_bitwise_get()

int setting_bitwise_get ( struct setting pset)

Get value of bitwise setting

Definition at line 4254 of file settings.c.

Referenced by save_game_ruleset(), and server_ss_val_bitwise_get().

◆ setting_bitwise_secfile_str()

const char * setting_bitwise_secfile_str ( secfile_data_t  data,
int  bit 
)

Convert the integer to the long support string representation of an enumerator. This function must match the secfile_enum_name_data_fn_t type.

Definition at line 4062 of file settings.c.

Referenced by compat_load_030200(), save_game_ruleset(), setting_ruleset_one(), settings_game_load(), and settings_game_save().

◆ setting_bitwise_set()

bool setting_bitwise_set ( struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Set the setting to 'val'. Returns TRUE on success. If it fails, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 4220 of file settings.c.

Referenced by compat_load_030200(), set_command(), setting_game_restore(), and setting_ruleset_one().

◆ setting_bitwise_to_str()

static const char * setting_bitwise_to_str ( const struct setting pset,
unsigned  value,
bool  pretty,
char buf,
size_t  buf_len 
)
static

Compute the string representation of the value for this bitwise setting.

Definition at line 4104 of file settings.c.

Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().

◆ setting_bitwise_validate()

bool setting_bitwise_validate ( const struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 4241 of file settings.c.

Referenced by set_command().

◆ setting_bitwise_validate_base()

static bool setting_bitwise_validate_base ( const struct setting pset,
const char val,
unsigned pint_val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

FIXME: also check the access level of pconn.

Definition at line 4169 of file settings.c.

Referenced by setting_bitwise_set(), and setting_bitwise_validate().

◆ setting_bool_get()

bool setting_bool_get ( struct setting pset)

Get value of boolean setting

Definition at line 3673 of file settings.c.

Referenced by save_game_ruleset(), and server_ss_val_bool_get().

◆ setting_bool_secfile_str()

static const char * setting_bool_secfile_str ( secfile_data_t  data,
int  val 
)
static

Convert the integer to the long support string representation of a boolean setting. This function must match the secfile_enum_name_data_fn_t type.

Definition at line 3699 of file settings.c.

Referenced by setting_ruleset_one().

◆ setting_bool_set()

bool setting_bool_set ( struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Set the setting to 'val'. Returns TRUE on success. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 3654 of file settings.c.

Referenced by set_command(), and setting_game_restore().

◆ setting_bool_to_str()

static const char * setting_bool_to_str ( const struct setting pset,
bool  value,
bool  pretty,
char buf,
size_t  buf_len 
)
static

Compute the string representation of the value for this boolean setting.

Definition at line 3604 of file settings.c.

Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().

◆ setting_bool_validate()

bool setting_bool_validate ( const struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 3685 of file settings.c.

Referenced by set_command().

◆ setting_bool_validate_base()

static bool setting_bool_validate_base ( const struct setting pset,
const char val,
int pint_val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

FIXME: also check the access level of pconn.

Definition at line 3625 of file settings.c.

Referenced by setting_bool_set(), and setting_bool_validate().

◆ setting_by_name()

struct setting * setting_by_name ( const char name)

◆ setting_by_number()

struct setting * setting_by_number ( int  id)

◆ setting_category()

enum sset_category setting_category ( const struct setting pset)

Access function for the setting category.

Definition at line 3375 of file settings.c.

Referenced by manual_settings(), and sanity_check_setting_is_game_rule().

◆ setting_changed()

void setting_changed ( struct setting pset)

Mark setting changed

Definition at line 5637 of file settings.c.

Referenced by metamessage_command(), and set_command().

◆ setting_default_name()

const char * setting_default_name ( const struct setting pset,
bool  pretty,
char buf,
size_t  buf_len 
)

Compute the name of the default value of the setting.

Definition at line 4300 of file settings.c.

Referenced by manual_settings(), and show_help_option().

◆ setting_enum_secfile_str()

const char * setting_enum_secfile_str ( secfile_data_t  data,
int  val 
)

Convert the integer to the long support string representation of an enumerator. This function must match the secfile_enum_name_data_fn_t type.

Definition at line 3867 of file settings.c.

Referenced by save_game_ruleset(), setting_ruleset_one(), settings_game_load(), and settings_game_save().

◆ setting_enum_set()

bool setting_enum_set ( struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Set the setting to 'val'. Returns TRUE on success. If it fails, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 4019 of file settings.c.

Referenced by autolock_settings(), set_command(), setting_game_restore(), and srv_ready().

◆ setting_enum_to_str()

static const char * setting_enum_to_str ( const struct setting pset,
int  value,
bool  pretty,
char buf,
size_t  buf_len 
)
static

Compute the string representation of the value for this enumerator setting.

Definition at line 3909 of file settings.c.

Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().

◆ setting_enum_val()

const char * setting_enum_val ( const struct setting pset,
int  val,
bool  pretty 
)

Convert the integer to the string representation of an enumerator. Return NULL if 'val' is not a valid enumerator.

Definition at line 3890 of file settings.c.

Referenced by manual_settings(), and show_help_option().

◆ setting_enum_validate()

bool setting_enum_validate ( const struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

Definition at line 4048 of file settings.c.

Referenced by set_command().

◆ setting_enum_validate_base()

static bool setting_enum_validate_base ( const struct setting pset,
const char val,
int pint_val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available in the optional parameter 'reject_msg'.

FIXME: also check the access level of pconn.

Definition at line 3931 of file settings.c.

Referenced by setting_enum_set(), and setting_enum_validate().

◆ setting_extra_help()

const char * setting_extra_help ( const struct setting pset,
bool  constant 
)

Access function for the long (extra) help of the setting. If 'constant' is TRUE, static, not-yet-translated string is always returned.

Definition at line 3347 of file settings.c.

Referenced by manual_settings(), send_server_setting_control(), and show_help_option().

◆ setting_game_free()

static void setting_game_free ( struct setting pset)
static

Free the memory used for the settings at game start.

Definition at line 4773 of file settings.c.

Referenced by settings_free().

◆ setting_game_restore()

static void setting_game_restore ( struct setting pset)
static

Restore the setting to the value used at the start of the current game.

Definition at line 4783 of file settings.c.

Referenced by settings_game_reset().

◆ setting_game_set()

static void setting_game_set ( struct setting pset,
bool  init 
)
static

Save the setting value of the current game.

Definition at line 4733 of file settings.c.

Referenced by settings_game_start(), and settings_init().

◆ setting_get_setdef()

enum setting_default_level setting_get_setdef ( const struct setting pset)

Is the setting in changed state, or the default

Definition at line 5645 of file settings.c.

Referenced by save_game_ruleset(), settings_game_save(), and show_settings_one().

◆ setting_int_get()

int setting_int_get ( struct setting pset)

Get value of integer setting

Definition at line 3785 of file settings.c.

Referenced by save_game_ruleset(), and server_ss_val_int_get().

◆ setting_int_max()

int setting_int_max ( const struct setting pset)

Returns the maximal integer value for this setting.

Definition at line 3730 of file settings.c.

Referenced by manual_settings(), show_help_option(), and show_settings_one().

◆ setting_int_min()

int setting_int_min ( const struct setting pset)

Returns the minimal integer value for this setting.

Definition at line 3721 of file settings.c.

Referenced by manual_settings(), show_help_option(), and show_settings_one().

◆ setting_int_set()

bool setting_int_set ( struct setting pset,
int  val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Set the setting to 'val'. Returns TRUE on success. If it fails, the reason of the failure is available by the function setting_error().

Definition at line 3740 of file settings.c.

Referenced by set_command(), setting_game_restore(), and setting_ruleset_one().

◆ setting_int_to_str()

static const char * setting_int_to_str ( const struct setting pset,
int  value,
bool  pretty,
char buf,
size_t  buf_len 
)
static

Compute the string representation of the value for this integer setting.

Definition at line 3710 of file settings.c.

Referenced by setting_default_name(), and setting_value_name().

◆ setting_int_validate()

bool setting_int_validate ( const struct setting pset,
int  val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available by the function setting_error().

FIXME: also check the access level of pconn.

Definition at line 3760 of file settings.c.

Referenced by set_command(), and setting_int_set().

◆ setting_is_changeable()

bool setting_is_changeable ( const struct setting pset,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns whether the specified server setting (option) can currently be changed by the caller. If it returns FALSE, the reason of the failure is available by the function setting_error().

Definition at line 3457 of file settings.c.

Referenced by default_command(), manual_settings(), set_command(), setting_bitwise_set(), setting_bool_set(), setting_enum_set(), setting_game_restore(), setting_int_set(), setting_status(), setting_str_set(), settings_game_load(), settings_reset(), and show_help_option().

◆ setting_is_free_to_change()

static bool setting_is_free_to_change ( const struct setting pset,
char reject_msg,
size_t  reject_msg_len 
)
static

Returns whether the specified server setting (option) can currently be changed without breaking data consistency (map dimension options can't change when map has already been created with certain dimensions)

Definition at line 3385 of file settings.c.

Referenced by setting_is_changeable(), and settings_game_save().

◆ setting_is_visible()

bool setting_is_visible ( const struct setting pset,
struct connection caller 
)

Returns whether the specified server setting (option) can be seen by the caller.

Definition at line 3503 of file settings.c.

Referenced by set_command(), show_help_option(), show_help_option_list(), and show_settings().

◆ setting_is_visible_at_level()

bool setting_is_visible_at_level ( const struct setting pset,
enum cmdlevel  plevel 
)

Returns whether the specified server setting (option) can be seen by a caller with the specified access level.

Definition at line 3493 of file settings.c.

Referenced by sanity_check_setting_is_seen(), and setting_is_visible().

◆ setting_level()

enum sset_level setting_level ( const struct setting pset)

Access function for the setting level (used by the /show command).

Definition at line 3367 of file settings.c.

Referenced by manual_settings(), and settings_list_init().

◆ setting_locked()

bool setting_locked ( const struct setting pset)

Returns if the setting is locked by the ruleset.

Definition at line 4673 of file settings.c.

Referenced by setting_ruleset_one(), setting_status(), settings_list_update(), and settings_ruleset().

◆ setting_match_prefix()

static bool setting_match_prefix ( const val_name_func_t  name_fn,
const char prefix,
int pvalue,
char reject_msg,
size_t  reject_msg_len 
)
static

Convert the string prefix to an integer representation. NB: This function is used for SST_ENUM and SST_BITWISE.

Definition at line 3562 of file settings.c.

Referenced by setting_bitwise_validate_base(), setting_bool_validate_base(), and setting_enum_validate_base().

◆ setting_match_prefix_base()

static enum m_pre_result setting_match_prefix_base ( const val_name_func_t  name_fn,
const char prefix,
int ind_result,
const char **  matches,
size_t  max_matches,
size_t pnum_matches 
)
static

Convert the string prefix to an integer representation. NB: This function is used for SST_ENUM and SST_BITWISE.

FIXME: this mostly duplicate match_prefix_full().

Definition at line 3517 of file settings.c.

Referenced by setting_match_prefix().

◆ setting_name()

const char * setting_name ( const struct setting pset)

◆ setting_non_default()

bool setting_non_default ( const struct setting pset)

Returns whether the setting has non-default value.

Definition at line 4647 of file settings.c.

Referenced by manual_settings(), settings_list_update(), and show_settings_one().

◆ setting_number()

int setting_number ( const struct setting pset)

◆ setting_ruleset_lock_clear()

void setting_ruleset_lock_clear ( struct setting pset)

Clear ruleset level lock from the setting

Definition at line 4709 of file settings.c.

Referenced by autolock_settings(), settings_init(), and settings_ruleset().

◆ setting_ruleset_lock_set()

void setting_ruleset_lock_set ( struct setting pset)

Set ruleset level lock for the setting

Definition at line 4689 of file settings.c.

Referenced by autolock_settings(), and setting_ruleset_one().

◆ setting_ruleset_locked()

bool setting_ruleset_locked ( const struct setting pset)

Returns if the setting is locked by the ruleset.

Definition at line 4681 of file settings.c.

Referenced by manual_settings(), and save_game_ruleset().

◆ setting_ruleset_one()

static bool setting_ruleset_one ( struct section_file file,
const char name,
const char path,
bool  compat 
)
static

Set one setting from the game.ruleset file.

Definition at line 4455 of file settings.c.

Referenced by settings_ruleset().

◆ setting_ruleset_setdef()

static void setting_ruleset_setdef ( struct setting pset)
inlinestatic

Mark a setting as having been set by the ruleset.

Definition at line 4447 of file settings.c.

Referenced by setting_ruleset_one(), and settings_ruleset().

◆ setting_set_to_default()

void setting_set_to_default ( struct setting pset)

Update the setting to the default value

Definition at line 4336 of file settings.c.

Referenced by default_command(), setting_game_restore(), settings_init(), settings_reset(), and settings_ruleset().

◆ setting_short_help()

const char * setting_short_help ( const struct setting pset)

Access function for the short help (not translated yet) of the setting.

Definition at line 3338 of file settings.c.

Referenced by manual_settings(), send_server_setting_control(), and show_help_option().

◆ setting_str_get()

char * setting_str_get ( struct setting pset)

Get value of string setting

Definition at line 3856 of file settings.c.

Referenced by save_game_ruleset().

◆ setting_str_set()

bool setting_str_set ( struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Set the setting to 'val'. Returns TRUE on success. If it fails, the reason of the failure is available by the function setting_error().

Definition at line 3811 of file settings.c.

Referenced by set_command(), setting_game_restore(), setting_ruleset_one(), and settings_game_load().

◆ setting_str_to_str()

static const char * setting_str_to_str ( const struct setting pset,
const char value,
bool  pretty,
char buf,
size_t  buf_len 
)
static

Compute the string representation of the value for this string setting.

Definition at line 3795 of file settings.c.

Referenced by setting_default_name(), and setting_value_name().

◆ setting_str_validate()

bool setting_str_validate ( const struct setting pset,
const char val,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)

Returns TRUE if 'val' is a valid value for this setting. If it's not, the reason of the failure is available by the function setting_error().

FIXME: also check the access level of pconn.

Definition at line 3831 of file settings.c.

Referenced by set_command(), and setting_str_set().

◆ setting_type()

enum sset_type setting_type ( const struct setting pset)

◆ setting_value_name()

const char * setting_value_name ( const struct setting pset,
bool  pretty,
char buf,
size_t  buf_len 
)

◆ settings_free()

void settings_free ( void  )

Deinitialize stuff related to this code module.

Definition at line 5287 of file settings.c.

Referenced by server_quit().

◆ settings_game_load()

void settings_game_load ( struct section_file file,
const char section 
)

Restore all settings from a savegame.

Definition at line 4946 of file settings.c.

Referenced by sg_load_settings(), and sg_load_settings().

◆ settings_game_reset()

bool settings_game_reset ( void  )

Reset all settings to the values at game start.

Definition at line 5228 of file settings.c.

Referenced by reset_command().

◆ settings_game_save()

void settings_game_save ( struct section_file file,
const char section 
)

Save game settings.

Definition at line 4858 of file settings.c.

Referenced by sg_save_settings().

◆ settings_game_start()

void settings_game_start ( void  )

Save setting values at the start of the game.

Definition at line 4845 of file settings.c.

Referenced by srv_ready().

◆ settings_init()

void settings_init ( bool  act)

Initialize stuff related to this code module.

Definition at line 5245 of file settings.c.

Referenced by main(), and srv_prepare().

◆ settings_list_cmp()

int settings_list_cmp ( const struct setting *const ppset1,
const struct setting *const ppset2 
)

Update sorted settings (changed and locked values).

Definition at line 5595 of file settings.c.

Referenced by settings_list_init(), and settings_list_update().

◆ settings_list_free()

static void settings_list_free ( void  )
static

Free sorted settings.

Definition at line 5620 of file settings.c.

Referenced by settings_free().

◆ settings_list_get()

struct setting_list * settings_list_get ( enum sset_level  level)

Get a settings list of a certain level. Call settings_list_update() before if something was changed.

Definition at line 5608 of file settings.c.

◆ settings_list_init()

static void settings_list_init ( void  )
static

Initialise sorted settings.

Definition at line 5508 of file settings.c.

Referenced by settings_init().

◆ settings_list_update()

void settings_list_update ( void  )

Update sorted settings (changed and locked values).

Definition at line 5566 of file settings.c.

Referenced by settings_init(), and show_settings().

◆ settings_number()

int settings_number ( void  )

Returns the total number of settings.

Definition at line 5299 of file settings.c.

Referenced by explain_option(), lookup_option(), show_help(), and universal_kind_values().

◆ settings_reset()

void settings_reset ( void  )

Reset all settings iff they are changeable.

Definition at line 5265 of file settings.c.

Referenced by reset_command().

◆ settings_ruleset()

bool settings_ruleset ( struct section_file file,
const char section,
bool  act,
bool  compat 
)

Load game settings from ruleset file 'game.ruleset'.

Definition at line 4376 of file settings.c.

Referenced by load_rulesetdir(), and reload_rulesets_settings().

◆ settings_turn()

void settings_turn ( void  )

Update stuff every turn that is related to this code module. Run this on turn end.

Definition at line 5279 of file settings.c.

Referenced by end_turn().

◆ startpos_name()

static const struct sset_val_name * startpos_name ( int  startpos)
static

Start position setting names accessor.

Definition at line 318 of file settings.c.

◆ startunits_callback()

static bool startunits_callback ( const char value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Verify that a given startunits string is valid. See game.server.start_units.

Definition at line 1044 of file settings.c.

◆ teamplacement_name()

static const struct sset_val_name * teamplacement_name ( int  team_placement)
static

Team placement setting names accessor.

Definition at line 338 of file settings.c.

◆ timeout_action()

static void timeout_action ( const struct setting pset)
static

Enact a change in the 'timeout' server setting immediately, if the game is afoot.

Definition at line 782 of file settings.c.

◆ timeout_callback()

static bool timeout_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Validate the 'timeout' server setting.

Definition at line 1161 of file settings.c.

◆ topology_action()

static void topology_action ( const struct setting pset)
static

Topology setting changed.

Definition at line 827 of file settings.c.

◆ topology_callback()

static bool topology_callback ( unsigned  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Topology setting validation callback.

Definition at line 1320 of file settings.c.

◆ topology_name()

static const struct sset_val_name * topology_name ( int  topology_bit)
static

Topology setting names accessor.

Definition at line 262 of file settings.c.

◆ traderevenuestyle_name()

static const struct sset_val_name * traderevenuestyle_name ( int  revenue_style)
static

Trade revenue style setting names accessor.

Definition at line 288 of file settings.c.

◆ trait_dist_name()

static const struct sset_val_name * trait_dist_name ( int  trait_dist)
static

Trait distribution setting names accessor.

Definition at line 419 of file settings.c.

◆ unitwaittime_callback()

static bool unitwaittime_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Check 'timeout' setting if 'unitwaittime' is changed.

Definition at line 1217 of file settings.c.

◆ victory_conditions_name()

static const struct sset_val_name * victory_conditions_name ( int  condition_bit)
static

Victory conditions setting names accessor.

Definition at line 373 of file settings.c.

◆ wrap_action()

static void wrap_action ( const struct setting pset)
static

Map wrap setting changed.

Definition at line 842 of file settings.c.

◆ wrap_callback()

static bool wrap_callback ( unsigned  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

Map wrap setting validation callback.

Definition at line 1372 of file settings.c.

◆ wrap_name()

static const struct sset_val_name * wrap_name ( int  wrap_bit)
static

Map wrap setting names accessor.

Definition at line 275 of file settings.c.

◆ xsize_callback()

static bool xsize_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

xsize setting validation callback.

Definition at line 1262 of file settings.c.

◆ ysize_callback()

static bool ysize_callback ( int  value,
struct connection caller,
char reject_msg,
size_t  reject_msg_len 
)
static

ysize setting validation callback.

Definition at line 1287 of file settings.c.

Variable Documentation

◆ init

bool init

Definition at line 189 of file settings.c.

Referenced by setting_game_set().

◆ level

Definition at line 190 of file settings.c.

Referenced by ai_level_help(), ai_skill_callback(), api_auth_set_cmdlevel(), api_utilities_log_base(), backtrace_print(), boot_help_texts(), caravan_parameter_log_real(), catastrophe_scaled(), check_tilespec_capabilities(), citylog_map_data(), citylog_map_workers(), cmd_of_level(), cmdlevel_command(), compat_load_030200(), con_handle_log(), con_log_init(), create_ai_menu(), create_conn_menu(), create_players_dialog(), create_start_page(), dai_caravan_goto(), do_log(), expansionism_of_skill_level(), fc_assert_fail(), fuzzy_of_skill_level(), handicap_of_skill_level(), handle_stdin_input_real(), pregame_options::init(), insert_veteran_help(), is_settable_ai_level(), log_callback_utf8(), log_parse_level_str(), log_real(), log_set_level(), log_write(), luascript_log(), luascript_log_vargs(), modpack_check_capabilities(), pf_path_print_real(), real_bodyguard_log(), real_city_log(), real_conn_list_dialog_update(), real_diplo_log(), real_tech_log(), real_unit_log(), restore_access_level(), ruleset_error_real(), science_cost_of_skill_level(), script_client_output(), script_server_cmd_reply(), set_ai_level(), set_ai_level_direct(), set_ai_level_directer(), set_ai_level_named(), set_cmdlevel(), settings_list_get(), sg_load_player_main(), sg_load_player_main(), show_settings(), fc_client::start_page_menu(), theme_lookup_sprite_tag_alt(), tiles_lookup_sprite_tag_alt(), tileset_error(), plr_report::toggle_ai_mode(), tolua_fcdb_auth_set_cmdlevel00(), unit_transport_depth(), pregame_options::update_ai_level(), update_environmental_upset(), utype_veteran_level(), utype_veteran_name_translation(), vdo_log(), veteran_system_definition(), and vsystem_veteran_level().

◆ [struct]

struct { ... } setting_sorted

◆ settings

struct setting settings[]
static

◆ SETTINGS_NUM

const int SETTINGS_NUM = ARRAY_SIZE(settings)
static

Definition at line 3293 of file settings.c.

Referenced by send_server_setting_control(), setting_by_number(), and settings_number().