mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 19:27:49 +00:00
Encoded map data so it is easier for server-side parser to read
This commit is contained in:
parent
e5f53d7cde
commit
6ed8b62309
@ -350,7 +350,13 @@ void upload_log::start(game_state &state, const team &team,
|
||||
(*game_)["difficulty"] = state.classification().difficulty;
|
||||
(*game_)["scenario"] = state.classification().scenario;
|
||||
if(uploader_settings::new_uploader) {
|
||||
(*game_)["map_data"] = map_data;
|
||||
//replace newlines in map definition with semicolons so that braindead server-side wml parser doesn't get confused
|
||||
std::string encoded_map(map_data);
|
||||
for(int idx = 0; idx < encoded_map.length(); idx++) {
|
||||
if(encoded_map[idx] == '\n')
|
||||
encoded_map[idx] = ';';
|
||||
}
|
||||
(*game_)["map_data"] = encoded_map;
|
||||
}
|
||||
if (!state.classification().version.empty())
|
||||
(*game_)["version"] = state.classification().version;
|
||||
|
Loading…
x
Reference in New Issue
Block a user