44#define enough_new_user_flags(_new_flags_, _name_, \
45 _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_) \
46FC_STATIC_ASSERT((ARRAY_SIZE(_new_flags_) \
47 <= _LAST_USER_FLAG_ - _LAST_USER_FLAG_PREV_), \
48 not_enough_new_##_name_##_user_flags)
50#define UTYF_LAST_USER_FLAG_3_0 UTYF_USER_FLAG_40
51#define UCF_LAST_USER_FLAG_3_0 UCF_USER_FLAG_8
52#define TER_LAST_USER_FLAG_3_0 TER_USER_8
59 memset(info, 0,
sizeof(*info));
75 log_fatal(
"\"%s\": ruleset capability problem:", filename);
94 log_fatal(
"\"%s\": ruleset datafile appears incompatible:", filename);
102 log_fatal(
"\"%s\": ruleset datafile claims required option(s)"
103 " that we don't support:", filename);
113 log_error(
"\"%s\": lacking legal format_version field", filename);
117 }
else if (format == 0) {
118 log_error(
"\"%s\": Illegal format_version value", filename);
132 const char *filename,
146 log_fatal(
"\"%s\": ruleset datafile format version differs from"
147 " other ruleset datafile(s):", filename);
180 if (
problem->num_suggested_solutions == 0) {
183 log_error(
"While adding hard obligatory reqs to action enabler"
185 " Don't know how to fix it."
188 ae->ruledit_disabled =
TRUE;
199 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
218 log_warn(
"While adding hard obligatory reqs to action enabler"
222 ae->ruledit_disabled =
TRUE;
228 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
240 log_error(
"While adding hard obligatory reqs to action enabler"
242 "Failed to apply solution %s."
253 if (
problem->num_suggested_solutions - 1 ==
i) {
288 log_normal(
"action enablers: adding obligatory hard requirements.");
289 log_warn(
"More than one way to fulfill a new obligatory hard requirement"
291 " In that case the enabler is copied so each alternative"
292 " solution is applied to a copy of the enabler."
293 " If an action enabler becomes self contradicting after applying"
294 " a solution it is dropped."
295 " Note that other copies of the original enabler may have"
296 " survived even if one copy is dropped.");
304 if (
ae->ruledit_disabled) {
521 "Replaced 'alltemperate' server setting requirement "
522 "in %s with a MinLatitude requirement. Other "
523 "equivalent requirements are possible; make sure it "
541 "Replaced 'singlepole' server setting requirement "
542 "in %s with a MaxLatitude requirement. Other "
543 "equivalent requirements are possible; make sure it "
569 "CleanAsFallout",
NULL);
578 const char *old_name)
580 const char *
retname = old_name;
670 "%s.set%d.lock",
section, j)) {
681#define SET_INT_SETTING(name, value, lock) \
682 pset = setting_by_name(name); \
683 fc_assert(pset != NULL && setting_type(pset) == SST_INT); \
685 if (setting_int_set(pset, value, NULL, reject_msg, \
686 sizeof(reject_msg))) { \
687 log_normal(_("Ruleset: '%s' has been set to %s."), \
688 setting_name(pset), \
689 setting_value_name(pset, TRUE, buf, sizeof(buf))); \
691 log_error("%s", reject_msg); \
697 setting_ruleset_lock_set(pset); \
698 log_normal(_("Ruleset: '%s' has been locked by the ruleset."), \
699 setting_name(pset)); \
705#undef SET_INT_SETTING
788 return "ui_name_transport_alight";
790 return "ui_name_road";
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
const char * action_rule_name(const struct action *action)
void action_enabler_add(struct action_enabler *enabler)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
struct action_enabler_list * action_enablers_for_action(action_id action)
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
#define action_enablers_iterate_end
#define enabler_get_action(_enabler_)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define action_iterate_end
#define action_enablers_iterate(_enabler_)
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
#define BV_ISSET(bv, bit)
bool has_capabilities(const char *us, const char *them)
bool iterate_effect_cache(iec_cb cb, void *data)
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
struct effect * effect_copy(struct effect *old, enum effect_type override_type)
void effect_req_append(struct effect *peffect, struct requirement req)
int effect_value_will_make_positive(enum effect_type type)
#define log_warn(message,...)
#define fc_assert_ret_val(condition, val)
#define log_fatal(message,...)
#define log_normal(message,...)
#define log_error(message,...)
const char * secfile_error(void)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
const char * secfile_name(const struct section_file *secfile)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
bool secfile_lookup_bool(const struct section_file *secfile, bool *bval, const char *path,...)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
void req_vec_problem_free(struct req_vec_problem *issue)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
void rscompat_settings_do_special_handling(struct section_file *file, const char *section, void(*setdef)(struct setting *pset))
const char * rscompat_req_range_3_2(struct rscompat_info *compat, const char *type, const char *old_range)
int add_user_extra_flags_3_2(int start)
#define SET_INT_SETTING(name, value, lock)
const char * rscompat_action_ui_name_3_2(struct rscompat_info *compat, int act_id)
static bool rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae)
bool rscompat_terrain_extra_rmtime_3_2(struct section_file *file, const char *tsection, struct terrain *pterrain)
bool rscompat_names(struct rscompat_info *info)
bool rscompat_setting_needs_special_handling(const char *name)
void rscompat_postprocess(struct rscompat_info *info)
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
void rscompat_extra_adjust_3_2(struct extra_type *pextra)
void rscompat_enablers_add_obligatory_hard_reqs(void)
const char * rscompat_action_rule_name_3_2(struct rscompat_info *compat, const char *orig)
void rscompat_req_adjust_3_2(const struct rscompat_info *compat, const char **ptype, const char **pname, bool *ppresent, const char *sec_name)
static bool effect_list_compat_cb(struct effect *peffect, void *data)
enum impr_genus_id rscompat_genus_3_2(struct rscompat_info *compat, const bv_impr_flags flags, enum impr_genus_id old_genus)
void rscompat_action_enabler_adjust_3_2(struct rscompat_info *compat, struct action_enabler *enabler, const char *orig_name)
const char * rscompat_extra_rmcause_3_2(struct extra_type *pextra, const char *old_name)
void rscompat_init_info(struct rscompat_info *info)
bool rscompat_check_cap_and_version(struct section_file *file, const char *filename, const struct rscompat_info *info)
bool lookup_time(const struct section_file *secfile, int *turns, const char *sec_name, const char *property_name, const char *filename, const char *item_name, bool *ok)
#define RULESET_COMPAT_CAP
#define ruleset_error(logger, level, format,...)
#define RULESET_CAPABILITIES
static struct compatibility compat[]
int extra_removal_times[MAX_EXTRA_TYPES]
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
const char * terrain_rule_name(const struct terrain *pterrain)