26 #define LOG_NG LOG_STREAM(info, log_engine)
27 #define ERR_NG LOG_STREAM(err, log_engine)
30 #define LOG_CF LOG_STREAM(info, log_config)
31 #define WRN_CF LOG_STREAM(warn, log_config)
32 #define ERR_CF LOG_STREAM(err, log_config)
35 #define LOG_NW LOG_STREAM(info, log_network)
36 #define ERR_NW LOG_STREAM(err, log_network)
72 if(scenario[
"objectives"].empty()) {
74 std::ostringstream ss;
76 ss <<
t_string(
N_(
"Victory:"),
"wesnoth") <<
"</big>\n";
78 ss <<
t_string(
N_(
"Defeat enemy leader(s)"),
"wesnoth") <<
"</span>";
80 scenario[
"objectives"] = ss.str();
99 auto era_cfg =
game_config.find_child(
"era",
"id", era);
102 if(params.
saved_game == saved_game_mode::type::no) {
107 WRN_CF <<
"Missing era in MP load game '" << era <<
"'";
110 level.add_child(
"era", *era_cfg);
114 const config& custom_side =
game_config.find_mandatory_child(
"multiplayer_side",
"id",
"Custom");
115 level.mandatory_child(
"era").add_child_at(
"multiplayer_side", custom_side, 0);
121 for(
unsigned i = 0;
i < mods.size(); ++
i) {
122 if(
auto mod_cfg =
game_config.find_child(
"modification",
"id", mods[
i])) {
123 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)
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