@@ -1719,6 +1719,29 @@ void server::handle_join_server_queue(player_iterator p, simple_wml::node& data)
17191719 game.set_attr_int (" countdown_reservoir_time" , queue.settings [" countdown_reservoir_time" ].to_int ());
17201720 game.set_attr_int (" countdown_action_bonus" , queue.settings [" countdown_action_bonus" ].to_int ());
17211721
1722+ game.set_attr_dup (" modifications" , queue.settings [" modifications" ].str ().c_str ());
1723+
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::map<std::string, std::string> from_types = {
1727+ {" multiplayer" , " multiplayer" },
1728+ {" era" , " era" },
1729+ {" modification" , " modification" },
1730+ {" campaign" , " campaign" },
1731+ };
1732+ for (const config& qoptions : queue.settings .child_range (" options" )) {
1733+ simple_wml::node& options = game.add_child (from_types[qoptions[" from_type" ].str ()].c_str ());
1734+ options.set_attr_dup (" id" , qoptions[" from_id" ].str ().c_str ());
1735+
1736+ for (const config& qoption : qoptions.child_range (" option" )) {
1737+ simple_wml::node& option = options.add_child (" option" );
1738+ option.set_attr_dup (" id" , qoption[" id" ].str ().c_str ());
1739+ option.set_attr_dup (" value" , qoption[" value" ].str ().c_str ());
1740+ }
1741+ }
1742+
1743+ PLAIN_LOG << simple_wml::node_to_string (game);
1744+
17221745 // tell the final player to create and host the game
17231746 send_to_player (p, create_game_doc);
17241747 } else {
0 commit comments