Author: soliton
Date: Mon Oct 6 02:53:47 2008
New Revision: 29916
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29916&view=rev
Log:
* now save addons under data/ so we don't mix them with config files
(cherry picked from commit a1f47a4530e327f0a7a1433840090c8919a6cffd)
Modified:
branches/1.4/src/campaign_server/campaign_server.cpp
Modified: branches/1.4/src/campaign_server/campaign_server.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/campaign_server/campaign_server.cpp?rev=29916&r1=29915&r2=29916&view=diff
==============================================================================
--- branches/1.4/src/campaign_server/campaign_server.cpp (original)
+++ branches/1.4/src/campaign_server/campaign_server.cpp Mon Oct 6 02:53:47
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"
@@ -51,7 +58,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);
}
@@ -271,14 +278,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 ©ing = 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()
@@ -503,7 +510,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"];
@@ -652,7 +659,7 @@
LOG_CS << "fatal network error: " <<
e.message <<"\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