mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 16:28:40 +00:00
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:
parent
1465f0c664
commit
bce9467f30
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user