mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-23 18:48:15 +00:00
Add optional fuh to campaignd.
This commit is contained in:
parent
9b7a958e9a
commit
b974423e2e
@ -88,7 +88,7 @@ opts.AddVariables(
|
||||
BoolVariable('prereqs','abort if prerequisites cannot be detected',True),
|
||||
('program_suffix', 'suffix to append to names of installed programs',"$version_suffix"),
|
||||
('version_suffix', 'suffix that will be added to default values of prefsdir, program_suffix and datadirname', ""),
|
||||
BoolVariable('forum_user_handler', 'Enable forum user handler in wesnothd', False),
|
||||
BoolVariable('forum_user_handler', 'Enable forum user handler in wesnothd and campaignd', False),
|
||||
('server_gid', 'group id of the user who runs wesnothd', ""),
|
||||
('server_uid', 'user id of the user who runs wesnothd', ""),
|
||||
BoolVariable('strict', 'Set to strict compilation', False),
|
||||
|
@ -1,6 +1,12 @@
|
||||
addon/validation.cpp
|
||||
server/common/dbconn.cpp
|
||||
server/common/user_handler.cpp
|
||||
server/common/forum_user_handler.cpp
|
||||
server/common/server_base.cpp
|
||||
server/common/simple_wml.cpp
|
||||
server/common/resultsets/ban_check.cpp
|
||||
server/common/resultsets/tournaments.cpp
|
||||
server/common/resultsets/game_history.cpp
|
||||
server/campaignd/addon_utils.cpp
|
||||
server/campaignd/auth.cpp
|
||||
server/campaignd/blacklist.cpp
|
||||
|
@ -191,7 +191,10 @@ else:
|
||||
|
||||
#---campaignd---
|
||||
campaignd_sources = GetSources("campaignd")
|
||||
env.WesnothProgram("campaignd", campaignd_sources + libwesnoth_core, have_server_prereqs, OBJPREFIX = "campaignd_")
|
||||
if env["forum_user_handler"]:
|
||||
env.WesnothProgram("campaignd", campaignd_sources + libwesnoth_core + libmariadbpp, have_server_prereqs, OBJPREFIX = "campaignd_")
|
||||
else:
|
||||
env.WesnothProgram("campaignd", campaignd_sources + libwesnoth_core, have_server_prereqs, OBJPREFIX = "campaignd_")
|
||||
|
||||
#---boost_unit_tests---
|
||||
test_sources = GetSources("boost_unit_tests")
|
||||
|
@ -42,6 +42,10 @@
|
||||
#include "hash.hpp"
|
||||
#include "utils/optimer.hpp"
|
||||
|
||||
#ifdef HAVE_MYSQLPP
|
||||
#include "server/common/forum_user_handler.hpp"
|
||||
#endif
|
||||
|
||||
#include <csignal>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
@ -260,6 +264,7 @@ std::string simple_wml_escape(const std::string& text)
|
||||
|
||||
server::server(const std::string& cfg_file, unsigned short port)
|
||||
: server_base(default_campaignd_port, true)
|
||||
, user_handler_(nullptr)
|
||||
, capabilities_(cap_defaults)
|
||||
, addons_()
|
||||
, dirty_addons_()
|
||||
@ -451,6 +456,12 @@ void server::load_config()
|
||||
}
|
||||
|
||||
LOG_CS << "Loaded addons metadata. " << addons_.size() << " addons found.\n";
|
||||
|
||||
#ifdef HAVE_MYSQLPP
|
||||
if(const config& user_handler = cfg_.child("user_handler")) {
|
||||
user_handler_.reset(new fuh(user_handler));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const server::request& r)
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "server/campaignd/blacklist.hpp"
|
||||
#include "server/common/server_base.hpp"
|
||||
#include "server/common/simple_wml.hpp"
|
||||
#include "server/common/user_handler.hpp"
|
||||
|
||||
#include <boost/asio/basic_waitable_timer.hpp>
|
||||
|
||||
@ -95,6 +96,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
std::unique_ptr<user_handler> user_handler_;
|
||||
typedef std::function<void (server*, const request& req)> request_handler;
|
||||
typedef std::map<std::string, request_handler> request_handlers_table;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user