From 197582bcf7458cafb571fde7d37ef4415d0d8f4a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Sep 2009 23:43:56 +0200 Subject: Renamed mad -> madd There are too many programs called mad... --- src/CMakeLists.txt | 4 +-- src/Core/CMakeLists.txt | 2 -- src/mad.conf | 6 ---- src/mad.cpp | 84 ------------------------------------------------- src/madd.conf | 6 ++++ src/madd.cpp | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 94 deletions(-) delete mode 100644 src/mad.conf delete mode 100644 src/mad.cpp create mode 100644 src/madd.conf create mode 100644 src/madd.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b705a89..cb1ec1e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,8 +21,8 @@ include_directories(${INCLUDES}) add_executable(mad-server mad-server.cpp) target_link_libraries(mad-server Server Common Net Core) -add_executable(mad mad.cpp) -target_link_libraries(mad Daemon Common Net Core) +add_executable(madd madd.cpp) +target_link_libraries(madd Daemon Common Net Core) add_executable(madc madc.cpp) target_link_libraries(madc Client Common Net Core ${EDITLINE_LIBRARY}) diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index 28c0dd5..50e62c8 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -17,9 +17,7 @@ mad_library(Core Configurable.h Exception.cpp Exception.h Logger.h - LoggerBase.h LogManager.cpp LogManager.h - RemoteLogger.h Signals.h ThreadManager.cpp ThreadManager.h Tokenizer.cpp Tokenizer.h diff --git a/src/mad.conf b/src/mad.conf deleted file mode 100644 index 5066efe..0000000 --- a/src/mad.conf +++ /dev/null @@ -1,6 +0,0 @@ -LoadModule "SystemBackendPosix" -LoadModule "SystemBackendProc" - -Log Console { - Level "debug" -} diff --git a/src/mad.cpp b/src/mad.cpp deleted file mode 100644 index fbf9a87..0000000 --- a/src/mad.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * mad.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along - * with this program. If not, see . - */ - -#include "Core/ConfigManager.h" -#include "Core/LogManager.h" - -#include "Common/ModuleManager.h" -#include "Common/RequestManager.h" -#include "Common/ClientConnection.h" -#include "Common/Requests/IdentifyRequest.h" -#include "Common/RequestHandlers/FSInfoRequestHandler.h" -#include "Common/RequestHandlers/StatusRequestHandler.h" - -#include "Daemon/Application.h" -#include "Daemon/Backends/NetworkLogger.h" -#include "Daemon/RequestHandlers/CommandRequestHandler.h" - -using namespace Mad; - - -int main() { - Daemon::Application application; - - application.getConfigManager()->loadFile("mad.conf"); - application.getConfigManager()->finish(); - - application.getRequestManager()->registerPacketType("Command"); - application.getRequestManager()->registerPacketType("FSInfo"); - application.getRequestManager()->registerPacketType("GetStatus"); - - Common::ClientConnection *connection = new Common::ClientConnection(&application); - - try { - application.getRequestManager()->registerConnection(connection); - - connection->connect(boost::asio::ip::tcp::endpoint( - boost::asio::ip::address_v4::from_string("127.0.0.1"), 6666)); - - connection->waitWhileConnecting(); - - boost::shared_ptr networkLogger(new Daemon::Backends::NetworkLogger(&application, connection)); - application.getLogManager()->registerLogger(networkLogger); - - { - boost::shared_ptr request(new Common::Requests::IdentifyRequest(&application, "test")); - application.getRequestManager()->sendRequest(connection, request); - request->wait(); - } - application.log("Identified."); - - connection->waitWhileConnected(); - - application.getLogManager()->unregisterLogger(networkLogger); - - application.getRequestManager()->unregisterConnection(connection); - } - catch(Core::Exception &e) { - application.logf(Core::Logger::LOG_CRITICAL, "Connection error: %s", e.what()); - } - - delete connection; - - application.getRequestManager()->unregisterPacketType("Command"); - application.getRequestManager()->unregisterPacketType("FSInfo"); - application.getRequestManager()->unregisterPacketType("GetStatus"); - - return 0; -} diff --git a/src/madd.conf b/src/madd.conf new file mode 100644 index 0000000..5066efe --- /dev/null +++ b/src/madd.conf @@ -0,0 +1,6 @@ +LoadModule "SystemBackendPosix" +LoadModule "SystemBackendProc" + +Log Console { + Level "debug" +} diff --git a/src/madd.cpp b/src/madd.cpp new file mode 100644 index 0000000..0062d01 --- /dev/null +++ b/src/madd.cpp @@ -0,0 +1,84 @@ +/* + * mad.cpp + * + * Copyright (C) 2008 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this program. If not, see . + */ + +#include "Core/ConfigManager.h" +#include "Core/LogManager.h" + +#include "Common/ModuleManager.h" +#include "Common/RequestManager.h" +#include "Common/ClientConnection.h" +#include "Common/Requests/IdentifyRequest.h" +#include "Common/RequestHandlers/FSInfoRequestHandler.h" +#include "Common/RequestHandlers/StatusRequestHandler.h" + +#include "Daemon/Application.h" +#include "Daemon/Backends/NetworkLogger.h" +#include "Daemon/RequestHandlers/CommandRequestHandler.h" + +using namespace Mad; + + +int main() { + Daemon::Application application; + + application.getConfigManager()->loadFile("madd.conf"); + application.getConfigManager()->finish(); + + application.getRequestManager()->registerPacketType("Command"); + application.getRequestManager()->registerPacketType("FSInfo"); + application.getRequestManager()->registerPacketType("GetStatus"); + + Common::ClientConnection *connection = new Common::ClientConnection(&application); + + try { + application.getRequestManager()->registerConnection(connection); + + connection->connect(boost::asio::ip::tcp::endpoint( + boost::asio::ip::address_v4::from_string("127.0.0.1"), 6666)); + + connection->waitWhileConnecting(); + + boost::shared_ptr networkLogger(new Daemon::Backends::NetworkLogger(&application, connection)); + application.getLogManager()->registerLogger(networkLogger); + + { + boost::shared_ptr request(new Common::Requests::IdentifyRequest(&application, "test")); + application.getRequestManager()->sendRequest(connection, request); + request->wait(); + } + application.log("Identified."); + + connection->waitWhileConnected(); + + application.getLogManager()->unregisterLogger(networkLogger); + + application.getRequestManager()->unregisterConnection(connection); + } + catch(Core::Exception &e) { + application.logf(Core::Logger::LOG_CRITICAL, "Connection error: %s", e.what()); + } + + delete connection; + + application.getRequestManager()->unregisterPacketType("Command"); + application.getRequestManager()->unregisterPacketType("FSInfo"); + application.getRequestManager()->unregisterPacketType("GetStatus"); + + return 0; +} -- cgit v1.2.3