26 #define ERR_NG LOG_STREAM(err, log_engine)
27 #define WRN_NG LOG_STREAM(warn, log_engine)
28 #define LOG_NG LOG_STREAM(info, log_engine)
29 #define DBG_NG LOG_STREAM(debug, log_engine)
46 mp_countdown_init_time(0),
47 mp_countdown_reservoir_time(0),
48 mp_countdown_turn_bonus(0),
49 mp_countdown_action_bonus(0),
65 :
name(cfg[
"scenario"].str())
67 , hash(cfg[
"hash"].str())
68 , mp_era(cfg[
"mp_era"].str())
69 , mp_scenario(cfg[
"mp_scenario"].str())
70 , mp_scenario_name(cfg[
"mp_scenario_name"].str())
71 , mp_campaign(cfg[
"mp_campaign"].str())
72 , active_mods(
utils::
split(cfg[
"active_mods"],
','))
74 , show_connect(cfg[
"show_connect"].to_bool(true))
75 , num_turns(cfg[
"mp_num_turns"])
78 ,
xp_modifier(cfg[
"experience_modifier"].to_int(100))
79 , mp_countdown_init_time(cfg[
"mp_countdown_init_time"])
80 , mp_countdown_reservoir_time(cfg[
"mp_countdown_reservoir_time"])
81 , mp_countdown_turn_bonus(cfg[
"mp_countdown_turn_bonus"])
82 , mp_countdown_action_bonus(cfg[
"mp_countdown_action_bonus"])
83 , mp_countdown(cfg[
"mp_countdown"].to_bool())
86 , fog_game(cfg[
"mp_fog"].to_bool())
87 , shroud_game(cfg[
"mp_shroud"].to_bool())
92 ,
random_faction_mode(cfg[
"random_faction_mode"].to_enum<RANDOM_FACTION_MODE>(RANDOM_FACTION_MODE::DEFAULT))
93 ,
options(cfg.child_or_empty(
"options"))
97 if (!
a[
"id"].empty()) {
107 cfg[
"scenario"] =
name;
136 typedef std::map<std::string,addon_version_info>::value_type ttt;
150 if (!cfg[
"version"].empty()) {
151 version = cfg[
"version"].str();
153 if (!cfg[
"min_version"].empty()) {
163 cfg[
"min_version"] = *min_version;
168 if (cfg[
"id"].empty()) {
169 WRN_NG <<
"Tried to add add-on metadata to a game, missing mandatory id field... skipping.\n" << cfg.
debug() <<
"\n";
183 WRN_NG <<
"Addon version data mismatch -- not all local WML has same version of '" << cfg[
"id"].str() <<
"' addon.\n";
187 WRN_NG <<
"Addon version data mismatch -- not all local WML has same version of '" << cfg[
"id"].str() <<
"' addon.\n";
196 addons.insert(std::make_pair(cfg[
"id"].str(), new_data));
child_itors child_range(const std::string &key)
boost::optional< version_info > version
std::string join_map(const T &v, const std::string &major=",", const std::string &minor=":")
std::string random_faction_mode()
static lg::log_domain log_engine("engine")
std::map< std::string, std::string > map_split(std::string const &val, char major, char minor, int flags, std::string const &default_value)
Splits a string based on two separators into a map.
boost::optional< version_info > min_version
std::string debug() const
std::string mp_scenario_name
std::vector< std::string > active_mods
int mp_countdown_action_bonus
GLboolean GLboolean GLboolean GLboolean a
void update_addon_requirements(const config &addon_cfg)
config & add_child(const std::string &key)
bool registered_users_only()
addon_version_info(const config &)
std::string join(T const &v, const std::string &s=",")
Generates a new string joining container items in a list.
int mp_countdown_reservoir_time
int mp_countdown_init_time
std::map< std::string, addon_version_info > addons
std::map< std::string, std::string > side_users
GLuint const GLchar * name
Standard logging facilities (interface).
void write(config &) const
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
int mp_countdown_turn_bonus
A config object defines a single node in a WML file, with access to child nodes.
bool registered_users_only
const std::string version