Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
settings.h File Reference
#include "shared.h"
#include "game.h"
#include "server_settings.h"
#include "specenum_gen.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  sset_val_name
 
struct  sf_cb_data
 

Macros

#define SPECENUM_NAME   sset_category
 
#define SPECENUM_VALUE0   SSET_GEOLOGY
 
#define SPECENUM_VALUE0NAME   N_("Geological")
 
#define SPECENUM_VALUE1   SSET_SOCIOLOGY
 
#define SPECENUM_VALUE1NAME   N_("Sociological")
 
#define SPECENUM_VALUE2   SSET_ECONOMICS
 
#define SPECENUM_VALUE2NAME   N_("Economic")
 
#define SPECENUM_VALUE3   SSET_MILITARY
 
#define SPECENUM_VALUE3NAME   N_("Military")
 
#define SPECENUM_VALUE4   SSET_SCIENCE
 
#define SPECENUM_VALUE4NAME   N_("Scientific")
 
#define SPECENUM_VALUE5   SSET_INTERNAL
 
#define SPECENUM_VALUE5NAME   N_("Internal")
 
#define SPECENUM_VALUE6   SSET_NETWORK
 
#define SPECENUM_VALUE6NAME   N_("Networking")
 
#define SPECENUM_COUNT   SSET_NUM_CATEGORIES
 
#define SPECENUM_NAME   sset_level
 
#define SPECENUM_VALUE0   SSET_NONE
 
#define SPECENUM_VALUE0NAME   N_("?ssetlevel:None")
 
#define SPECENUM_VALUE1   SSET_ALL
 
#define SPECENUM_VALUE1NAME   N_("All")
 
#define SPECENUM_VALUE2   SSET_VITAL
 
#define SPECENUM_VALUE2NAME   N_("Vital")
 
#define SPECENUM_VALUE3   SSET_SITUATIONAL
 
#define SPECENUM_VALUE3NAME   N_("Situational")
 
#define SPECENUM_VALUE4   SSET_RARE
 
#define SPECENUM_VALUE4NAME   N_("Rare")
 
#define SPECENUM_VALUE5   SSET_CHANGED
 
#define SPECENUM_VALUE5NAME   N_("Changed")
 
#define SPECENUM_VALUE6   SSET_LOCKED
 
#define SPECENUM_VALUE6NAME   N_("Locked")
 
#define SPECENUM_COUNT   OLEVELS_NUM
 
#define SPECLIST_TAG   setting
 
#define SPECLIST_TYPE   struct setting
 
#define setting_list_iterate(_setting_list, _setting)    TYPED_LIST_ITERATE(struct setting, _setting_list, _setting)
 
#define setting_list_iterate_end    LIST_ITERATE_END
 
#define settings_iterate(_level, _pset)
 
#define settings_iterate_end
 

Enumerations

enum  setting_lock_level { SLOCK_NONE = 0 , SLOCK_RULESET , SLOCK_ADMIN }
 

Functions

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)
 
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)
 
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)
 
int read_enum_value (const struct setting *pset)
 
const charsetting_enum_secfile_str (secfile_data_t data, int val)
 
const charsetting_bitwise_secfile_str (secfile_data_t data, int bit)
 
bool setting_bool_set (struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bool_validate (const struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
 
bool setting_bool_get (struct setting *pset)
 
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)
 
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_val (const struct setting *pset, int val, bool pretty)
 
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_bit (const struct setting *pset, int bit, bool pretty)
 
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)
 
void setting_action (const struct setting *pset)
 
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 settings_list_update (void)
 
struct setting_listsettings_list_get (enum sset_level level)
 
bool settings_ruleset (struct section_file *file, const char *section, bool act, bool compat)
 
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 setting_changed (struct setting *pset)
 
enum setting_default_level setting_get_setdef (const struct setting *pset)
 

Macro Definition Documentation

◆ setting_list_iterate

#define setting_list_iterate (   _setting_list,
  _setting 
)     TYPED_LIST_ITERATE(struct setting, _setting_list, _setting)

