diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-05-20 09:26:47 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-05-20 09:26:47 +0000 |
commit | c548f6899f0d188ef3a5a3d7abbb3b32e9addaa6 (patch) | |
tree | b5687ca854f5eb086f37ef227eea7733d2a3c3f3 /src/main.cpp | |
parent | 149efe91e50bf0e298761bb941e20ce4d8362314 (diff) | |
download | manaserv-c548f6899f0d188ef3a5a3d7abbb3b32e9addaa6.tar.gz manaserv-c548f6899f0d188ef3a5a3d7abbb3b32e9addaa6.tar.bz2 manaserv-c548f6899f0d188ef3a5a3d7abbb3b32e9addaa6.tar.xz manaserv-c548f6899f0d188ef3a5a3d7abbb3b32e9addaa6.zip |
Changed ConnectionHandler and NetComputer into low-level base classes;
they are overloaded by client-aware classes. Forced statement syntax for
loggers.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main.cpp b/src/main.cpp index e7c599cb..98eb2989 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,7 +100,7 @@ ChatChannelManager *chatChannelManager; GameHandler *gameHandler; /** Primary connection handler */ -ConnectionHandler *connectionHandler; +ClientConnectionHandler *connectionHandler; /** * Initializes the server. @@ -150,8 +150,8 @@ void initialize() Logger::instance().setTeeMode(true); config.init(configPath); - LOG_INFO("Using Config File: " << configPath, 0) - LOG_INFO("Using Log File: " << logPath, 0) + LOG_INFO("Using Config File: " << configPath, 0); + LOG_INFO("Using Log File: " << logPath, 0); // Initialize the slang's filter. stringFilter = new StringFilter(&config); @@ -164,7 +164,7 @@ void initialize() chatHandler = new ChatHandler(); accountHandler = new AccountHandler(); gameHandler = new GameHandler(); - connectionHandler = new ConnectionHandler(); + connectionHandler = new ClientConnectionHandler(); // Reset to default segmentation fault handling for debugging purposes signal(SIGSEGV, SIG_DFL); @@ -174,13 +174,13 @@ void initialize() // initialize enet. if (enet_initialize() != 0) { - LOG_FATAL("An error occurred while initializing ENet", 0) + LOG_FATAL("An error occurred while initializing ENet", 0); exit(2); } // initialize scripting subsystem. #ifdef RUBY_SUPPORT - LOG_INFO("Script Language: " << scriptLanguage, 0) + LOG_INFO("Script Language: " << scriptLanguage, 0); // initialize ruby ruby_init(); @@ -194,17 +194,17 @@ void initialize() rb_load_file("scripts/init.rb"); rubyStatus = ruby_exec(); #else - LOG_WARN("No Scripting Language Support.", 0) + LOG_WARN("No Scripting Language Support.", 0); #endif #if defined (MYSQL_SUPPORT) - LOG_INFO("Using MySQL DB Backend.", 0) + LOG_INFO("Using MySQL DB Backend.", 0); #elif defined (POSTGRESQL_SUPPORT) - LOG_INFO("Using PostGreSQL DB Backend.", 0) + LOG_INFO("Using PostGreSQL DB Backend.", 0); #elif defined (SQLITE_SUPPORT) - LOG_INFO("Using SQLite DB Backend.", 0) + LOG_INFO("Using SQLite DB Backend.", 0); #else - LOG_WARN("No Database Backend Support.", 0) + LOG_WARN("No Database Backend Support.", 0); #endif // initialize configuration defaults @@ -298,14 +298,14 @@ void parseOptions(int argc, char *argv[]) unsigned short verbosityLevel; verbosityLevel = atoi(optarg); tmwserv::utils::Logger::instance().setVerbosity(verbosityLevel); - LOG_INFO("Setting Log Verbosity Level to " << verbosityLevel, 0) + LOG_INFO("Setting Log Verbosity Level to " << verbosityLevel, 0); break; case 'p': // Change the port to listen on. unsigned short portToListenOn; portToListenOn = atoi(optarg); config.setValue("ListenOnPort", portToListenOn); - LOG_INFO("Setting Default Port to " << portToListenOn, 0) + LOG_INFO("Setting Default Port to " << portToListenOn, 0); break; } } @@ -319,7 +319,7 @@ int main(int argc, char *argv[]) { int elapsedWorldTicks; - LOG_INFO("The Mana World Server v" << PACKAGE_VERSION, 0) + LOG_INFO("The Mana World Server v" << PACKAGE_VERSION, 0); // Parse Command Line Options parseOptions(argc, argv); @@ -396,13 +396,13 @@ int main(int argc, char *argv[]) // - Handle all messages that are in the message queue // - Update all active objects/beings connectionHandler->process(); - state.update(*connectionHandler); + state.update(); connectionHandler->process(); } worldTimer.sleep(); } - LOG_INFO("Received: Quit signal, closing down...", 0) + LOG_INFO("Received: Quit signal, closing down...", 0); connectionHandler->stopListen(); deinitialize(); } |