Skip to content

Commit b931d32

Browse files
committed
address review comments 2
1 parent d457a91 commit b931d32

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

src/server/wesnothd/server.cpp

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,31 +1721,20 @@ void server::handle_join_server_queue(player_iterator p, simple_wml::node& data)
17211721

17221722
game.set_attr_dup("modifications", queue.settings["modifications"].str().c_str());
17231723

1724-
// can't directly assign from the config since simple_wml doesn't own the value of the child tag name
1725-
// so need this workaround otherwise it tries to send for example: []...[/] instead of [multiplayer]...[/multiplayer]
1726-
static std::set<std::string> from_types = {
1727-
"multiplayer",
1728-
"era",
1729-
"modification",
1730-
"campaign",
1731-
};
17321724
for(const config& qoptions : queue.settings.child_range("options")) {
1733-
auto type = from_types.find(qoptions["from_type"].str());
1734-
if(type != from_types.end()) {
1725+
for(const config& option_type : qoptions.child_range("multiplayer")) {
17351726
simple_wml::node& options = game.add_child("options");
1736-
simple_wml::node& option_type = options.add_child(type->c_str());
1737-
option_type.set_attr_dup("id", qoptions["from_id"].str().c_str());
1727+
simple_wml::node& type = options.add_child("multiplayer");
1728+
type.set_attr_dup("id", option_type["id"].str().c_str());
17381729

1739-
for(const config& qoption : qoptions.child_range("option")) {
1740-
simple_wml::node& option = option_type.add_child("option");
1730+
for(const config& qoption : option_type.child_range("option")) {
1731+
simple_wml::node& option = type.add_child("option");
17411732
option.set_attr_dup("id", qoption["id"].str().c_str());
17421733
option.set_attr_dup("value", qoption["value"].str().c_str());
17431734
}
17441735
}
17451736
}
17461737

1747-
PLAIN_LOG << simple_wml::node_to_string(game);
1748-
17491738
// tell the final player to create and host the game
17501739
send_to_player(p, create_game_doc);
17511740
} else {

0 commit comments

Comments
 (0)