Definition at line 181 of file settings.h.

◆ setting_list_iterate_end

#define setting_list_iterate_end    LIST_ITERATE_END

Definition at line 183 of file settings.h.

◆ settings_iterate

#define settings_iterate (   _level,
  _pset 
)
Value:
{ \
char * incite_cost
Definition comments.c:76
struct setting_list * settings_list_get(enum sset_level level)
Definition settings.c:5575

Definition at line 188 of file settings.h.

◆ settings_iterate_end

#define settings_iterate_end
Value:
} \
}
#define setting_list_iterate_end
Definition settings.h:183

Definition at line 194 of file settings.h.

◆ SPECENUM_COUNT [1/2]

#define SPECENUM_COUNT   SSET_NUM_CATEGORIES

Definition at line 53 of file settings.h.

◆ SPECENUM_COUNT [2/2]

#define SPECENUM_COUNT   OLEVELS_NUM

Definition at line 53 of file settings.h.

◆ SPECENUM_NAME [1/2]

Definition at line 37 of file settings.h.

◆ SPECENUM_NAME [2/2]

Definition at line 37 of file settings.h.

◆ SPECENUM_VALUE0 [1/2]

#define SPECENUM_VALUE0   SSET_GEOLOGY

Definition at line 38 of file settings.h.

◆ SPECENUM_VALUE0 [2/2]

#define SPECENUM_VALUE0   SSET_NONE

Definition at line 38 of file settings.h.

◆ SPECENUM_VALUE0NAME [1/2]

#define SPECENUM_VALUE0NAME   N_("Geological")

Definition at line 39 of file settings.h.

◆ SPECENUM_VALUE0NAME [2/2]

#define SPECENUM_VALUE0NAME   N_("?ssetlevel:None")

Definition at line 39 of file settings.h.

◆ SPECENUM_VALUE1 [1/2]

#define SPECENUM_VALUE1   SSET_SOCIOLOGY

Definition at line 40 of file settings.h.

◆ SPECENUM_VALUE1 [2/2]

#define SPECENUM_VALUE1   SSET_ALL

Definition at line 40 of file settings.h.

◆ SPECENUM_VALUE1NAME [1/2]

#define SPECENUM_VALUE1NAME   N_("Sociological")

Definition at line 41 of file settings.h.

◆ SPECENUM_VALUE1NAME [2/2]

#define SPECENUM_VALUE1NAME   N_("All")

Definition at line 41 of file settings.h.

◆ SPECENUM_VALUE2 [1/2]

#define SPECENUM_VALUE2   SSET_ECONOMICS

Definition at line 42 of file settings.h.

◆ SPECENUM_VALUE2 [2/2]

#define SPECENUM_VALUE2   SSET_VITAL

Definition at line 42 of file settings.h.

◆ SPECENUM_VALUE2NAME [1/2]

#define SPECENUM_VALUE2NAME   N_("Economic")

Definition at line 43 of file settings.h.

◆ SPECENUM_VALUE2NAME [2/2]

#define SPECENUM_VALUE2NAME   N_("Vital")

Definition at line 43 of file settings.h.

◆ SPECENUM_VALUE3 [1/2]

#define SPECENUM_VALUE3   SSET_MILITARY

Definition at line 44 of file settings.h.

◆ SPECENUM_VALUE3 [2/2]

#define SPECENUM_VALUE3   SSET_SITUATIONAL

Definition at line 44 of file settings.h.

◆ SPECENUM_VALUE3NAME [1/2]

#define SPECENUM_VALUE3NAME   N_("Military")

Definition at line 45 of file settings.h.

◆ SPECENUM_VALUE3NAME [2/2]

#define SPECENUM_VALUE3NAME   N_("Situational")

Definition at line 45 of file settings.h.

◆ SPECENUM_VALUE4 [1/2]

#define SPECENUM_VALUE4   SSET_SCIENCE

Definition at line 46 of file settings.h.

◆ SPECENUM_VALUE4 [2/2]

#define SPECENUM_VALUE4   SSET_RARE

Definition at line 46 of file settings.h.

