link spectrum2 against boost/swiften
This commit is contained in:
parent
912ef389e8
commit
0fa08124e6
2 changed files with 15 additions and 1 deletions
|
@ -146,8 +146,22 @@ static void start_dfrotz(dfrotz &p, const std::string &game) {
|
|||
|
||||
class FrotzNetworkPlugin : public NetworkPlugin {
|
||||
public:
|
||||
Swift::BoostNetworkFactories *m_factories;
|
||||
Swift::BoostIOServiceThread m_boostIOServiceThread;
|
||||
boost::shared_ptr<Swift::Connection> m_conn;
|
||||
|
||||
FrotzNetworkPlugin(Config *config, Swift::SimpleEventLoop *loop, const std::string &host, int port) : NetworkPlugin() {
|
||||
this->config = config;
|
||||
m_factories = new Swift::BoostNetworkFactories(loop);
|
||||
m_conn = m_factories->getConnectionFactory()->createConnection();
|
||||
m_conn->onDataRead.connect(boost::bind(&FrotzNetworkPlugin::_handleDataRead, this, _1));
|
||||
// m_conn->onConnectFinished.connect(boost::bind(&FrotzNetworkPlugin::_handleConnected, this, _1));
|
||||
// m_conn->onDisconnected.connect(boost::bind(&FrotzNetworkPlugin::handleDisconnected, this));
|
||||
}
|
||||
|
||||
void _handleDataRead(boost::shared_ptr<Swift::SafeByteArray> data) {
|
||||
std::string d = Swift::safeByteArrayToString(*data);
|
||||
handleDataRead(d);
|
||||
}
|
||||
|
||||
void handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password) {
|
||||
|
|
|
@ -6,7 +6,7 @@ ADD_EXECUTABLE(spectrum2 ${SRC})
|
|||
ADD_DEPENDENCIES(spectrum2 spectrum2_libpurple_backend)
|
||||
ADD_DEPENDENCIES(spectrum2 spectrum2_libircclient-qt_backend)
|
||||
|
||||
target_link_libraries(spectrum2 transport)
|
||||
target_link_libraries(spectrum2 transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
|
||||
|
||||
INSTALL(TARGETS spectrum2 RUNTIME DESTINATION bin)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue