mail[Wesnoth-commits] r24978 - in /branches/1.4/src/server: game.cpp game.hpp server.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by soliton . de on March 22, 2008 - 13:12:
Author: soliton
Date: Sat Mar 22 13:12:36 2008
New Revision: 24978

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24978&view=rev
Log:
* separate out of sync termination reasons by the era used

Modified:
    branches/1.4/src/server/game.cpp
    branches/1.4/src/server/game.hpp
    branches/1.4/src/server/server.cpp

Modified: branches/1.4/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/server/game.cpp?rev=24978&r1=24977&r2=24978&view=diff
==============================================================================
--- branches/1.4/src/server/game.cpp (original)
+++ branches/1.4/src/server/game.cpp Sat Mar 22 13:12:36 2008
@@ -1144,6 +1144,17 @@
        }
 }
 
+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){

Modified: branches/1.4/src/server/game.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/server/game.hpp?rev=24978&r1=24977&r2=24978&view=diff
==============================================================================
--- branches/1.4/src/server/game.hpp (original)
+++ branches/1.4/src/server/game.hpp Sat Mar 22 13:12:36 2008
@@ -116,9 +116,7 @@
                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

Modified: branches/1.4/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/server/server.cpp?rev=24978&r1=24977&r2=24978&view=diff
==============================================================================
--- branches/1.4/src/server/server.cpp (original)
+++ branches/1.4/src/server/server.cpp Sat Mar 22 13:12:36 2008
@@ -725,7 +725,7 @@
                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<std::string>::const_iterator d_it = 
disallowed_names_.begin();
                d_it != disallowed_names_.end(); ++d_it)
        {
@@ -1438,12 +1438,6 @@
                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")) {




Related Messages


Powered by MHonArc, Updated Sat Mar 22 14:01:51 2008