summaryrefslogtreecommitdiffstats
path: root/src/modules/UserBackendMysql
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/UserBackendMysql')
-rw-r--r--src/modules/UserBackendMysql/CMakeLists.txt7
-rw-r--r--src/modules/UserBackendMysql/UserBackendMysql.cpp15
2 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/UserBackendMysql/CMakeLists.txt b/src/modules/UserBackendMysql/CMakeLists.txt
new file mode 100644
index 0000000..5af1f1d
--- /dev/null
+++ b/src/modules/UserBackendMysql/CMakeLists.txt
@@ -0,0 +1,7 @@
+include_directories(${INCLUDES} ${MYSQL_INCLUDE_DIR})
+
+add_library(UserBackendMysql MODULE
+ UserBackendMysql.cpp
+)
+
+target_link_libraries(UserBackendMysql ${MYSQL_LIBRARIES}) \ No newline at end of file
diff --git a/src/modules/UserBackendMysql/UserBackendMysql.cpp b/src/modules/UserBackendMysql/UserBackendMysql.cpp
index af25f5b..ebea4dc 100644
--- a/src/modules/UserBackendMysql/UserBackendMysql.cpp
+++ b/src/modules/UserBackendMysql/UserBackendMysql.cpp
@@ -20,19 +20,16 @@
#include <config.h>
#include "UserBackendMysql.h"
-#include <Common/ActionManager.h>
#include <Common/ConfigEntry.h>
#include <Common/ConfigManager.h>
#include <Common/Logger.h>
+#include <Net/ThreadManager.h>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/regex.hpp>
-#define init UserBackendMysql_LTX_init
-#define deinit UserBackendMysql_LTX_deinit
-
namespace Mad {
namespace Modules {
@@ -155,7 +152,7 @@ bool UserBackendMysql::getUserList(const boost::function1<void, const std::map<u
users.insert(std::make_pair(user.getUid(), user));
}
- Common::ActionManager::get()->add(boost::bind(callback, users));
+ Net::ThreadManager::get()->pushWork(boost::bind(callback, users));
return true;
}
@@ -186,12 +183,12 @@ bool UserBackendMysql::getUserInfo(unsigned long uid, const boost::function1<voi
user.setGid(strtoul(row[1], 0, 10));
user.setFullName(row[3]);
- Common::ActionManager::get()->add(boost::bind(callback, user));
+ Net::ThreadManager::get()->pushWork(boost::bind(callback, user));
while((row = mysql_fetch_row(result)) != 0) {}
}
else {
- Common::ActionManager::get()->add(boost::bind(callback, Common::UserInfo()));
+ Net::ThreadManager::get()->pushWork(boost::bind(callback, Common::UserInfo()));
}
return true;
@@ -222,11 +219,11 @@ void UserBackendMysql::unregisterBackend() {
extern "C" {
-void init() {
+void UserBackendMysql_init() {
Mad::Modules::UserBackendMysql::registerBackend();
}
-void deinit() {
+void UserBackendMysql_deinit() {
Mad::Modules::UserBackendMysql::unregisterBackend();
}