Author: soliton
Date: Sun Oct  5 19:57:36 2008
New Revision: 29909

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29909&view=rev
Log:
* now save addons under data/ so we don't mix them with config files

Modified:
    trunk/src/campaign_server/campaign_server.cpp

Modified: trunk/src/campaign_server/campaign_server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/campaign_server/campaign_server.cpp?rev=29909&r1=29908&r2=29909&view=diff
==============================================================================
--- trunk/src/campaign_server/campaign_server.cpp (original)
+++ trunk/src/campaign_server/campaign_server.cpp Sun Oct  5 19:57:36 2008
@@ -11,6 +11,13 @@
 
    See the COPYING file for more details.
    */
+
+/**
+ * @file campaign_server/campaign_server.cpp
+ * Wesnoth addon server.
+ * Expects a "server.cfg" config file in the current directory
+ * and saves addons under data/.
+ */
 
 #include "config.hpp"
 #include "filesystem.hpp"
@@ -54,7 +61,7 @@
 /** @todo FIXME: should define SIGINT here too, but to what? */
 
 static void exit_sighup(int signal) {
-       assert(signal == SIGHUP);                                               
                                                                                
                      
+       assert(signal == SIGHUP);
        LOG_CS << "SIGHUP caught, exiting without cleanup immediately.\n";
        exit(1);
 }
@@ -286,14 +293,14 @@
                if (dir->find_child("file", "name", "COPYING.TXT")) return;
 
                // Copy over COPYING.txt
-               std::string contents = read_file("data/COPYING.txt");
+               std::string contents = read_file("COPYING.txt");
                config &copying = dir->add_child("file");
                copying["name"] = "COPYING.txt";
                copying["contents"] = contents;
 
                if (contents.empty()) {
-                       std::cerr << "Could not find " << "data/COPYING.txt" <<
-                               ", path is \"" << game_config::path << "\"\n";
+                       LOG_CS << "Could not find COPYING.txt, path is \""
+                               << game_config::path << "\"\n";
                }
        }
        void campaign_server::convert_binary_to_gzip()
@@ -549,7 +556,7 @@
 
                                                        (*campaign)["title"] = 
(*upload)["title"];
                                                        (*campaign)["name"] = 
(*upload)["name"];
-                                                       (*campaign)["filename"] 
= (*upload)["name"];
+                                                       (*campaign)["filename"] 
= "data/" + (*upload)["name"];
                                                        
(*campaign)["passphrase"] = (*upload)["passphrase"];
                                                        (*campaign)["author"] = 
(*upload)["author"];
                                                        
(*campaign)["description"] = (*upload)["description"];
@@ -688,7 +695,7 @@
                                        LOG_CS << "fatal network error\n";
                                        throw;
                                } else {
-                                       LOG_CS <<"client disconnect : 
"<<e.message<<" " << network::ip_address(e.socket) << "\n";
+                                       LOG_CS << "client disconnect: " << 
e.message << " " << network::ip_address(e.socket) << "\n";
                                        e.disconnect();
                                }
                        } catch(config::error& /*e*/) {


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

Reply via email to