add third argument to recorder.user_input

the third argument is from_side which is part of a contruct to prevent cheating in mp.
This commit is contained in:
gfgtdf 2014-03-26 22:28:53 +01:00
parent 1465f0c664
commit bce9467f30
2 changed files with 11 additions and 3 deletions

View File

@ -295,10 +295,18 @@ void replay::add_seed(const char* child_name, int seed)
random()->child(child_name)["seed"] = seed;
}
void replay::user_input(const std::string &name, const config &input)
void replay::user_input(const std::string &name, const config &input, int from_side)
{
config* const cmd = add_command();
(*cmd)["dependent"] = true;
if(from_side == -1)
{
(*cmd)["from_side"] = "server";
}
else
{
(*cmd)["from_side"] = from_side;
}
cmd->add_child(name, input);
}
@ -1040,7 +1048,7 @@ static config get_user_choice_internal(const std::string &name, const mp_sync::u
DBG_REPLAY << "MP synchronization: local choice\n";
config cfg = uch.query_user();
recorder.user_input(name, cfg);
recorder.user_input(name, cfg, side);
return cfg;
}

View File

@ -72,7 +72,7 @@ public:
config& get_last_real_command();
void add_seed(const char* child_name, int seed);
void user_input(const std::string &, const config &);
void user_input(const std::string &, const config &, int from_side);
void add_label(const terrain_label*);
void clear_labels(const std::string&, bool);
void add_rename(const std::string& name, const map_location& loc);