Freeciv-3.3
|
#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 |
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 } |
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) | |
#define GEN_BITWISE | ( | name, | |
value, | |||
sclass, | |||
scateg, | |||
slevel, | |||
al_read, | |||
al_write, | |||
short_help, | |||
extra_help, | |||
func_validate, | |||
func_action, | |||
func_name, | |||
_default | |||
) |
Definition at line 1463 of file settings.c.
#define GEN_BOOL | ( | name, | |
value, | |||
sclass, | |||
scateg, | |||
slevel, | |||
al_read, | |||
al_write, | |||
short_help, | |||
extra_help, | |||
func_validate, | |||
func_action, | |||
_default | |||
) |
Definition at line 1412 of file settings.c.
#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 | |||
) |
Definition at line 1452 of file settings.c.
#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 | |||
) |
Definition at line 1421 of file settings.c.
#define GEN_STRING | ( | name, | |
value, | |||
sclass, | |||
scateg, | |||
slevel, | |||
al_read, | |||
al_write, | |||
short_help, | |||
extra_help, | |||
func_validate, | |||
func_action, | |||
_default | |||
) |
Definition at line 1432 of file settings.c.
#define GEN_STRING_NRS | ( | name, | |
value, | |||
sclass, | |||
scateg, | |||
slevel, | |||
al_read, | |||
al_write, | |||
short_help, | |||
extra_help, | |||
func_validate, | |||
func_action, | |||
_default | |||
) |
Definition at line 1442 of file settings.c.
Definition at line 224 of file settings.c.
Definition at line 206 of file settings.c.
Definition at line 88 of file settings.c.
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.
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.
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.
Definition at line 89 of file settings.c.
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.
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.
typedef const struct sset_val_name *(* val_name_func_t) (int value) |
Definition at line 89 of file settings.c.
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.
Create the selected number of AI's.
Definition at line 705 of file settings.c.
|
static |
AI level names accessor.
Definition at line 605 of file settings.c.
|
static |
Airlifting style setting names accessor.
Definition at line 533 of file settings.c.
Change the default AI type.
Definition at line 875 of file settings.c.
|
static |
AI type setting validation callback.
Definition at line 1357 of file settings.c.
|
static |
Verify that a given allowtake string is valid. See game.allow_take.
Definition at line 999 of file settings.c.
|
static |
Autosaves setting callback
Definition at line 973 of file settings.c.
|
static |
Autosaves setting names accessor.
Definition at line 388 of file settings.c.
Toggle player AI status.
Definition at line 767 of file settings.c.
|
static |
Barbarian setting names accessor.
Definition at line 492 of file settings.c.
|
static |
Names accessor for boolean settings (disable/enable).
Definition at line 630 of file settings.c.
|
static |
Borders setting names accessor.
Definition at line 404 of file settings.c.
|
static |
Caravan bonus style setting names accessor.
Definition at line 234 of file settings.c.
|
static |
City names setting names accessor.
Definition at line 478 of file settings.c.
Savegame compress type names accessor.
Definition at line 579 of file settings.c.
|
static |
Verify that a given demography string is valid. See game.demography.
Definition at line 953 of file settings.c.
|
static |
Diplomacy setting names accessor.
Definition at line 460 of file settings.c.
|
static |
Verify that a given endturn is valid.
Definition at line 1099 of file settings.c.
Enact a change in the 'first_timeout' server setting immediately, if the game is afoot.
Definition at line 800 of file settings.c.
|
static |
Validate the 'first_timeout' server setting.
Definition at line 1200 of file settings.c.
|
static |
Generator setting names accessor.
Definition at line 302 of file settings.c.
|
static |
Verify the value of the generator option (notably the MAPGEN_SCENARIO case).
Definition at line 910 of file settings.c.
|
static |
Happyborders setting names accessor.
Definition at line 447 of file settings.c.
Clean out absolute number of huts when relative setting set.
Definition at line 820 of file settings.c.
Help about huts setting
Definition at line 666 of file settings.c.
|
static |
Mapsize setting validation callback.
Definition at line 1244 of file settings.c.
|
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.
|
static |
Verify that a given maxplayers is valid.
Definition at line 1114 of file settings.c.
Update metaserver message string from changed user meta server message string.
Definition at line 859 of file settings.c.
Restrict to the selected nation set.
Definition at line 718 of file settings.c.
|
static |
Validate the 'nationset' server setting.
Definition at line 1141 of file settings.c.
|
static |
Persistentready setting names accessor.
Definition at line 358 of file settings.c.
Help about phasemode setting
Definition at line 648 of file settings.c.
|
static |
Phase mode names accessor.
Definition at line 551 of file settings.c.
Referenced by phasemode_help().
Clear any user-set player colors in modes other than PLRCOL_PLR_SET.
Definition at line 751 of file settings.c.
|
static |
Player colors configuration setting names accessor.
Definition at line 432 of file settings.c.
|
static |
Validate that the player color mode can be used.
Definition at line 1393 of file settings.c.
Helper function to read value from enumerator setting
Definition at line 3995 of file settings.c.
Referenced by plrcol_action(), save_game_ruleset(), send_server_setting(), setting_game_set(), setting_non_default(), setting_ruleset_one(), setting_value_name(), settings_game_load(), and settings_game_save().
|
static |
Revealmap setting names accessor.
Definition at line 521 of file settings.c.
|
static |
Revolution length type setting names accessor.
Definition at line 507 of file settings.c.
|
static |
Verify the selected savename definition.
Definition at line 889 of file settings.c.
|
static |
Verify the name for the score log file.
Definition at line 936 of file settings.c.
(De)initialze the score log.
Definition at line 693 of file settings.c.
|
static |
Scorelog level names accessor.
Definition at line 566 of file settings.c.
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().
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().
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().
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().
Helper function to write value to enumerator setting
Definition at line 3961 of file settings.c.
Referenced by setting_enum_set(), setting_ruleset_one(), setting_set_to_default(), and settings_game_load().
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().
Clear admin level lock from the setting
Definition at line 4688 of file settings.c.
Referenced by settings_init(), and unlock_command().
Set admin level lock for the setting
Definition at line 4668 of file settings.c.
Referenced by lock_command().
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().
Get value of bitwise setting
Definition at line 4257 of file settings.c.
Referenced by save_game_ruleset(), and server_ss_val_bitwise_get().
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().
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().
|
static |
Compute the string representation of the value for this bitwise setting.
Definition at line 4107 of file settings.c.
Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().
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().
|
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 4172 of file settings.c.
Referenced by setting_bitwise_set(), and setting_bitwise_validate().
Get value of boolean setting
Definition at line 3676 of file settings.c.
Referenced by save_game_ruleset(), and server_ss_val_bool_get().
|
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 3702 of file settings.c.
Referenced by setting_ruleset_one().
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().
|
static |
Compute the string representation of the value for this boolean setting.
Definition at line 3607 of file settings.c.
Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().
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().
|
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 3628 of file settings.c.
Referenced by setting_bool_set(), and setting_bool_validate().
Returns the setting to the given name.
Definition at line 3309 of file settings.c.
Referenced by api_server_setting_get(), autolock_settings(), compat_load_030200(), metamessage_command(), sanity_check_setting_is_game_rule(), server_ss_by_name(), and srv_ready().
Returns the setting to the given id.
Definition at line 3301 of file settings.c.
Referenced by optname_accessor(), sanity_check_req_individual(), sanity_check_server_setting_value_in_req(), server_ss_name_get(), server_ss_type_get(), server_ss_val_bitwise_get(), server_ss_val_bool_get(), server_ss_val_int_get(), settings_list_init(), settings_list_update(), show_help_option(), show_settings(), and validate_setting_arg().
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().
Mark setting changed
Definition at line 5604 of file settings.c.
Referenced by metamessage_command(), and set_command().
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().
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().
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().
|
static |
Compute the string representation of the value for this enumerator setting.
Definition at line 3912 of file settings.c.
Referenced by setting_default_name(), setting_game_restore(), and setting_value_name().
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().
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().
|
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 3934 of file settings.c.
Referenced by setting_enum_set(), and setting_enum_validate().
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().
Free the memory used for the settings at game start.
Definition at line 4740 of file settings.c.
Referenced by settings_free().
Restore the setting to the value used at the start of the current game.
Definition at line 4750 of file settings.c.
Referenced by settings_game_reset().
Save the setting value of the current game.
Definition at line 4700 of file settings.c.
Referenced by settings_game_start(), and settings_init().
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().
Get value of integer setting
Definition at line 3788 of file settings.c.
Referenced by save_game_ruleset(), and server_ss_val_int_get().
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().
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().
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().
|
static |
Compute the string representation of the value for this integer setting.
Definition at line 3713 of file settings.c.
Referenced by setting_default_name(), and setting_value_name().
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().
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().
|
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 3388 of file settings.c.
Referenced by setting_is_changeable(), and settings_game_save().
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().
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().
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().
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().
|
static |
Convert the string prefix to an integer representation. NB: This function is used for SST_ENUM and SST_BITWISE.
Definition at line 3565 of file settings.c.
Referenced by setting_bitwise_validate_base(), setting_bool_validate_base(), and setting_enum_validate_base().
|
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 3520 of file settings.c.
Referenced by setting_match_prefix().
Access function for the setting name.
Definition at line 3333 of file settings.c.
Referenced by manual_settings(), optname_accessor(), save_game_ruleset(), send_server_setting_control(), server_ss_name_get(), set_command(), setcompat_S3_2_val_from_S3_1(), setting_bitwise_secfile_str(), setting_default_name(), setting_game_restore(), setting_is_changeable(), setting_is_free_to_change(), setting_non_default(), setting_ruleset_one(), setting_value_name(), settings_game_load(), settings_game_save(), settings_list_cmp(), settings_list_init(), show_help_option(), show_help_option_list(), show_settings(), show_settings_one(), srv_ready(), tolua_server_server_setting_get00(), and write_init_script().
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().
Returns the id to the given setting.
Definition at line 3324 of file settings.c.
Referenced by manual_settings(), send_server_setting_control(), server_ss_by_name(), setting_default_name(), setting_is_free_to_change(), setting_non_default(), and setting_value_name().
Clear ruleset level lock from the setting
Definition at line 4676 of file settings.c.
Referenced by autolock_settings(), settings_init(), and settings_ruleset().
Set ruleset level lock for the setting
Definition at line 4656 of file settings.c.
Referenced by autolock_settings(), and setting_ruleset_one().
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().
|
static |
Set one setting from the game.ruleset file.
Definition at line 4445 of file settings.c.
Referenced by settings_ruleset().
Mark a setting as having been set by the ruleset.
Definition at line 4437 of file settings.c.
Referenced by setting_ruleset_one().
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().
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().
Get value of string setting
Definition at line 3859 of file settings.c.
Referenced by save_game_ruleset().
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().
|
static |
Compute the string representation of the value for this string setting.
Definition at line 3798 of file settings.c.
Referenced by setting_default_name(), and setting_value_name().
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().
Access function for the setting type.
Definition at line 3362 of file settings.c.
Referenced by manual_settings(), save_game_ruleset(), send_server_setting(), server_ss_type_get(), set_command(), setting_bitwise_get(), setting_bool_get(), setting_game_free(), setting_game_restore(), setting_game_set(), setting_int_get(), setting_non_default(), setting_str_get(), settings_game_save(), show_help_option(), and show_settings_one().
const char * setting_value_name | ( | const struct setting * | pset, |
bool | pretty, | ||
char * | buf, | ||
size_t | buf_len | ||
) |
Compute the name of the current value of the setting.
Definition at line 4267 of file settings.c.
Referenced by api_server_setting_get(), compat_load_030200(), manual_settings(), set_command(), setting_ruleset_one(), settings_game_load(), show_help_option(), show_settings_one(), srv_ready(), and write_init_script().
Deinitialize stuff related to this code module.
Definition at line 5254 of file settings.c.
Referenced by server_quit().
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().
Reset all settings to the values at game start.
Definition at line 5195 of file settings.c.
Referenced by reset_command().
void settings_game_save | ( | struct section_file * | file, |
const char * | section | ||
) |
Save setting values at the start of the game.
Definition at line 4812 of file settings.c.
Referenced by srv_ready().
Initialize stuff related to this code module.
Definition at line 5212 of file settings.c.
Referenced by main(), and srv_prepare().
int settings_list_cmp | ( | const struct setting *const * | ppset1, |
const struct setting *const * | ppset2 | ||
) |
Update sorted settings (changed and locked values).
Definition at line 5562 of file settings.c.
Referenced by settings_list_init(), and settings_list_update().
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.
Initialise sorted settings.
Definition at line 5475 of file settings.c.
Referenced by settings_init().
Update sorted settings (changed and locked values).
Definition at line 5533 of file settings.c.
Referenced by settings_init(), and show_settings().
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().
Reset all settings iff they are changeable.
Definition at line 5232 of file settings.c.
Referenced by reset_command().
Load game settings from ruleset file 'game.ruleset'.
Definition at line 4379 of file settings.c.
Referenced by load_rulesetdir(), and reload_rulesets_settings().
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().
|
static |
Start position setting names accessor.
Definition at line 318 of file settings.c.
|
static |
Verify that a given startunits string is valid. See game.server.start_units.
Definition at line 1045 of file settings.c.
|
static |
Team placement setting names accessor.
Definition at line 338 of file settings.c.
Enact a change in the 'timeout' server setting immediately, if the game is afoot.
Definition at line 783 of file settings.c.
|
static |
Validate the 'timeout' server setting.
Definition at line 1162 of file settings.c.
Topology setting changed.
Definition at line 828 of file settings.c.
|
static |
Topology setting validation callback.
Definition at line 1321 of file settings.c.
|
static |
Topology setting names accessor.
Definition at line 262 of file settings.c.
|
static |
Trade revenue style setting names accessor.
Definition at line 288 of file settings.c.
|
static |
Trait distribution setting names accessor.
Definition at line 420 of file settings.c.
|
static |
Check 'timeout' setting if 'unitwaittime' is changed.
Definition at line 1218 of file settings.c.
|
static |
Victory conditions setting names accessor.
Definition at line 373 of file settings.c.
Map wrap setting changed.
Definition at line 843 of file settings.c.
|
static |
Map wrap setting validation callback.
Definition at line 1373 of file settings.c.
|
static |
Map wrap setting names accessor.
Definition at line 275 of file settings.c.
|
static |
xsize setting validation callback.
Definition at line 1263 of file settings.c.
|
static |
ysize setting validation callback.
Definition at line 1288 of file settings.c.
bool init |
Definition at line 189 of file settings.c.
Referenced by setting_game_set().
struct setting_list* level[OLEVELS_NUM] |
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 { ... } setting_sorted |
Referenced by settings_list_free(), settings_list_get(), settings_list_init(), and settings_list_update().
Definition at line 1474 of file settings.c.
Referenced by city_receives_goods(), reestablish_city_trade_routes(), set_city_production(), setting_by_number(), setting_number(), and update_city_activities().
|
static |
Definition at line 3296 of file settings.c.
Referenced by send_server_setting_control(), setting_by_number(), and settings_number().