mail[Wesnoth-commits] r33301 - in /trunk: changelog src/multiplayer.cpp 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 03, 2009 - 10:28:
Author: soliton
Date: Tue Mar  3 10:28:16 2009
New Revision: 33301

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33301&view=rev
Log:
send lobby diffs seperately; fixes bug #13099: MP lobby player list becomes 
inaccurate over time

Modified:
    trunk/changelog
    trunk/src/multiplayer.cpp
    trunk/src/server/server.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33301&r1=33300&r2=33301&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar  3 10:28:16 2009
@@ -3,6 +3,7 @@
    * updated translations: Chinese (Simplified)
  * Miscellaneous and bug fixes:
    * Fix another savegame cache corruption
+   * Fixed bug #13099: MP lobby player list becomes inaccurate over time
 
 Version 1.5.12:
  * Add-on server:

Modified: trunk/src/multiplayer.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer.cpp?rev=33301&r1=33300&r2=33301&view=diff
==============================================================================
--- trunk/src/multiplayer.cpp (original)
+++ trunk/src/multiplayer.cpp Tue Mar  3 10:28:16 2009
@@ -564,7 +564,8 @@
                                        gui::show_error_message(disp, 
error.message);
                                }
                        }
-                       //update lobby content
+                       // update lobby content unconditionally because we 
might have left only after the
+                       // game ended in which case we ignored the gamelist 
and need to request it again
                        network::send_data(config("refresh_lobby"), 0, true);
                        break;
                case mp::ui::CREATE:

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=33301&r1=33300&r2=33301&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Tue Mar  3 10:28:16 2009
@@ -2229,10 +2229,9 @@
 
        // Send a diff of the gamelist with the game deleted to players in 
the lobby
        simple_wml::document diff;
-       bool send_diff = false;
        if(make_delete_diff(*gamelist, "gamelist", "game",
                            (*game_it)->description(), diff)) {
-               send_diff = true;
+               lobby_.send_data(diff);
        }
 
        // Delete the game from the games_and_users_list_.
@@ -2247,6 +2246,7 @@
                LOG_SERVER << "Could not find game (" << (*game_it)->id()
                        << ") to delete in games_and_users_list_.\n";
        }
+
        const wesnothd::user_vector& users = (*game_it)->all_game_users();
        // Set the availability status for all quitting users.
        for (wesnothd::user_vector::const_iterator user = users.begin();
@@ -2255,17 +2255,15 @@
                const wesnothd::player_map::iterator pl = 
players_.find(*user);
                if (pl != players_.end()) {
                        pl->second.mark_available();
+                       simple_wml::document udiff;
                        if (make_change_diff(games_and_users_list_.root(), 
NULL,
-                                            "user", 
pl->second.config_address(), diff)) {
-                               send_diff = true;
+                                            "user", 
pl->second.config_address(), udiff)) {
+                               lobby_.send_data(udiff);
                        }
                } else {
                        ERR_SERVER << "ERROR: delete_game(): Could not find 
user in players_. (socket: "
                                << *user << ")\n";
                }
-       }
-       if (send_diff) {
-               lobby_.send_data(diff);
        }
 
        //send users in the game a notification to leave the game since it 
has ended




Related Messages


Powered by MHonArc, Updated Tue Mar 03 10:40:21 2009