Added a new add_log_event() function...

...to record variables that should be put into the upload log. 

Changed --label code to use it.
This commit is contained in:
Gregory Shikhman 2009-08-19 14:45:10 +00:00
parent bff1f32b76
commit b1ff37b8d2
4 changed files with 13 additions and 2 deletions

View file

@ -929,7 +929,7 @@ bool game_controller::play_multiplayer_mode()
}
upload_log log( all_ai && uploader_settings::new_uploader );
level.add_child("ai_log")["label"] = label;
recorder.add_log_data("ai_label",label);;
state_.snapshot = level;
play_game(disp(),state_,game_config_,log);

View file

@ -377,6 +377,12 @@ void replay::add_event(const std::string& name, const map_location& loc)
(*cmd)["undo"] = "no";
}
void replay::add_log_data(const std::string &key, const std::string &var)
{
config* const ulog = &add_command(false)->add_child("upload_log");
(*ulog)[key] = var;
}
void replay::add_checksum_check(const map_location& loc)
{
if(! game_config::mp_debug) {

View file

@ -65,7 +65,8 @@ public:
const map_location& loc=map_location::null_location);
void add_unit_checksum(const map_location& loc,config* const cfg);
void add_checksum_check(const map_location& loc);
void add_log_data(const std::string &key, const std::string &var);
/**
* Mark an expected advancement adding it to the queue
*/

View file

@ -281,6 +281,10 @@ void upload_log::read_replay()
}
}
}
if(c.child_count("upload_log")) {
game_->merge_with(c.child("upload_log"));
}
}
}