◆ SPECENUM_VALUE4NAME [1/2]

#define SPECENUM_VALUE4NAME   N_("Scientific")

Definition at line 47 of file settings.h.

◆ SPECENUM_VALUE4NAME [2/2]

#define SPECENUM_VALUE4NAME   N_("Rare")

Definition at line 47 of file settings.h.

◆ SPECENUM_VALUE5 [1/2]

#define SPECENUM_VALUE5   SSET_INTERNAL

Definition at line 48 of file settings.h.

◆ SPECENUM_VALUE5 [2/2]

#define SPECENUM_VALUE5   SSET_CHANGED

Definition at line 48 of file settings.h.

◆ SPECENUM_VALUE5NAME [1/2]

#define SPECENUM_VALUE5NAME   N_("Internal")

Definition at line 49 of file settings.h.

◆ SPECENUM_VALUE5NAME [2/2]

#define SPECENUM_VALUE5NAME   N_("Changed")

Definition at line 49 of file settings.h.

◆ SPECENUM_VALUE6 [1/2]

#define SPECENUM_VALUE6   SSET_NETWORK

Definition at line 50 of file settings.h.

◆ SPECENUM_VALUE6 [2/2]

#define SPECENUM_VALUE6   SSET_LOCKED

Definition at line 50 of file settings.h.

◆ SPECENUM_VALUE6NAME [1/2]

#define SPECENUM_VALUE6NAME   N_("Networking")

Definition at line 51 of file settings.h.

◆ SPECENUM_VALUE6NAME [2/2]

#define SPECENUM_VALUE6NAME   N_("Locked")

Definition at line 51 of file settings.h.

◆ SPECLIST_TAG

#define SPECLIST_TAG   setting

Definition at line 177 of file settings.h.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct setting

Definition at line 178 of file settings.h.

Enumeration Type Documentation

◆ setting_lock_level

Enumerator
SLOCK_NONE 
SLOCK_RULESET 
SLOCK_ADMIN 

Definition at line 76 of file settings.h.

Function Documentation

◆ read_enum_value()

int read_enum_value ( const struct setting pset)

◆ 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 5406 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 5275 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 5438 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 5394 of file settings.c.

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

◆ setting_action()

void setting_action ( const struct setting pset)

Execute the action callback if needed.

Definition at line 4369 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 4688 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 4668 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 4088 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 4257 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 4065 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 4223 of file settings.c.

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

◆ 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 4244 of file settings.c.

Referenced by set_command().

◆ setting_bool_get()

bool setting_bool_get ( struct setting pset)

Get value of boolean setting

Definition at line 3676 of file settings.c.

Referenced by save_game_ruleset(), and server_ss_val_bool_get().

◆ 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 3657 of file settings.c.

Referenced by set_command(), and setting_game_restore().

◆ 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 3688 of file settings.c.

Referenced by set_command().

◆ 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 3378 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 5604 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 4303 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 3870 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 4022 of file settings.c.

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

◆ 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 3893 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 4051 of file settings.c.

Referenced by set_command().

◆ 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 3350 of file settings.c.

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

◆ 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 5612 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 3788 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 3733 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 3724 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 3743 of file settings.c.

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

◆ 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 3763 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 3460 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_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 3506 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 3496 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 3370 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 4640 of file settings.c.

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

◆ 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 4614 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 4676 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 4656 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 4648 of file settings.c.

Referenced by manual_settings(), and save_game_ruleset().

◆ setting_set_to_default()

void setting_set_to_default ( struct setting pset)

Update the setting to the default value

Definition at line 4339 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 3341 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 3859 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 3814 of file settings.c.

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

◆ 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 3834 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 5254 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 4913 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 5195 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 4825 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 4812 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 5212 of file settings.c.

Referenced by main(), and srv_prepare().

◆ 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 5575 of file settings.c.

◆ settings_list_update()

void settings_list_update ( void  )

Update sorted settings (changed and locked values).

Definition at line 5533 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 5266 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 5232 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 4379 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 5246 of file settings.c.

Referenced by end_turn().