mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 20:49:43 +00:00
add from_side check for require_random
"from_side" is an attribute whose only purpose is to enable a check by the server that a package is really sended by the side given in "from_side", if thats not the case, the server sets an attribute "side_invalid". The main purpose of this contruct is to disallow cheating in mp.
This commit is contained in:
parent
59a78cadf5
commit
116afcda09
@ -257,6 +257,11 @@ config synced_context::ask_server(const std::string &name, const mp_sync::user_c
|
|||||||
replay::process_error("[" + name + "] expected but none found, found instead:\n " + action->debug() + "\n");
|
replay::process_error("[" + name + "] expected but none found, found instead:\n " + action->debug() + "\n");
|
||||||
return config();
|
return config();
|
||||||
}
|
}
|
||||||
|
if((*action)["from_side"].str() != "server" || (*action)["side_invalid"].to_bool(false) )
|
||||||
|
{
|
||||||
|
//we can proceed without getting OOS in this case, but allowing this would allow a "player chan choose their attack results in mp" cheat
|
||||||
|
replay::process_error("wrong from_side or side_invalid this could mean someone wants to cheat\n");
|
||||||
|
}
|
||||||
return action->child(name);
|
return action->child(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user