From ca28c0e618890330d429c0dc12429255b20f0c90 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:44 +0200 Subject: tagging ychat-0.5.0 --- main.cpp | 98 ++++++++++++++++++++++++---------------------------------------- 1 file changed, 36 insertions(+), 62 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index b59b628..08f89f8 100755 --- a/main.cpp +++ b/main.cpp @@ -19,8 +19,6 @@ * */ -#include - // needed for ignoring SIGPIPE. #include @@ -45,80 +43,56 @@ // include the socket manager. #include "s_sock.h" -// include the language manager. +// include the language manager #include "s_lang.h" -// include the ncurses admin menu. -#include "s_ncur.h" - -// include the session manager. +// include the session manager #include "s_sman.h" -// include the MySQL Connection Manager. -#include "s_mman.h" - using namespace std; int main() { #ifdef VERBOSE - cout << " ___ _ _ " << endl - << " _ _ / __\\ |__ __ _| |_ " << endl - << "| | | |/ / | '_ \\ / _` | __|" << endl - << "| |_| / /___| | | | (_| | |_ " << endl - << " \\__, \\____/|_| |_|\\__,_|\\__|" << endl - << " |___/ " << endl << endl - - << DESCRIP << endl - << VERSION << ", " - << CONTACT << endl - << SEPERAT << endl - << STARTMS << endl ; -#endif - // ignore SIGPIPE. otherwise the server will shut down with "Broken pipe" if - // a client unexpected disconnects himself from a SOCK_STREAM. - signal( SIGPIPE, SIG_IGN ); - - // all the static data classes have to be initialized once. otherwise they will - // contain only empty pointers and the chat server won't work correctly. - // the order of the initializations is very importand. for example the s_html::init() - // invokations assumes an initialized s_conf class. - s_mutx::init(); // init the mutex manager. - s_conf::init(); // init the config manager. - s_html::init(); // init the html-template manager. - s_lang::init(); // init the language manager - s_sman::init(); // init the session manager. - s_mman::init(); // init the mysql connection manager. - s_sock::init(); // init the socket manager. - s_chat::init(); // init the chat manager. - - // begin to draw the ncurses amdin interface in a new pthread. -#ifdef NCURSES - - s_ncur::init(); // init the ncurses admin interface. - pthread_t admin_thread; - pthread_create( &admin_thread, - NULL, - s_ncur::get().start, (void*) &s_ncur::get() ); - - // wait until ncurses interface has been initialized. - while ( ! s_ncur::get().is_ready() ) - usleep(100); +cout << " ___ _ _ " << endl + << " _ _ / __\\ |__ __ _| |_ " << endl + << "| | | |/ / | '_ \\ / _` | __|" << endl + << "| |_| / /___| | | | (_| | |_ " << endl + << " \\__, \\____/|_| |_|\\__,_|\\__|" << endl + << " |___/ " << endl << endl + + << DESCRIP << endl + << VERSION << ", " + << CONTACT << endl + << SEPERAT << endl + << STARTMS << endl ; #endif - - - s_modl::init(); // init the module-loader manager. - - // start the socket manager. this one will listen for incoming http requests and will - // forward them to the specified routines which will generate a http response. - s_sock::get().start(); - + // ignore SIGPIPE. otherwise the server will shut down with "Broken pipe" if + // a client unexpected disconnects himself from a SOCK_STREAM. + signal( SIGPIPE, SIG_IGN ); + + // all the static data classes have to be initialized once. otherwise they will + // contain only empty pointers and the chat server won't work correctly. + // the order of the initializations is very importand. for example the s_html::init() + // invokations assumes an initialized s_conf class. + s_mutx::init(); // init the mutex manager. + s_conf::init(); // init the config manager. + s_html::init(); // init the html-template manager. + s_lang::init(); // init the language manager + s_sman::init(); // init the session manager. + s_modl::init(); // init the module-loader manager. + s_sock::init(); // init the socket manager. + s_chat::init(); // init the chat manager. + + // start the socket manager. this one will listen for incoming http requests and will + // forward them to the specified routines which will generate a http response. + s_sock::get().start(); #ifdef VERBOSE - cout << DOWNMSG << endl; + cout << DOWNMSG << endl; #endif - return 0; + return 0; } -- cgit v1.2.3