Author: ilor
Date: Tue May 19 11:02:32 2009
New Revision: 35749

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35749&view=rev
Log:
remove remaiing lobby/not_logged_in hacks from the game class as it is no loger 
used for these purposes

Modified:
    trunk/src/server/game.cpp
    trunk/src/server/game.hpp

Modified: trunk/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.cpp?rev=35749&r1=35748&r2=35749&view=diff
==============================================================================
--- trunk/src/server/game.cpp (original)
+++ trunk/src/server/game.cpp Tue May 19 11:02:32 2009
@@ -63,8 +63,7 @@
        save_replays_(save_replays),
        replay_save_path_(replay_save_path)
 {
-       // Hack to handle the pseudo games lobby_ and not_logged_in_.
-       if (owner_ == 0) return;
+       assert(owner_);
        players_.push_back(owner_);
        const player_map::iterator pl = player_info_->find(owner_);
        if (pl == player_info_->end()) {
@@ -78,9 +77,6 @@
 
 game::~game()
 {
-       // Hack to handle the pseudo games lobby_ and not_logged_in_.
-       if (owner_ == 0) return;
-
        try {
                save_replay();
 
@@ -918,11 +914,6 @@
                        << player << ")\n";
                return false;
        }
-       // Hack to handle the pseudo games lobby_ and not_logged_in_.
-       if (owner_ == 0) {
-               observers_.push_back(player);
-               return true;
-       }
        const player_map::iterator user = player_info_->find(player);
        if (user == player_info_->end()) {
                ERR_GAME << "ERROR: Could not find user in player_info_. 
(socket: "
@@ -992,18 +983,6 @@
                        << player << ")\n";
                return false;
        }
-       // Hack to handle the pseudo games lobby_ and not_logged_in_.
-       if (owner_ == 0) {
-               const user_vector::iterator itor =
-                       std::find(observers_.begin(), observers_.end(), player);
-               if (itor != observers_.end()) {
-                       observers_.erase(itor);
-               } else {
-                       ERR_GAME << "ERROR: Observer is not in this game. 
(socket: "
-                               << player << ")\n";
-               }
-               return false;
-       }
        DBG_GAME << debug_player_info();
        DBG_GAME << "removing player...\n";
 
@@ -1305,16 +1284,6 @@
        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){
-               observers_.insert(observers_.end(), users.begin(), users.end());
-       }
-       else{
-               players_.insert(players_.end(), users.begin(), users.end());
-       }
-}
-
 const user_vector game::all_game_users() const {
        user_vector res;
 

Modified: trunk/src/server/game.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.hpp?rev=35749&r1=35748&r2=35749&view=diff
==============================================================================
--- trunk/src/server/game.hpp (original)
+++ trunk/src/server/game.hpp Tue May 19 11:02:32 2009
@@ -106,14 +106,6 @@
 
        /** Adds players and observers into one vector and returns that. */
        const user_vector all_game_users() const;
-
-       /**
-        * Adds players from one game to another. This is used to add players 
and
-        * observers from a game to the lobby (which is also implemented as a 
game),
-        * if that game ends. The second parameter controls, wether the players 
are
-        * added to the players_ or observers_ vector (default observers_).
-        */
-       void add_players(const game& other_game, const bool observer = true);
 
        void start_game(const player_map::const_iterator starter);
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to