From bfcc4c6858238f343508b53f7fe90b9e9ac0ed01 Mon Sep 17 00:00:00 2001 From: Huynh Tran Date: Mon, 27 Jun 2005 15:36:36 +0000 Subject: Removed debug code and actually use the generated config.h. --- src/main.cpp | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index b8a493f6..d83b87e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,7 @@ */ -#define TMWSERV_VERSION "0.0.1" +#include <../config.h> #include @@ -166,8 +166,9 @@ int main(int argc, char *argv[]) initialize(); // Ready for server work... - ConnectionHandler *connectionHandler = new ConnectionHandler(); - NetSession *session = new NetSession(); + std::auto_ptr + connectionHandler(new ConnectionHandler()); + std::auto_ptr session(new NetSession()); // Note: This is just an idea, we could also pass the connection handler // to the constructor of the account handler, upon which is would register @@ -176,34 +177,13 @@ int main(int argc, char *argv[]) //AccountHandler *accountHandler = new AccountHandler(); //connectionHandler->registerHandler(C2S_LOGIN, accountHandler); - LOG_INFO("The Mana World Server v" << TMWSERV_VERSION) - session->startListen(connectionHandler, SERVER_PORT); + LOG_INFO("The Mana World Server v" << PACKAGE_VERSION) + session->startListen(connectionHandler.get(), SERVER_PORT); LOG_INFO("Listening on port " << SERVER_PORT << "...") using namespace tmwserv; - Storage& store = Storage::instance("tmw"); - - // Test the database retrieval code - LOG_INFO("Attempting to retrieve account with username 'nym'") - Account* acc = store.getAccount("nym"); - if (acc) - { - LOG_INFO("Account name: " << acc->getName()) - LOG_INFO("Account email: " << acc->getEmail()) - - LOG_INFO("Attempting to get character 'Nym the Great'") - Being* character = acc->getCharacter("Nym the Great"); - if (character) { - LOG_INFO("Character name: " << character->getName()) - } - else { - LOG_WARN("No characters found") - } - } - else { - LOG_WARN("Account 'nym' not found") - } + //Storage& store = Storage::instance("tmw"); SDL_Event event; -- cgit v1.2.3-70-g09d2