Author: alink
Date: Sun Apr 12 06:32:38 2009
New Revision: 34751

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34751&view=rev
Log:
Hide the new 'faction_name' key (now only used in the choose-faction part)
This will prevent UMC to start using it (and thus create addon incompatible
with 1.6.0). Small change but a bit hackish, maybe safer to replace this by
a simple warning in the wiki ?

Modified:
    branches/1.6/src/multiplayer_connect.cpp
    branches/1.6/src/multiplayer_connect.hpp

Modified: branches/1.6/src/multiplayer_connect.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/multiplayer_connect.cpp?rev=34751&r1=34750&r2=34751&view=diff
==============================================================================
--- branches/1.6/src/multiplayer_connect.cpp (original)
+++ branches/1.6/src/multiplayer_connect.cpp Sun Apr 12 06:32:38 2009
@@ -627,9 +627,11 @@
        }
        res.append(cfg_);
 
-       // res["name"] will be overwritten below by a 1.6.0 bug
-       // so, record it here in another key
-       res["faction_name"] = res["name"];
+       if (parent_->write_faction_name_) {
+               // res["name"] will be overwritten below by a 1.6.0 bug
+               // record it here in a key only used for MP UI communication
+               res["faction_name"] = res["name"];
+       }
 
        if (cfg_.get_attribute("side").empty()
                        || cfg_["side"] != lexical_cast<std::string>(index_ + 
1))
@@ -992,6 +994,7 @@
        mp::ui(disp, _("Game Lobby: ") + params.name, game_config, c, gamelist),
        local_only_(local_players_only),
        level_(),
+       write_faction_name_(true),
        state_(),
        params_(params),
        era_sides_(),
@@ -1120,6 +1123,9 @@
 
 void connect::start_game()
 {
+       // Stop sending faction_name, not needed anymore
+       write_faction_name_ = false;
+
        // Resolves the "random faction", "random gender" and "random message"
        for (side_list::iterator itor = sides_.begin(); itor != sides_.end();
                        ++itor) {

Modified: branches/1.6/src/multiplayer_connect.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/multiplayer_connect.hpp?rev=34751&r1=34750&r2=34751&view=diff
==============================================================================
--- branches/1.6/src/multiplayer_connect.hpp (original)
+++ branches/1.6/src/multiplayer_connect.hpp Sun Apr 12 06:32:38 2009
@@ -249,6 +249,13 @@
        bool local_only_;
 
        config level_;
+       /**
+        * Indicate if we define the 'faction_name' key.
+        * 1.6.0 ignores this key and 1.6.1 uses it for MP UI communication
+        * but we skip it when starting the game, to avoid adding it the 
level's WML
+        * because we don't want this to be visible for UMC.
+        */
+       bool write_faction_name_;
 
        /** This is the "game state" object which is created by this dialog. */
        game_state state_;


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

Reply via email to