27 #define LOG_NG LOG_STREAM(info, log_engine)
28 #define ERR_NG LOG_STREAM(err, log_engine)
31 #define LOG_CF LOG_STREAM(info, log_config)
32 #define WRN_CF LOG_STREAM(warn, log_config)
33 #define ERR_CF LOG_STREAM(err, log_config)
36 #define LOG_NW LOG_STREAM(info, log_network)
37 #define ERR_NW LOG_STREAM(err, log_network)
73 if(scenario[
"objectives"].empty()) {
75 std::ostringstream ss;
79 scenario[
"objectives"] = ss.str();
98 auto era_cfg =
game_config.find_child(
"era",
"id", era);
101 if(params.
saved_game == saved_game_mode::type::no) {
106 WRN_CF <<
"Missing era in MP load game '" << era <<
"'";
109 level.add_child(
"era", *era_cfg);
113 const config& custom_side =
game_config.find_mandatory_child(
"multiplayer_side",
"id",
"Custom");
114 level.mandatory_child(
"era").add_child_at(
"multiplayer_side", custom_side, 0);
120 for(
unsigned i = 0;
i < mods.size(); ++
i) {
121 if(
auto mod_cfg =
game_config.find_child(
"modification",
"id", mods[
i])) {
122 level.add_child(
"modification", *mod_cfg);
A config object defines a single node in a WML file, with access to child nodes.
std::string difficulty
The difficulty level the game is being played on.
std::vector< std::string > active_mods
std::string campaign
The id of the campaign being played.
std::string campaign_name
The name of the campaign being played.
static game_config_manager * get()
const game_config_view & game_config() const
A class grating read only view to a vector of config objects, viewed as one config with all children ...
game_classification & classification()
void set_random_seed()
sets the random seed if that didn't already happen.
void expand_mp_options()
adds values of [option]s into [carryover_sides_start][variables] so that they are applied in the next...
std::string get_scenario_id() const
mp_game_settings & mp_settings()
Multiplayer parameters for this game.
config & get_starting_point()
void expand_mp_events()
adds [event]s from [era] and [modification] into this scenario does NOT expand [option]s because vari...
void expand_random_scenario()
takes care of generate_map=, generate_scenario=, map= attributes This should be called before expandi...
void set_defaults()
does some post loading stuff must be used before passing the data to connect_engine
std::string str() const
Serializes the version number into string form.
Definitions for the interface to Wesnoth Markup Language (WML).
Standard logging facilities (interface).
static lg::log_domain log_engine("engine")
static lg::log_domain log_network("network")
static lg::log_domain log_config("config")
const std::string unicode_bullet
Game configuration data as global variables.
const version_info wesnoth_version(VERSION)
std::string tag(const std::string &tag_name, Args &&... contents)
std::string span_color(const color_t &color, Args &&... data)
Main entry points of multiplayer mode.
config initial_level_config(saved_game &state)
void level_to_gamestate(const config &level, saved_game &state)
static void add_multiplayer_classification(config &multiplayer, saved_game &state)
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
saved_game_mode::type saved_game