mail[Wesnoth-commits] r34118 - in /branches/1.6/src/server: game.cpp 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 25, 2009 - 19:13:
Author: soliton
Date: Wed Mar 25 19:13:24 2009
New Revision: 34118

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34118&view=rev
Log:
added a todo + some tweaks

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

Modified: branches/1.6/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/server/game.cpp?rev=34118&r1=34117&r2=34118&view=diff
==============================================================================
--- branches/1.6/src/server/game.cpp (original)
+++ branches/1.6/src/server/game.cpp Wed Mar 25 19:13:24 2009
@@ -876,6 +876,8 @@
        return true;
 }
 
+//@todo differentiate between "observers not allowed" and "player already in 
the game" errors.
+//      maybe return a string with an error message.
 bool game::add_player(const network::connection player, bool observer, bool 
admin) {
        if(is_member(player)) {
                ERR_GAME << "ERROR: Player is already in this game. (socket: "

Modified: branches/1.6/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/server/server.cpp?rev=34118&r1=34117&r2=34118&view=diff
==============================================================================
--- branches/1.6/src/server/server.cpp (original)
+++ branches/1.6/src/server/server.cpp Wed Mar 25 19:13:24 2009
@@ -1892,7 +1892,8 @@
                }
                LOG_SERVER << network::ip_address(sock) << "\t" << 
pl->second.name()
                        << "\tjoined game:\t\"" << (*g)->name()
-                       << "\" (" << game_id << (observer ? ") as an 
observer.\n" : ").\n");
+                       << "\" (" << game_id << ")" << (observer ? " as an 
observer" : "")
+                       << ". (socket: " << sock << ")\n";
                lobby_.remove_player(sock);
                (*g)->describe_slots();
 
@@ -1934,11 +1935,8 @@
                return;
        }
 
-       std::vector<wesnothd::game*>::iterator itor;
-       for (itor = games_.begin(); itor != games_.end(); ++itor) {
-               if ((*itor)->is_owner(sock) || (*itor)->is_member(sock))
-                       break;
-       }
+       const std::vector<wesnothd::game*>::iterator itor =
+               std::find_if(games_.begin(),games_.end(), 
wesnothd::game_is_member(sock));
        if (itor == games_.end()) {
                ERR_SERVER << "ERROR: Could not find game for player: "
                        << pl->second.name() << ". (socket: " << sock << 
")\n";




Related Messages


Powered by MHonArc, Updated Wed Mar 25 19:20:24 2009