Merge pull request #554 from wesnoth/gfgtdf-patch-2
Mute false positive OOS reports when recalling
This commit is contained in:
commit
9f967ff0d1
1 changed files with 28 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "player_network.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
#include "util.hpp"
|
||||
#include "utils/foreach.tpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
|
@ -921,6 +922,13 @@ bool game::process_turn(simple_wml::document& data, const player_map::const_iter
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((**command).child("recall") || (**command).child("recruit")) {
|
||||
simple_wml::node& command_r = **command;
|
||||
// remove all [checkup] from recruit or replay [command]s, this fixes some false positive OOS reports caused by differences in unit checksum calculation between 1.12.4. and 1.12.5
|
||||
while(command_r.child("checkup")) {
|
||||
command_r.remove_child("checkup", 0);
|
||||
}
|
||||
}
|
||||
else if((**command).has_attr("from_side"))
|
||||
{
|
||||
if((**command)["from_side"] == "server")
|
||||
|
@ -1032,7 +1040,26 @@ void game::process_whiteboard(simple_wml::document& data, const player_map::cons
|
|||
{
|
||||
std::ostringstream msg;
|
||||
msg << "Ignoring illegal whiteboard data, sent from user '" << user->second.name()
|
||||
<< "' to team '" << std::string(team_name.begin(), team_name.end()) << "'." << std::endl;
|
||||
<< "' to team '" << std::string(team_name.begin(), team_name.end()) << "'";
|
||||
if(side_num < 1 || side_num > gamemap::MAX_PLAYERS) {
|
||||
msg << " (invalid side number '" << side_num << "')";
|
||||
}
|
||||
else if(sides_[side_num-1] != user->first) {
|
||||
msg << " (player doesn't control side '" << side_num << "')";
|
||||
}
|
||||
else {
|
||||
FOREACH(AUTO p_side, level_.root().children("side"))
|
||||
{
|
||||
if((*p_side)["side"].to_int() == int(side_num)) {
|
||||
if((*p_side)["team_name"] != team_name) {
|
||||
msg << "(side '" << side_num << "' is on team '" << (*p_side)["team_name"] << "')";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
msg << "." << std::endl;
|
||||
|
||||
const std::string& msg_str = msg.str();
|
||||
LOG_GAME << msg_str << std::endl;
|
||||
send_and_record_server_message(msg_str);
|
||||
|
|
Loading…
Add table
Reference in a new issue