diff --git a/src/server/game.cpp b/src/server/game.cpp index 5fd12224615..d2140c5483a 100644 --- a/src/server/game.cpp +++ b/src/server/game.cpp @@ -1144,6 +1144,17 @@ void game::set_description(simple_wml::node* desc) { } } +void game::set_termination_reason(const std::string& reason) { + if (reason == "out of sync") { + simple_wml::string_span era; + if (level_.child("era")) { + era = level_.child("era")->attr("id"); + } + termination_ = "out of sync - " + era.to_string(); + } + if (termination_.empty()) { termination_ = reason; } +} + void game::add_players(const game& other_game, const bool observer) { user_vector users = other_game.all_game_users(); if (observer){ diff --git a/src/server/game.hpp b/src/server/game.hpp index 7fa7d7a40cf..9cdab4e01a8 100644 --- a/src/server/game.hpp +++ b/src/server/game.hpp @@ -116,9 +116,7 @@ public: return started_ ? (termination_.empty() ? aborted : termination_) : not_started; } - void set_termination_reason(const std::string& reason) { - if (termination_.empty()) { termination_ = reason; } - } + void set_termination_reason(const std::string& reason); private: //forbidden operations diff --git a/src/server/server.cpp b/src/server/server.cpp index 7264fba9531..ea26ddf6658 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -738,7 +738,7 @@ void server::process_login(const network::connection sock, send_error(sock, "This username is too long. Usernames must be 18 characers or less."); return; } - // Check if the uername is allowed. + // Check if the username is allowed. for (std::vector::const_iterator d_it = disallowed_names_.begin(); d_it != disallowed_names_.end(); ++d_it) { @@ -1451,12 +1451,6 @@ void server::process_data_game(const network::connection sock, const simple_wml::node& info = *data.child("info"); if (info["type"] == "termination") { g->set_termination_reason(info["condition"].to_string()); - if (info["condition"] == "out of sync") { - // May be too noisy.. - LOG_SERVER << network::ip_address(sock) << "\t" << pl->second.name() - << "\treports an out of sync error in game:\t\"" - << g->name() << "\" (" << g->id() << ").\n"; - } } return; } else if (data.child("turn")) {