mail[Wesnoth-commits] r34213 - /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 28, 2009 - 21:08:
Author: soliton
Date: Sat Mar 28 21:08:52 2009
New Revision: 34213

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34213&view=rev
Log:
made accepted_versions_ a vector so we can choose what version to tell 
rejected clients by the order in the config file

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=34213&r1=34212&r2=34213&view=diff
==============================================================================
--- branches/1.6/src/server/server.cpp (original)
+++ branches/1.6/src/server/server.cpp Sat Mar 28 21:08:52 2009
@@ -323,7 +323,7 @@
        config read_config() const;
 
        // settings from the server config
-       std::set<std::string> accepted_versions_;
+       std::vector<std::string> accepted_versions_;
        std::map<std::string,config> redirected_versions_;
        std::map<std::string,config> proxy_versions_;
        std::vector<std::string> disallowed_names_;
@@ -564,13 +564,10 @@
        accepted_versions_.clear();
        const std::string& versions = cfg_["versions_accepted"];
        if (versions.empty() == false) {
-               const std::vector<std::string> 
accepted(utils::split(versions));
-               for (std::vector<std::string>::const_iterator i = 
accepted.begin(); i != accepted.end(); ++i) {
-                       accepted_versions_.insert(*i);
-               }
+               accepted_versions_ = utils::split(versions);
        } else {
-               accepted_versions_.insert(game_config::version);
-               accepted_versions_.insert("test");
+               accepted_versions_.push_back(game_config::version);
+               accepted_versions_.push_back("test");
        }
 
        redirected_versions_.clear();
@@ -954,7 +951,7 @@
                const simple_wml::string_span& version_str_span = 
(*version)["version"];
                const std::string version_str(version_str_span.begin(),
                                              version_str_span.end());
-               std::set<std::string>::const_iterator accepted_it;
+               std::vector<std::string>::const_iterator accepted_it;
                // Check if it is an accepted version.
                for (accepted_it = accepted_versions_.begin();
                        accepted_it != accepted_versions_.end(); 
++accepted_it) {




Related Messages


Powered by MHonArc, Updated Sat Mar 28 21:20:27 2009