mail[Wesnoth-commits] r34268 - /branches/1.6/src/server/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 30, 2009 - 00:29:
Author: soliton
Date: Mon Mar 30 00:28:56 2009
New Revision: 34268

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34268&view=rev
Log:
make the diff from the right player after a kick(ban)

Modified:
    branches/1.6/src/server/server.cpp

Modified: branches/1.6/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/server/server.cpp?rev=34268&r1=34267&r2=34268&view=diff
==============================================================================
--- branches/1.6/src/server/server.cpp (original)
+++ branches/1.6/src/server/server.cpp Mon Mar 30 00:28:56 2009
@@ -2232,17 +2232,19 @@
                        }
                        // Send all other players in the lobby the update to 
the gamelist.
                        simple_wml::document diff;
-                       bool diff1 = 
make_change_diff(*games_and_users_list_.root().child("gamelist"),
+                       
make_change_diff(*games_and_users_list_.root().child("gamelist"),
                                                      "gamelist", "game", 
g->description(), diff);
-                       bool diff2 = 
make_change_diff(games_and_users_list_.root(), NULL,
-                                                     "user", 
pl->second.config_address(), diff);
-                       if (diff1 || diff2) {
-                               lobby_.send_data(diff, sock);
-                       }
+                       const wesnothd::player_map::iterator pl2 = 
players_.find(user);
+                       if (pl2 == players_.end()) {
+                               ERR_SERVER << "ERROR: Could not find kicked 
player in players_."
+                               " (socket: " << user << ")\n";
+                       } else {
+                               
make_change_diff(games_and_users_list_.root(), NULL, "user",
+                                               pl2->second.config_address(), 
diff);
+                       }
+                       lobby_.send_data(diff, sock);
                        // Send the removed user the lobby game list.
                        send_doc(games_and_users_list_, user);
-                       // FIXME: should also send a user diff to the lobby
-                       //        to mark this player as available for others
                }
                return;
        // If info is being provided about the game state.




Related Messages


Powered by MHonArc, Updated Mon Mar 30 00:40:22 2009