Added map data to the upload log.

This commit is contained in:
Gregory Shikhman 2009-07-31 18:12:46 +00:00
parent 1f30a4ca71
commit 7944856c2f
3 changed files with 8 additions and 4 deletions

View file

@ -299,7 +299,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(
// Log before prestart events: they do weird things.
if (first_human_team_ != -1) {
log.start(gamestate_, teams_[first_human_team_], first_human_team_ + 1, units_,
loading_game_ ? gamestate_.get_variable("turn_number") : "", number_of_turns());
loading_game_ ? gamestate_.get_variable("turn_number") : "", number_of_turns(), resources::game_map->write());
}
fire_prestart(!loading_game_);

View file

@ -281,7 +281,7 @@ upload_log::~upload_log()
#elif __APPLE__
config_["platform"] = "Apple";
#else
config_["platform"] = "undefined";
config_["platform"] = "unknown";
#endif
std::ostream *out = ostream_file(filename_);
@ -332,7 +332,8 @@ void upload_log::start(game_state &state, const team &team,
int side_number,
const unit_map &units,
const t_string &turn,
int num_turns)
int num_turns,
const std::string map_data)
{
std::vector<const unit*> all_units;
@ -348,6 +349,9 @@ void upload_log::start(game_state &state, const team &team,
(*game_)["campaign"] = state.classification().campaign_define;
(*game_)["difficulty"] = state.classification().difficulty;
(*game_)["scenario"] = state.classification().scenario;
if(uploader_settings::new_uploader) {
(*game_)["map_data"] = map_data;
}
if (!state.classification().version.empty())
(*game_)["version"] = state.classification().version;
if (!turn.empty())

View file

@ -48,7 +48,7 @@ public:
// User starts a game (may be new campaign or saved).
void start(game_state &state, const team &team,
int side_number, const unit_map &map, const t_string &turn,
int num_turns);
int num_turns, const std::string map_data);
// User finishes a level.
void defeat(int turn);